2015-02-09 77 views
0

我想在擴展TableMapper的非常基本的mapper上使用HbaseTestingUtility運行測試。 在我的測試課中,我使用utility.startMiniCluster()啓動MiniCluster,並在設置方法中使用utility.createTable(tablename_bytes, familyname_bytes)創建測試表。HbaseTestingUtility和MapReduce作業

然後我用啓動映射:

Job job = new Job(utility.getConfiguration()); //Job.getInstance(); 
TableMapReduceUtil.initTableMapperJob(tableName, new Scan(),MyBasicHbaseMapper.class,Text.class, Text.class, job); 
job.waitForCompletion(true); 

這是我的錯誤:

java.io.FileNotFoundException: File does not exist: hdfs://localhost:57276/Users/user1/.m2/repository/org/cloudera/htrace/htrace-core/2.04/htrace-core-2.04.jar 

這個jar文件是~/.m2/repository/org/cloudera/htrace/htrace-core/2.04/htrace-core-2.04.jar

我在做什麼錯?

回答

0

我遇到類似的問題,敲我的頭靠在了數個小時後,終於實現瞭解決方案......

後立即調用:

utility.startMiniCluster(); 

調用:

utility.startMiniMapReduceCluster(); 

方法#startMiniCluster只啓動HBase,HDFS和Zookeeper的小型集羣。啓動MapReduce小型集羣需要#startMiniMapReduceCluster !!

順便說一句,你的測試處理結束後,一定要調用:

utility.shutdownMiniMapReduceCluster(); 
utility.shutdownMiniCluster();