本文整理匯總了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));
}
示例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"));
}
示例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);
}