diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsConfig.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsConfig.java index 027450cb65..976f16bedd 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsConfig.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsConfig.java @@ -37,10 +37,8 @@ import org.apache.commons.configuration2.Configuration; import org.apache.commons.configuration2.PropertiesConfiguration; import org.apache.commons.configuration2.SubsetConfiguration; -import org.apache.commons.configuration2.builder.fluent.Configurations; -import org.apache.commons.configuration2.builder.fluent.Parameters; -import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; import org.apache.commons.configuration2.ex.ConfigurationException; +import org.apache.commons.configuration2.io.FileHandler; import org.apache.hadoop.metrics2.MetricsFilter; import org.apache.hadoop.metrics2.MetricsPlugin; import org.apache.hadoop.metrics2.filter.GlobFilter; @@ -112,12 +110,11 @@ static MetricsConfig create(String prefix, String... fileNames) { static MetricsConfig loadFirst(String prefix, String... fileNames) { for (String fname : fileNames) { try { - Configuration cf = new Configurations().propertiesBuilder(fname) - .configure(new Parameters().properties() - .setFileName(fname) - .setListDelimiterHandler(new DefaultListDelimiterHandler(','))) - .getConfiguration() - .interpolatedConfiguration(); + PropertiesConfiguration pcf = new PropertiesConfiguration(); + FileHandler fh = new FileHandler(pcf); + fh.setFileName(fname); + fh.load(); + Configuration cf = pcf.interpolatedConfiguration(); LOG.info("Loaded properties from {}", fname); if (LOG.isDebugEnabled()) { LOG.debug("Properties: {}", toString(cf));