@Test public void mergeHadoopConfiguration() { org.apache.hadoop.conf.Configuration hadoopConfig = new org.apache.hadoop.conf.Configuration(); hadoopConfig.set(PropertyKey.S3A_ACCESS_KEY.toString(), TEST_S3_ACCCES_KEY); hadoopConfig.set(PropertyKey.S3A_SECRET_KEY.toString(), TEST_S3_SECRET_KEY); hadoopConfig.set(TEST_ALLUXIO_PROPERTY, TEST_ALLUXIO_VALUE); hadoopConfig.setBoolean(PropertyKey.ZOOKEEPER_ENABLED.getName(), true); hadoopConfig.set(PropertyKey.ZOOKEEPER_ADDRESS.getName(), "host1:port1,host2:port2;host3:port3"); hadoopConfig.set("hadoop.config.parameter", "hadoop config value"); mConf.merge( HadoopConfigurationUtils.getConfigurationFromHadoop(hadoopConfig), Source.RUNTIME); assertEquals(TEST_S3_ACCCES_KEY, mConf.get(PropertyKey.S3A_ACCESS_KEY)); assertEquals(TEST_S3_SECRET_KEY, mConf.get(PropertyKey.S3A_SECRET_KEY)); assertEquals(Source.RUNTIME, mConf.getSource(PropertyKey.S3A_ACCESS_KEY)); assertEquals(Source.RUNTIME, mConf.getSource(PropertyKey.S3A_SECRET_KEY)); assertTrue(mConf.getBoolean(PropertyKey.ZOOKEEPER_ENABLED)); assertEquals("host1:port1,host2:port2;host3:port3", mConf.get(PropertyKey.ZOOKEEPER_ADDRESS)); }
public static Map<String, Object> getConfigurationFromHadoop( org.apache.hadoop.conf.Configuration hadoopConf) { Map<String, Object> alluxioConfProperties = new HashMap<>(); for (Map.Entry<String, String> entry : hadoopConf) { String propertyName = entry.getKey(); if (PropertyKey.isValid(propertyName)) { alluxioConfProperties.put(propertyName, entry.getValue()); } } return alluxioConfProperties; }
HadoopConfigurationUtils { public static Map<String, Object> getConfigurationFromHadoop( org.apache.hadoop.conf.Configuration hadoopConf) { Map<String, Object> alluxioConfProperties = new HashMap<>(); for (Map.Entry<String, String> entry : hadoopConf) { String propertyName = entry.getKey(); if (PropertyKey.isValid(propertyName)) { alluxioConfProperties.put(propertyName, entry.getValue()); } } return alluxioConfProperties; } }
HadoopConfigurationUtils { public static Map<String, Object> getConfigurationFromHadoop( org.apache.hadoop.conf.Configuration hadoopConf) { Map<String, Object> alluxioConfProperties = new HashMap<>(); for (Map.Entry<String, String> entry : hadoopConf) { String propertyName = entry.getKey(); if (PropertyKey.isValid(propertyName)) { alluxioConfProperties.put(propertyName, entry.getValue()); } } return alluxioConfProperties; } private  HadoopConfigurationUtils(); }
HadoopConfigurationUtils { public static Map<String, Object> getConfigurationFromHadoop( org.apache.hadoop.conf.Configuration hadoopConf) { Map<String, Object> alluxioConfProperties = new HashMap<>(); for (Map.Entry<String, String> entry : hadoopConf) { String propertyName = entry.getKey(); if (PropertyKey.isValid(propertyName)) { alluxioConfProperties.put(propertyName, entry.getValue()); } } return alluxioConfProperties; } private  HadoopConfigurationUtils(); static Map<String, Object> getConfigurationFromHadoop(
      org.apache.hadoop.conf.Configuration hadoopConf); static org.apache.hadoop.conf.Configuration mergeAlluxioConfiguration(
      org.apache.hadoop.conf.Configuration source, AlluxioConfiguration alluxioConf); }
HadoopConfigurationUtils { public static Map<String, Object> getConfigurationFromHadoop( org.apache.hadoop.conf.Configuration hadoopConf) { Map<String, Object> alluxioConfProperties = new HashMap<>(); for (Map.Entry<String, String> entry : hadoopConf) { String propertyName = entry.getKey(); if (PropertyKey.isValid(propertyName)) { alluxioConfProperties.put(propertyName, entry.getValue()); } } return alluxioConfProperties; } private  HadoopConfigurationUtils(); static Map<String, Object> getConfigurationFromHadoop(
      org.apache.hadoop.conf.Configuration hadoopConf); static org.apache.hadoop.conf.Configuration mergeAlluxioConfiguration(
      org.apache.hadoop.conf.Configuration source, AlluxioConfiguration alluxioConf);  }