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


Java Configuration.setQuietMode方法代碼示例

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


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

示例1: main

import org.apache.hadoop.conf.Configuration; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
    BasicConfigurator.configure();
    Configuration conf = new Configuration();
    conf.setQuietMode(true);

    Job job = Job.getInstance(conf, "WordCount");
    job.setJarByClass(HadoopWordCount.class);

    job.setOutputKeyClass(Text.class);
    job.setOutputValueClass(IntWritable.class);

    job.setMapperClass(Map.class);
    job.setCombinerClass(Reduce.class);
    job.setReducerClass(Reduce.class);

    job.setInputFormatClass(TextInputFormat.class);
    job.setOutputFormatClass(TextOutputFormat.class);

    FileInputFormat.setInputPaths(job, new Path(args[0]));
    FileOutputFormat.setOutputPath(job, new Path(args[1] + "_" + System.currentTimeMillis()));

    long t = System.currentTimeMillis();
    job.waitForCompletion(true);

    System.out.println("TotalTime=" + (System.currentTimeMillis() - t));
}
 
開發者ID:hazelcast,項目名稱:big-data-benchmark,代碼行數:27,代碼來源:HadoopWordCount.java

示例2: testTracing

import org.apache.hadoop.conf.Configuration; //導入方法依賴的package包/類
@Test
public void testTracing() throws Throwable {
  Configuration conf = new Configuration();
  String prefix = "fs.shell.htrace.";
  conf.set(prefix + Tracer.SPAN_RECEIVER_CLASSES_KEY,
      SetSpanReceiver.class.getName());
  conf.set(prefix + Tracer.SAMPLER_CLASSES_KEY,
      AlwaysSampler.class.getName());
  conf.setQuietMode(false);
  FsShell shell = new FsShell(conf);
  int res;
  try {
    res = ToolRunner.run(shell, new String[]{"-help", "ls", "cat"});
  } finally {
    shell.close();
  }
  SetSpanReceiver.assertSpanNamesFound(new String[]{"help"});
  Assert.assertEquals("-help ls cat",
      SetSpanReceiver.getMap()
          .get("help").get(0).getKVAnnotations().get("args"));
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:22,代碼來源:TestFsShell.java

示例3: main

import org.apache.hadoop.conf.Configuration; //導入方法依賴的package包/類
/**
 * main() has some simple utility methods
 * @param argv the command and its arguments
 * @throws Exception upon error
 */
public static void main(String argv[]) throws Exception {
  FsShell shell = newShellInstance();
  Configuration conf = new Configuration();
  conf.setQuietMode(false);
  shell.setConf(conf);
  int res;
  try {
    res = ToolRunner.run(shell, argv);
  } finally {
    shell.close();
  }
  System.exit(res);
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:19,代碼來源:FsShell.java


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