Java Code Examples for org.apache.hadoop.conf.Configuration.setQuietMode()
The following are Jave code examples for showing how to use
setQuietMode() of the
org.apache.hadoop.conf.Configuration
class.
You can vote up the examples you like. Your votes will be used in our system to get
more good examples.
+ Save this method
Example 1
Project: big-data-benchmark File: HadoopWordCount.java View Source Code | 7 votes |
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)); }
Example 2
Project: hadoop-oss File: TestFsShell.java View Source Code | 6 votes |
@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")); }
Example 3
Project: hadoop-oss File: FsShell.java View Source Code | 5 votes |
/** * 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); }
Example 4
Project: hadoop File: FsShell.java View Source Code | 5 votes |
/** * 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); }