當前位置: 首頁>>代碼示例>>Java>>正文


Java Job.setWorkingDirectory方法代碼示例

本文整理匯總了Java中org.apache.hadoop.mapreduce.Job.setWorkingDirectory方法的典型用法代碼示例。如果您正苦於以下問題:Java Job.setWorkingDirectory方法的具體用法?Java Job.setWorkingDirectory怎麽用?Java Job.setWorkingDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.hadoop.mapreduce.Job的用法示例。


在下文中一共展示了Job.setWorkingDirectory方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: runIncrementalPELoad

import org.apache.hadoop.mapreduce.Job; //導入方法依賴的package包/類
private void runIncrementalPELoad(Configuration conf, HTableDescriptor tableDescriptor,
    RegionLocator regionLocator, Path outDir) throws IOException, UnsupportedEncodingException,
    InterruptedException, ClassNotFoundException {
  Job job = new Job(conf, "testLocalMRIncrementalLoad");
  job.setWorkingDirectory(util.getDataTestDirOnTestFS("runIncrementalPELoad"));
  job.getConfiguration().setStrings("io.serializations", conf.get("io.serializations"),
      MutationSerialization.class.getName(), ResultSerialization.class.getName(),
      KeyValueSerialization.class.getName());
  setupRandomGeneratorMapper(job);
  HFileOutputFormat2.configureIncrementalLoad(job, tableDescriptor, regionLocator);
  FileOutputFormat.setOutputPath(job, outDir);

  assertFalse(util.getTestFileSystem().exists(outDir)) ;

  assertEquals(regionLocator.getAllRegionLocations().size(), job.getNumReduceTasks());

  assertTrue(job.waitForCompletion(true));
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:19,代碼來源:TestHFileOutputFormat2.java

示例2: runIncrementalPELoad

import org.apache.hadoop.mapreduce.Job; //導入方法依賴的package包/類
private void runIncrementalPELoad(
    Configuration conf, HTable table, Path outDir)
throws Exception {
  Job job = new Job(conf, "testLocalMRIncrementalLoad");
  job.setWorkingDirectory(util.getDataTestDirOnTestFS("runIncrementalPELoad"));
  job.getConfiguration().setStrings("io.serializations", conf.get("io.serializations"),
      MutationSerialization.class.getName(), ResultSerialization.class.getName(),
      KeyValueSerialization.class.getName());
  setupRandomGeneratorMapper(job);
  HFileOutputFormat2.configureIncrementalLoad(job, table.getTableDescriptor(),
      table.getRegionLocator());
  FileOutputFormat.setOutputPath(job, outDir);

  Assert.assertFalse( util.getTestFileSystem().exists(outDir)) ;

  assertEquals(table.getRegionLocator().getAllRegionLocations().size(), job.getNumReduceTasks());

  assertTrue(job.waitForCompletion(true));
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:20,代碼來源:TestHFileOutputFormat.java

示例3: testJobConfiguration

import org.apache.hadoop.mapreduce.Job; //導入方法依賴的package包/類
@Ignore("Goes zombie too frequently; needs work. See HBASE-14563") @Test
public void testJobConfiguration() throws Exception {
  Configuration conf = new Configuration(this.util.getConfiguration());
  conf.set(HConstants.TEMPORARY_FS_DIRECTORY_KEY, util.getDataTestDir("testJobConfiguration")
      .toString());
  Job job = new Job(conf);
  job.setWorkingDirectory(util.getDataTestDir("testJobConfiguration"));
  RegionLocator regionLocator = Mockito.mock(RegionLocator.class);
  setupMockStartKeys(regionLocator);
  HFileOutputFormat2.configureIncrementalLoad(job, new HTableDescriptor(), regionLocator);
  assertEquals(job.getNumReduceTasks(), 4);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:13,代碼來源:TestHFileOutputFormat2.java

示例4: testJobConfiguration

import org.apache.hadoop.mapreduce.Job; //導入方法依賴的package包/類
@Test
public void testJobConfiguration() throws Exception {
  Configuration conf = new Configuration(this.util.getConfiguration());
  conf.set("hbase.fs.tmp.dir", util.getDataTestDir("testJobConfiguration").toString());
  Job job = new Job(conf);
  job.setWorkingDirectory(util.getDataTestDir("testJobConfiguration"));
  HTableDescriptor tableDescriptor = Mockito.mock(HTableDescriptor.class);
  RegionLocator regionLocator = Mockito.mock(RegionLocator.class);
  setupMockStartKeys(regionLocator);
  HFileOutputFormat2.configureIncrementalLoad(job, tableDescriptor, regionLocator);
  assertEquals(job.getNumReduceTasks(), 4);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:13,代碼來源:TestHFileOutputFormat.java


注:本文中的org.apache.hadoop.mapreduce.Job.setWorkingDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。