hadoop-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kuhn <martin.k...@affinitas.de>
Subject Re: Checking current configuration values?
Date Tue, 19 Oct 2010 07:33:13 GMT
> Is there a means of looking up the current value of a configuration
> variable, in particular one that is not explicitly set in one of the
> .conf files?

http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/conf/Configuration.html#get%28java.lang.String%29


> For instance if I wanted to find the value of "io.file.buffer.size"
> (just a random example) how would I go about it?

public class MyApp extends Configured implements Tool {

     public int run(final String[] args) throws Exception {
         final Configuration conf = getConf();
         ...
         final String property = conf.get("io.file.buffer.size");
         ...
     }

     public static void main(final String[] args) throws Exception {
         final int res = ToolRunner.run(new Configuration(), new 
MyApp(), args);
         System.exit(res);
     }

}

Mime
View raw message