Hey Arvind-
You'll probably want to look at the Configuration.reload() method, as demonstrated:

public class TestReloadConfig {
  public static void main(String[] args) throws IOException {
    Configuration conf = new Configuration();
    FileSystem fs = FileSystem.get(conf); // pull in dfs settings

    System.out.println("Replication = " + conf.get("dfs.replication"));
    System.out.println("Update file and press <enter>");
    new Scanner(System.in).nextLine();

    conf.reloadConfiguration();
    System.out.println("Now replication = " + conf.get("dfs.replication"));
  }
}

Note from the Javadoc: Values that are added via set methods will overlay values read from the resources.

Hope this helps.  Write back if you have more questions.

Thanks,
Jakob Homan
Hadoop at Yahoo!


Arvind Sharma wrote:
Hi,

I was wondering if there is way to let Hadoop re-read the config file 
(hadoop-site.xml) after  making some changes in it.

I don't want to restart the whole cluster for that.

I am using Hadoop 0.19.2

Thanks!
Arvind




Reply via email to