diff --git a/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml b/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml index bded4b9951..cdd88f3c78 100644 --- a/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml +++ b/hadoop-common-project/hadoop-common/dev-support/findbugsExcludeFile.xml @@ -410,4 +410,10 @@ + + + + + + diff --git a/hadoop-common-project/hadoop-common/pom.xml b/hadoop-common-project/hadoop-common/pom.xml index 37f0b70283..596f872964 100644 --- a/hadoop-common-project/hadoop-common/pom.xml +++ b/hadoop-common-project/hadoop-common/pom.xml @@ -173,8 +173,13 @@ compile - commons-configuration - commons-configuration + commons-beanutils + commons-beanutils + compile + + + org.apache.commons + commons-configuration2 compile diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/MetricsPlugin.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/MetricsPlugin.java index eca0394afb..ef0257cb5b 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/MetricsPlugin.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/MetricsPlugin.java @@ -18,7 +18,7 @@ package org.apache.hadoop.metrics2; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/filter/AbstractPatternFilter.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/filter/AbstractPatternFilter.java index bf35c41174..ca1d7f97f3 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/filter/AbstractPatternFilter.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/filter/AbstractPatternFilter.java @@ -21,7 +21,7 @@ package org.apache.hadoop.metrics2.filter; import java.util.Map; import com.google.common.collect.Maps; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.metrics2.MetricsException; 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 58d2aa3381..8d834d2aff 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 @@ -19,13 +19,12 @@ package org.apache.hadoop.metrics2.impl; import java.io.ByteArrayOutputStream; -import java.io.PrintStream; +import java.io.PrintWriter; import java.net.URL; import java.net.URLClassLoader; import static java.security.AccessController.*; import java.security.PrivilegedAction; import java.util.Iterator; -import java.util.Locale; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -35,10 +34,13 @@ import com.google.common.base.Splitter; import com.google.common.collect.Iterables; import com.google.common.collect.Maps; -import org.apache.commons.configuration.Configuration; -import org.apache.commons.configuration.ConfigurationException; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.configuration.SubsetConfiguration; +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.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.metrics2.MetricsFilter; @@ -110,15 +112,20 @@ class MetricsConfig extends SubsetConfiguration { static MetricsConfig loadFirst(String prefix, String... fileNames) { for (String fname : fileNames) { try { - Configuration cf = new PropertiesConfiguration(fname) - .interpolatedConfiguration(); + Configuration cf = new Configurations().propertiesBuilder(fname) + .configure(new Parameters().properties() + .setFileName(fname) + .setListDelimiterHandler(new DefaultListDelimiterHandler(','))) + .getConfiguration() + .interpolatedConfiguration(); LOG.info("loaded properties from "+ fname); LOG.debug(toString(cf)); MetricsConfig mc = new MetricsConfig(cf, prefix); LOG.debug(mc); return mc; } catch (ConfigurationException e) { - if (e.getMessage().startsWith("Cannot locate configuration")) { + // Commons Configuration defines the message text when file not found + if (e.getMessage().startsWith("Could not locate")) { continue; } throw new MetricsConfigException(e); @@ -175,8 +182,8 @@ class MetricsConfig extends SubsetConfiguration { * @return the value or null */ @Override - public Object getProperty(String key) { - Object value = super.getProperty(key); + public Object getPropertyInternal(String key) { + Object value = super.getPropertyInternal(key); if (value == null) { if (LOG.isDebugEnabled()) { LOG.debug("poking parent '"+ getParent().getClass().getSimpleName() + @@ -249,11 +256,6 @@ class MetricsConfig extends SubsetConfiguration { return defaultLoader; } - @Override public void clear() { - super.clear(); - // pluginLoader.close(); // jdk7 is saner - } - MetricsFilter getFilter(String prefix) { // don't create filter instances without out options MetricsConfig conf = subset(prefix); @@ -274,10 +276,10 @@ class MetricsConfig extends SubsetConfiguration { static String toString(Configuration c) { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); try { - PrintStream ps = new PrintStream(buffer, false, "UTF-8"); + PrintWriter pw = new PrintWriter(buffer, false); PropertiesConfiguration tmp = new PropertiesConfiguration(); tmp.copy(c); - tmp.save(ps); + tmp.write(pw); return buffer.toString("UTF-8"); } catch (Exception e) { throw new MetricsConfigException(e); diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsSystemImpl.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsSystemImpl.java index 6986edb42c..3f8696d0b4 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsSystemImpl.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/impl/MetricsSystemImpl.java @@ -36,7 +36,7 @@ import com.google.common.annotations.VisibleForTesting; import java.util.Locale; import static com.google.common.base.Preconditions.*; -import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.configuration2.PropertiesConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.math3.util.ArithmeticUtils; @@ -347,7 +347,7 @@ public class MetricsSystemImpl extends MetricsSystem implements MetricsSource { PropertiesConfiguration saver = new PropertiesConfiguration(); StringWriter writer = new StringWriter(); saver.copy(config); - try { saver.save(writer); } + try { saver.write(writer); } catch (Exception e) { throw new MetricsConfigException("Error stringify config", e); } diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/FileSink.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/FileSink.java index ab121bcf67..d67810490c 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/FileSink.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/FileSink.java @@ -24,7 +24,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.metrics2.AbstractMetric; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/GraphiteSink.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/GraphiteSink.java index a61fa5b97b..5c58d52e42 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/GraphiteSink.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/GraphiteSink.java @@ -18,7 +18,7 @@ package org.apache.hadoop.metrics2.sink; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java index 91942f591b..0f6e9a9172 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSink.java @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.commons.lang.time.FastDateFormat; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/StatsDSink.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/StatsDSink.java index b8059afdcb..b2be0a20f7 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/StatsDSink.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/StatsDSink.java @@ -25,7 +25,7 @@ import java.net.DatagramSocket; import java.net.InetSocketAddress; import java.nio.charset.StandardCharsets; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.metrics2.AbstractMetric; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/AbstractGangliaSink.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/AbstractGangliaSink.java index 887cfff103..4125461881 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/AbstractGangliaSink.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/AbstractGangliaSink.java @@ -25,7 +25,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.metrics2.MetricsSink; diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/GangliaSink30.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/GangliaSink30.java index 37f91c9da9..ffccfb6cdd 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/GangliaSink30.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/sink/ganglia/GangliaSink30.java @@ -26,7 +26,8 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; +import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; @@ -58,7 +59,7 @@ public class GangliaSink30 extends AbstractGangliaSink { public void init(SubsetConfiguration conf) { super.init(conf); - conf.setListDelimiter(','); + conf.setListDelimiterHandler(new DefaultListDelimiterHandler(',')); Iterator it = (Iterator) conf.getKeys(); while (it.hasNext()) { String propertyName = it.next(); @@ -66,20 +67,17 @@ public class GangliaSink30 extends AbstractGangliaSink { String contextName = propertyName.substring(TAGS_FOR_PREFIX_PROPERTY_PREFIX.length()); String[] tags = conf.getStringArray(propertyName); boolean useAllTags = false; - Set set = null; - if (tags.length > 0) { - set = new HashSet(); - for (String tag : tags) { - tag = tag.trim(); - useAllTags |= tag.equals("*"); - if (tag.length() > 0) { - set.add(tag); - } - } - if (useAllTags) { - set = null; + Set set = new HashSet<>(); + for (String tag : tags) { + tag = tag.trim(); + useAllTags |= tag.equals("*"); + if (tag.length() > 0) { + set.add(tag); } } + if (useAllTags) { + set = null; + } useTagsMap.put(contextName, set); } } diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/filter/TestPatternFilter.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/filter/TestPatternFilter.java index a8f38d6136..05724968c2 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/filter/TestPatternFilter.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/filter/TestPatternFilter.java @@ -21,7 +21,7 @@ package org.apache.hadoop.metrics2.filter; import java.util.Arrays; import java.util.List; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.junit.Test; import static org.junit.Assert.*; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigBuilder.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigBuilder.java index bfec579341..772d11d30f 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigBuilder.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigBuilder.java @@ -18,8 +18,11 @@ package org.apache.hadoop.metrics2.impl; -import org.apache.commons.configuration.PropertiesConfiguration; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.PropertiesConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; +import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler; + +import java.io.FileWriter; /** * Helper class for building configs, mostly used in tests @@ -33,6 +36,7 @@ public class ConfigBuilder { */ public ConfigBuilder() { config = new PropertiesConfiguration(); + config.setListDelimiterHandler(new DefaultListDelimiterHandler(',')); } /** @@ -54,7 +58,8 @@ public class ConfigBuilder { */ public ConfigBuilder save(String filename) { try { - config.save(filename); + FileWriter fw = new FileWriter(filename); + config.write(fw); } catch (Exception e) { throw new RuntimeException("Error saving config", e); diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigUtil.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigUtil.java index cd2d60962f..1634ea97a8 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigUtil.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/ConfigUtil.java @@ -18,12 +18,12 @@ package org.apache.hadoop.metrics2.impl; -import java.io.PrintStream; +import java.io.PrintWriter; import java.util.Iterator; import static org.junit.Assert.*; -import org.apache.commons.configuration.Configuration; -import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.configuration2.Configuration; +import org.apache.commons.configuration2.PropertiesConfiguration; /** * Helpers for config tests and debugging @@ -31,20 +31,20 @@ import org.apache.commons.configuration.PropertiesConfiguration; class ConfigUtil { static void dump(Configuration c) { - dump(null, c, System.out); + dump(null, c, new PrintWriter(System.out)); } static void dump(String header, Configuration c) { - dump(header, c, System.out); + dump(header, c, new PrintWriter(System.out)); } - static void dump(String header, Configuration c, PrintStream out) { + static void dump(String header, Configuration c, PrintWriter out) { PropertiesConfiguration p = new PropertiesConfiguration(); p.copy(c); if (header != null) { out.println(header); } - try { p.save(out); } + try { p.write(out); } catch (Exception e) { throw new RuntimeException("Error saving config", e); } diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsCollectorImpl.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsCollectorImpl.java index c185f7dc55..89ef794463 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsCollectorImpl.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsCollectorImpl.java @@ -21,7 +21,7 @@ package org.apache.hadoop.metrics2.impl; import org.junit.Test; import static org.junit.Assert.*; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import static org.apache.hadoop.metrics2.filter.TestPatternFilter.*; import static org.apache.hadoop.metrics2.lib.Interns.*; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsConfig.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsConfig.java index 3bdc8af1e6..2a62accc2b 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsConfig.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsConfig.java @@ -23,7 +23,7 @@ import java.util.Map; import org.junit.Test; import static org.junit.Assert.*; -import org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration2.Configuration; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.Log; import static org.apache.hadoop.metrics2.impl.ConfigUtil.*; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsSystemImpl.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsSystemImpl.java index 0463f48c5d..cfea104d4d 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsSystemImpl.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/impl/TestMetricsSystemImpl.java @@ -41,7 +41,7 @@ import static org.mockito.Mockito.*; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.metrics2.MetricsException; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSinkTestBase.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSinkTestBase.java index 8c366db9e4..da85b9bd61 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSinkTestBase.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/RollingFileSystemSinkTestBase.java @@ -32,7 +32,7 @@ import java.util.Calendar; import java.util.Date; import java.util.TimeZone; import java.util.regex.Pattern; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataOutputStream; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSink.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSink.java index 127305257a..ac5a0be75e 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSink.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/TestRollingFileSystemSink.java @@ -19,7 +19,7 @@ package org.apache.hadoop.metrics2.sink; import java.util.Calendar; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.metrics2.MetricsException; import org.apache.hadoop.metrics2.impl.ConfigBuilder; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/ganglia/TestGangliaSink.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/ganglia/TestGangliaSink.java index aa2c259179..30e8961ef6 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/ganglia/TestGangliaSink.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/metrics2/sink/ganglia/TestGangliaSink.java @@ -18,7 +18,7 @@ package org.apache.hadoop.metrics2.sink.ganglia; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.metrics2.impl.ConfigBuilder; import org.junit.Test; diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java index 5818291ff5..1e9d638295 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/PositionStripeReader.java @@ -18,7 +18,6 @@ package org.apache.hadoop.hdfs; import com.google.common.base.Preconditions; -import org.apache.commons.configuration.SystemConfiguration; import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy; import org.apache.hadoop.hdfs.protocol.LocatedBlock; import org.apache.hadoop.hdfs.util.StripedBlockUtil; diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFSDataSetSink.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFSDataSetSink.java index dbd6bb0b1c..27f5f02c92 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFSDataSetSink.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeFSDataSetSink.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hdfs.server.datanode; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.metrics2.AbstractMetric; diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index 5750a3f016..caf6e6f40d 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -801,9 +801,14 @@ 3.2.2 - commons-configuration - commons-configuration - 1.6 + commons-beanutils + commons-beanutils + 1.9.3 + + + org.apache.commons + commons-configuration2 + 2.1 org.slf4j diff --git a/hadoop-tools/hadoop-azure/pom.xml b/hadoop-tools/hadoop-azure/pom.xml index c4b45f4aeb..3ec6b9ad1f 100644 --- a/hadoop-tools/hadoop-azure/pom.xml +++ b/hadoop-tools/hadoop-azure/pom.xml @@ -163,6 +163,12 @@ com.microsoft.azure azure-storage compile + + + org.apache.commons + commons-lang3 + + diff --git a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AzureBlobStorageTestAccount.java b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AzureBlobStorageTestAccount.java index 628fe7e456..5353663bc8 100644 --- a/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AzureBlobStorageTestAccount.java +++ b/hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/AzureBlobStorageTestAccount.java @@ -29,7 +29,7 @@ import java.util.GregorianCalendar; import java.util.TimeZone; import java.util.concurrent.ConcurrentLinkedQueue; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.azure.metrics.AzureFileSystemInstrumentation; diff --git a/hadoop-tools/hadoop-kafka/src/main/java/org/apache/hadoop/metrics2/sink/KafkaSink.java b/hadoop-tools/hadoop-kafka/src/main/java/org/apache/hadoop/metrics2/sink/KafkaSink.java index ba70ba775d..c83552b94d 100644 --- a/hadoop-tools/hadoop-kafka/src/main/java/org/apache/hadoop/metrics2/sink/KafkaSink.java +++ b/hadoop-tools/hadoop-kafka/src/main/java/org/apache/hadoop/metrics2/sink/KafkaSink.java @@ -21,7 +21,7 @@ package org.apache.hadoop.metrics2.sink; import com.google.common.base.Strings; import org.apache.kafka.clients.producer.Producer; import org.apache.kafka.clients.producer.KafkaProducer; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.metrics2.AbstractMetric; diff --git a/hadoop-tools/hadoop-kafka/src/test/java/org/apache/hadoop/metrics2/impl/TestKafkaMetrics.java b/hadoop-tools/hadoop-kafka/src/test/java/org/apache/hadoop/metrics2/impl/TestKafkaMetrics.java index 3a65868906..eff1afa328 100644 --- a/hadoop-tools/hadoop-kafka/src/test/java/org/apache/hadoop/metrics2/impl/TestKafkaMetrics.java +++ b/hadoop-tools/hadoop-kafka/src/test/java/org/apache/hadoop/metrics2/impl/TestKafkaMetrics.java @@ -20,7 +20,7 @@ package org.apache.hadoop.metrics2.impl; import com.google.common.base.Objects; import com.google.common.collect.Lists; -import org.apache.commons.configuration.SubsetConfiguration; +import org.apache.commons.configuration2.SubsetConfiguration; import org.apache.hadoop.metrics2.AbstractMetric; import org.apache.hadoop.metrics2.MetricType; import org.apache.hadoop.metrics2.MetricsInfo;