@Test public void newInstance_classloader_reuse() throws Exception { File file = putConf("conf/core-site.xml"); URL dir = file.getParentFile().toURI().toURL(); Configuration c1 = new ConfigurationProvider(dir).newInstance(); assertThat(isLoaded(c1), is(true)); Configuration c2 = new ConfigurationProvider(dir).newInstance(); assertThat(c2.getClassLoader(), is(sameInstance(c1.getClassLoader()))); }
public Configuration newInstance() { Configuration conf = new Configuration(true); conf.setClassLoader(loader); configure(conf); return conf; }
ConfigurationProvider { public Configuration newInstance() { Configuration conf = new Configuration(true); conf.setClassLoader(loader); configure(conf); return conf; } }
ConfigurationProvider { public Configuration newInstance() { Configuration conf = new Configuration(true); conf.setClassLoader(loader); configure(conf); return conf; } ConfigurationProvider();   ConfigurationProvider(Map<String, String> envp);  ConfigurationProvider(URL defaultConfigPath); }
ConfigurationProvider { public Configuration newInstance() { Configuration conf = new Configuration(true); conf.setClassLoader(loader); configure(conf); return conf; } ConfigurationProvider();   ConfigurationProvider(Map<String, String> envp);  ConfigurationProvider(URL defaultConfigPath); static URL getConfigurationPath(Map<String, String> environmentVariables); static File findHadoopCommand(); static File findHadoopCommand(Map<String, String> environmentVariables); Configuration newInstance(); }
ConfigurationProvider { public Configuration newInstance() { Configuration conf = new Configuration(true); conf.setClassLoader(loader); configure(conf); return conf; } ConfigurationProvider();   ConfigurationProvider(Map<String, String> envp);  ConfigurationProvider(URL defaultConfigPath); static URL getConfigurationPath(Map<String, String> environmentVariables); static File findHadoopCommand(); static File findHadoopCommand(Map<String, String> environmentVariables); Configuration newInstance();  }