HdfsUtils { public static Configuration configureURI(Configuration conf, LinkConfiguration linkConfiguration) { Configuration newConf = new Configuration(conf); if (linkConfiguration.linkConfig.uri != null) { newConf.set("fs.default.name", linkConfiguration.linkConfig.uri); newConf.set("fs.defaultFS", linkConfiguration.linkConfig.uri); } return newConf; }  static Configuration createConfiguration(LinkConfiguration linkConfig); static void configurationToContext(Configuration configuration, MutableContext context); static void contextToConfiguration(ImmutableContext context, Configuration configuration); static Configuration configureURI(Configuration conf, LinkConfiguration linkConfiguration); static boolean hasCustomFormat(LinkConfiguration linkConfiguration, FromJobConfiguration fromJobConfiguration); static boolean hasCustomFormat(LinkConfiguration linkConfiguration, ToJobConfiguration toJobConfiguration); static Object[] formatRecord(LinkConfiguration linkConfiguration,
                                      FromJobConfiguration fromJobConfiguration,
                                      Object[] record); static Object[] formatRecord(LinkConfiguration linkConfiguration,
                                    ToJobConfiguration toJobConfiguration,
                                    Object[] record); static final String DEFAULT_HADOOP_CONF_DIR; }
@Test public void testConfigureURI() throws Exception { final String TEST_URI = "hdfs: LinkConfiguration linkConfiguration = new LinkConfiguration(); Configuration conf = new Configuration(); assertNotEquals(TEST_URI, conf.get("fs.default.name")); assertNotEquals(TEST_URI, conf.get("fs.defaultFS")); linkConfiguration.linkConfig.uri = TEST_URI; conf = HdfsUtils.configureURI(conf, linkConfiguration); assertEquals(TEST_URI, conf.get("fs.default.name")); assertEquals(TEST_URI, conf.get("fs.defaultFS")); }