public static Configuration createConfiguration ( File configurationDirectory ) { Configuration hadoopConfiguration = new Configuration ( ) ; hadoopConfiguration . addResource ( new Path ( new File ( configurationDirectory , "etc/hadoop/core-site.xml" ) . toString ( ) ) ) ; hadoopConfiguration . addResource ( new Path ( new File ( configurationDirectory , "etc/hadoop/hdfs-site.xml" ) . toString ( ) ) ) ; hadoopConfiguration . addResource ( new Path ( new File ( configurationDirectory , "etc/hadoop/mapred-site.xml" ) . toString ( ) ) ) ; return hadoopConfiguration ; }
This method provides the default configuration for Hadoop client . The configuration for the client is looked up in the provided directory . The Hadoop etc directory is expected there .