diff --git a/dev-support/docker/Dockerfile b/dev-support/docker/Dockerfile index c654ded6ac5..62c603097eb 100644 --- a/dev-support/docker/Dockerfile +++ b/dev-support/docker/Dockerfile @@ -87,7 +87,7 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y \ # Fixing the Apache commons / Maven dependency problem under Ubuntu: # See http://wiki.apache.org/commons/VfsProblems -RUN cd /usr/share/maven/lib && ln -s ../../java/commons-lang.jar . +RUN cd /usr/share/maven/lib && ln -s ../../java/commons-lang3-3.6.jar . ###### # Install findbugs diff --git a/hbase-backup/pom.xml b/hbase-backup/pom.xml index 5490c5bd61f..a6892f3ce1f 100644 --- a/hbase-backup/pom.xml +++ b/hbase-backup/pom.xml @@ -142,8 +142,8 @@ commons-cli - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java index 1765bf35684..432fd37be88 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.TableName; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java index 2a1458c5030..b0815334bd2 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/RestoreDriver.java @@ -38,7 +38,7 @@ import java.util.List; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java index 99fb06c37be..6cef0e31df7 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupAdminImpl.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java index 187a014bd14..c87b55754c4 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupCommands.java @@ -42,7 +42,7 @@ import java.util.List; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configured; import org.apache.hadoop.fs.FileSystem; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java index 4dab046d524..8dc9718e2ee 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/BackupSystemTable.java @@ -31,7 +31,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java index 6d48c32f121..40649487413 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/IncrementalTableBackupClient.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.fs.FileSystem; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.java index ff795336a2a..845da568472 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/impl/RestoreTablesClient.java @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java index 00c5b839503..373f143bdac 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceBackupMergeJob.java @@ -25,7 +25,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceRestoreJob.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceRestoreJob.java index 93ea2e5e1ca..adc5aa8c65e 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceRestoreJob.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/mapreduce/MapReduceRestoreJob.java @@ -22,7 +22,7 @@ import static org.apache.hadoop.hbase.backup.util.BackupUtils.succeeded; import java.io.IOException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupSet.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupSet.java index 0da6fc4ea13..098efa1a215 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupSet.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/util/BackupSet.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.backup.util; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestFullRestore.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestFullRestore.java index 48a553f5c75..3ca79f6763b 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestFullRestore.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestFullRestore.java @@ -17,7 +17,7 @@ import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.TableName; @@ -342,4 +342,4 @@ public class TestFullRestore extends TestBackupBase { int ret = ToolRunner.run(conf1, new RestoreDriver(), args); assertTrue(ret != 0); } -} \ No newline at end of file +} diff --git a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupMergeWithFailures.java b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupMergeWithFailures.java index 7011ed32a56..011ddf29ad3 100644 --- a/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupMergeWithFailures.java +++ b/hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestIncrementalBackupMergeWithFailures.java @@ -26,7 +26,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-client/pom.xml b/hbase-client/pom.xml index 67c03f3472d..73d0265b332 100644 --- a/hbase-client/pom.xml +++ b/hbase-client/pom.xml @@ -151,8 +151,8 @@ commons-io - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java index 252243422a2..5e2585a62ee 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ClientScanner.java @@ -29,7 +29,7 @@ import java.util.LinkedList; import java.util.Queue; import java.util.concurrent.ExecutorService; -import org.apache.commons.lang.mutable.MutableBoolean; +import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/FastFailInterceptorContext.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/FastFailInterceptorContext.java index 3f4483637fe..c033828f392 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/FastFailInterceptorContext.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/FastFailInterceptorContext.java @@ -17,7 +17,7 @@ */ package org.apache.hadoop.hbase.client; -import org.apache.commons.lang.mutable.MutableBoolean; +import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.classification.InterfaceAudience; @@ -129,4 +129,4 @@ class FastFailInterceptorContext extends RetryingCallerInterceptorContext { this.tries = tries; return this; } -} \ No newline at end of file +} diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java index 52ec9cdb982..99937428441 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/PreemptiveFastFailInterceptor.java @@ -26,7 +26,7 @@ import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import org.apache.commons.lang.mutable.MutableBoolean; +import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKAsyncRegistry.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKAsyncRegistry.java index 47b68e11f99..531d8c07ed1 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKAsyncRegistry.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/ZKAsyncRegistry.java @@ -29,7 +29,7 @@ import static org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.removeMetaD import java.io.IOException; import java.util.concurrent.CompletableFuture; -import org.apache.commons.lang.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.curator.framework.CuratorFramework; @@ -248,4 +248,4 @@ class ZKAsyncRegistry implements AsyncRegistry { public void close() { zk.close(); } -} \ No newline at end of file +} diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationSerDeHelper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationSerDeHelper.java index 19c504247e6..b4de870aa6d 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationSerDeHelper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationSerDeHelper.java @@ -18,7 +18,7 @@ */ package org.apache.hadoop.hbase.client.replication; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString; import org.apache.hadoop.hbase.shaded.com.google.protobuf.UnsafeByteOperations; import org.apache.commons.logging.Log; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/TableCFs.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/TableCFs.java index 854517e0270..fc27deb4a23 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/TableCFs.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/TableCFs.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.client.replication; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClientConfigHelper.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClientConfigHelper.java index 726a9ef1d31..9ebbc330728 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClientConfigHelper.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcClientConfigHelper.java @@ -25,7 +25,7 @@ import org.apache.hadoop.hbase.shaded.io.netty.channel.EventLoopGroup; import java.util.HashMap; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.util.Pair; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceQuotaSnapshot.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceQuotaSnapshot.java index 18fe76a659f..f691d7a6933 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceQuotaSnapshot.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/quotas/SpaceQuotaSnapshot.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.quotas; import java.util.Objects; -import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos; diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java index 1de3652d65c..de35fc54be2 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java @@ -35,7 +35,7 @@ import java.util.Map; import javax.security.auth.login.AppConfigurationEntry; import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java index 775365749e8..0925974af23 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestClientNoCluster.java @@ -34,7 +34,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.DoNotRetryIOException; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -461,7 +461,7 @@ public class TestClientNoCluster extends Configured implements Tool { @Override public MutateResponse mutate(RpcController controller, MutateRequest request) throws ServiceException { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override @@ -476,14 +476,14 @@ public class TestClientNoCluster extends Configured implements Tool { public BulkLoadHFileResponse bulkLoadHFile( RpcController controller, BulkLoadHFileRequest request) throws ServiceException { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public CoprocessorServiceResponse execService( RpcController controller, CoprocessorServiceRequest request) throws ServiceException { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override @@ -505,19 +505,19 @@ public class TestClientNoCluster extends Configured implements Tool { @Override public CoprocessorServiceResponse execRegionServerService(RpcController controller, CoprocessorServiceRequest request) throws ServiceException { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public PrepareBulkLoadResponse prepareBulkLoad(RpcController controller, PrepareBulkLoadRequest request) throws ServiceException { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public CleanupBulkLoadResponse cleanupBulkLoad(RpcController controller, CleanupBulkLoadRequest request) throws ServiceException { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } } diff --git a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java index 9addaa532b6..164bc85e546 100644 --- a/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java +++ b/hbase-client/src/test/java/org/apache/hadoop/hbase/ipc/TestCellBlockBuilder.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.util.Arrays; -import org.apache.commons.lang.time.StopWatch; +import org.apache.commons.lang3.time.StopWatch; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.impl.Log4JLogger; diff --git a/hbase-common/pom.xml b/hbase-common/pom.xml index c38e18c3fe2..0d1bd1af5ae 100644 --- a/hbase-common/pom.xml +++ b/hbase-common/pom.xml @@ -233,8 +233,8 @@ compile - commons-lang - commons-lang + org.apache.commons + commons-lang3 compile diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 2a7248533a1..dd7e5ce801a 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.UUID; import java.util.regex.Pattern; -import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.util.Bytes; @@ -1316,6 +1316,8 @@ public final class HConstants { public static final String DEFAULT_SNAPSHOT_RESTORE_FAILSAFE_NAME = "hbase-failsafe-{snapshot.name}-{restore.timestamp}"; + public static final String NOT_IMPLEMENTED = "Not implemented"; + private HConstants() { // Can't be instantiated with this ctor. } diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java index 5ec91f795cc..36be64e10a0 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/encoding/EncodedDataBlock.java @@ -25,7 +25,7 @@ import java.io.OutputStream; import java.nio.ByteBuffer; import java.util.Iterator; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java index 3d520a8e127..387c670e239 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PairOfSameType.java @@ -21,7 +21,8 @@ package org.apache.hadoop.hbase.util; import java.util.Iterator; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.classification.InterfaceAudience; /** @@ -106,7 +107,7 @@ public class PairOfSameType implements Iterable { @Override public void remove() { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } }; } diff --git a/hbase-hadoop2-compat/pom.xml b/hbase-hadoop2-compat/pom.xml index 0204b0198e8..bfb63ecd472 100644 --- a/hbase-hadoop2-compat/pom.xml +++ b/hbase-hadoop2-compat/pom.xml @@ -182,8 +182,8 @@ limitations under the License. ${hadoop-two.version} - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java index ec4a1a793aa..3a24b94de57 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/hbase/metrics/impl/HBaseMetrics2HadoopMetricsAdapter.java @@ -34,7 +34,7 @@ package org.apache.hadoop.hbase.metrics.impl; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.metrics.Counter; diff --git a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java index 6a2f2039fc7..604377d3a29 100644 --- a/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java +++ b/hbase-hadoop2-compat/src/main/java/org/apache/hadoop/metrics2/lib/MutableHistogram.java @@ -18,7 +18,7 @@ package org.apache.hadoop.metrics2.lib; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.metrics.Histogram; import org.apache.hadoop.hbase.metrics.Interns; diff --git a/hbase-it/pom.xml b/hbase-it/pom.xml index 1899711ad1e..d813cd8f4e5 100644 --- a/hbase-it/pom.xml +++ b/hbase-it/pom.xml @@ -271,8 +271,8 @@ commons-math - commons-lang - commons-lang + org.apache.commons + commons-lang3 org.apache.htrace diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java index 55c6e28b6a4..be25eaa3676 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/DistributedHBaseCluster.java @@ -286,13 +286,13 @@ public class DistributedHBaseCluster extends HBaseCluster { @Override public void waitUntilShutDown() { // Simply wait for a few seconds for now (after issuing serverManager.kill - throw new RuntimeException("Not implemented yet"); + throw new RuntimeException(HConstants.NOT_IMPLEMENTED); } @Override public void shutdown() throws IOException { // not sure we want this - throw new RuntimeException("Not implemented yet"); + throw new RuntimeException(HConstants.NOT_IMPLEMENTED); } @Override diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java index 0f48e4f1878..dbbcc4462f0 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/HBaseClusterManager.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.Locale; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java index 46f049045be..2be1b2b2a00 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestBase.java @@ -24,7 +24,7 @@ import java.util.Properties; import java.util.Set; import org.apache.commons.cli.CommandLine; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java index e2804535e54..d1a760bdab5 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java @@ -25,8 +25,8 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.commons.lang.RandomStringUtils; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -257,7 +257,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { return null; } ArrayList namespaceList = new ArrayList<>(namespaceMap.keySet()); - String randomKey = namespaceList.get(RandomUtils.nextInt(namespaceList.size())); + String randomKey = namespaceList.get(RandomUtils.nextInt(0, namespaceList.size())); NamespaceDescriptor randomNsd = namespaceMap.get(randomKey); // remove from namespaceMap namespaceMap.remove(randomKey); @@ -306,12 +306,12 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { private NamespaceDescriptor createNamespaceDesc() { String namespaceName = "itnamespace" + String.format("%010d", - RandomUtils.nextInt(Integer.MAX_VALUE)); + RandomUtils.nextInt()); NamespaceDescriptor nsd = NamespaceDescriptor.create(namespaceName).build(); nsd.setConfiguration( nsTestConfigKey, - String.format("%010d", RandomUtils.nextInt(Integer.MAX_VALUE))); + String.format("%010d", RandomUtils.nextInt())); return nsd; } } @@ -331,7 +331,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { NamespaceDescriptor modifiedNsd = NamespaceDescriptor.create(namespaceName).build(); String nsValueNew; do { - nsValueNew = String.format("%010d", RandomUtils.nextInt(Integer.MAX_VALUE)); + nsValueNew = String.format("%010d", RandomUtils.nextInt()); } while (selected.getConfigurationValue(nsTestConfigKey).equals(nsValueNew)); modifiedNsd.setConfiguration(nsTestConfigKey, nsValueNew); admin.modifyNamespace(modifiedNsd); @@ -397,7 +397,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { return null; } ArrayList tableList = new ArrayList<>(tableMap.keySet()); - TableName randomKey = tableList.get(RandomUtils.nextInt(tableList.size())); + TableName randomKey = tableList.get(RandomUtils.nextInt(0, tableList.size())); TableDescriptor randomTd = tableMap.remove(randomKey); return randomTd; } @@ -436,7 +436,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } private TableDescriptor createTableDesc() { - String tableName = String.format("ittable-%010d", RandomUtils.nextInt(Integer.MAX_VALUE)); + String tableName = String.format("ittable-%010d", RandomUtils.nextInt()); String familyName = "cf-" + Math.abs(RandomUtils.nextInt()); return TableDescriptorBuilder.newBuilder(TableName.valueOf(tableName)) .addColumnFamily(ColumnFamilyDescriptorBuilder.of(familyName)) @@ -581,7 +581,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { LOG.info("No column families in table: " + td); return null; } - ColumnFamilyDescriptor randomCfd = families[RandomUtils.nextInt(families.length)]; + ColumnFamilyDescriptor randomCfd = families[RandomUtils.nextInt(0, families.length)]; return randomCfd; } } @@ -624,7 +624,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } private ColumnFamilyDescriptor createFamilyDesc() { - String familyName = String.format("cf-%010d", RandomUtils.nextInt(Integer.MAX_VALUE)); + String familyName = String.format("cf-%010d", RandomUtils.nextInt()); return ColumnFamilyDescriptorBuilder.of(familyName); } } @@ -643,7 +643,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } Admin admin = connection.getAdmin(); - int versions = RandomUtils.nextInt(10) + 3; + int versions = RandomUtils.nextInt(0, 10) + 3; try { TableName tableName = selected.getTableName(); LOG.info("Altering versions of column family: " + columnDesc + " to: " + versions + @@ -698,7 +698,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { TableName tableName = selected.getTableName(); // possible DataBlockEncoding ids int[] possibleIds = {0, 2, 3, 4, 6}; - short id = (short) possibleIds[RandomUtils.nextInt(possibleIds.length)]; + short id = (short) possibleIds[RandomUtils.nextInt(0, possibleIds.length)]; LOG.info("Altering encoding of column family: " + columnDesc + " to: " + id + " in table: " + tableName); @@ -789,13 +789,13 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { for (int i = 0; i < numRows; i++){ // nextInt(Integer.MAX_VALUE)) to return positive numbers only byte[] rowKey = Bytes.toBytes( - "row-" + String.format("%010d", RandomUtils.nextInt(Integer.MAX_VALUE))); + "row-" + String.format("%010d", RandomUtils.nextInt())); ColumnFamilyDescriptor cfd = selectFamily(selected); if (cfd == null){ return; } byte[] family = cfd.getName(); - byte[] qualifier = Bytes.toBytes("col-" + RandomUtils.nextInt(Integer.MAX_VALUE) % 10); + byte[] qualifier = Bytes.toBytes("col-" + RandomUtils.nextInt() % 10); byte[] value = Bytes.toBytes("val-" + RandomStringUtils.randomAlphanumeric(10)); Put put = new Put(rowKey); put.addColumn(family, qualifier, value); @@ -873,7 +873,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { break; case DELETE_TABLE: // reduce probability of deleting table to 20% - if (RandomUtils.nextInt(100) < 20) { + if (RandomUtils.nextInt(0, 100) < 20) { new DeleteTableAction().perform(); } break; @@ -882,7 +882,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { break; case DELETE_COLUMNFAMILY: // reduce probability of deleting column family to 20% - if (RandomUtils.nextInt(100) < 20) { + if (RandomUtils.nextInt(0, 100) < 20) { new DeleteColumnFamilyAction().perform(); } break; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java index d1292790b8b..3865209254a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestIngestWithACL.java @@ -22,7 +22,7 @@ import java.util.Arrays; import java.util.List; import org.apache.commons.cli.CommandLine; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.io.hfile.HFile; import org.apache.hadoop.hbase.security.User; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java index 2f1098995d2..3d631ebe2a8 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/StripeCompactionsPerformanceEvaluation.java @@ -23,7 +23,7 @@ import java.util.Locale; import java.util.Set; import org.apache.commons.cli.CommandLine; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java index 5ec9cdbe4e2..2f01afeaba2 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/Action.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.function.BiConsumer; import java.util.function.Consumer; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -208,7 +208,7 @@ public class Action { int victimRegionCount = (int)Math.ceil(fractionOfRegions * regions.size()); LOG.debug("Removing " + victimRegionCount + " regions from " + server.getServerName()); for (int i = 0; i < victimRegionCount; ++i) { - int victimIx = RandomUtils.nextInt(regions.size()); + int victimIx = RandomUtils.nextInt(0, regions.size()); String regionId = HRegionInfo.encodeRegionName(regions.remove(victimIx)); victimRegions.add(Bytes.toBytes(regionId)); } @@ -223,7 +223,7 @@ public class Action { if (context.isStopping()) { break; } - int targetIx = RandomUtils.nextInt(toServers.size()); + int targetIx = RandomUtils.nextInt(0, toServers.size()); admin.move(victimRegion, Bytes.toBytes(toServers.get(targetIx).getServerName())); } } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java index f3827473a3a..0ef8cfdf4d4 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/AddColumnAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.io.IOException; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java index bbb86a128a8..7e812a8f553 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactMobAction.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.chaos.actions; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -47,7 +47,7 @@ public class CompactMobAction extends Action { public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); - boolean major = RandomUtils.nextInt(100) < majorRatio; + boolean major = RandomUtils.nextInt(0, 100) < majorRatio; // Don't try the modify if we're stopping if (context.isStopping()) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java index 046415f9335..f3fe6ff7980 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactRandomRegionOfTableAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; @@ -51,7 +51,7 @@ public class CompactRandomRegionOfTableAction extends Action { public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); - boolean major = RandomUtils.nextInt(100) < majorRatio; + boolean major = RandomUtils.nextInt(0, 100) < majorRatio; LOG.info("Performing action: Compact random region of table " + tableName + ", major=" + major); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java index 3eab335b82d..521591c4673 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/CompactTableAction.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.chaos.actions; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; @@ -46,7 +46,7 @@ public class CompactTableAction extends Action { public void perform() throws Exception { HBaseTestingUtility util = context.getHBaseIntegrationTestingUtility(); Admin admin = util.getAdmin(); - boolean major = RandomUtils.nextInt(100) < majorRatio; + boolean major = RandomUtils.nextInt(0, 100) < majorRatio; LOG.info("Performing action: Compact table " + tableName + ", major=" + major); try { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java index aa796abab0b..686e622523e 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MergeRandomAdjacentRegionsOfTableAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; @@ -54,7 +54,7 @@ public class MergeRandomAdjacentRegionsOfTableAction extends Action { return; } - int i = RandomUtils.nextInt(regions.size() - 1); + int i = RandomUtils.nextInt(0, regions.size() - 1); HRegionInfo a = regions.get(i++); HRegionInfo b = regions.get(i); LOG.debug("Merging " + a.getRegionNameAsString() + " and " + b.getRegionNameAsString()); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java index 146c63c61cc..c3793d02ea2 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRegionsOfTableAction.java @@ -22,7 +22,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; @@ -77,7 +77,7 @@ public class MoveRegionsOfTableAction extends Action { try { String destServerName = - servers[RandomUtils.nextInt(servers.length)].getServerName(); + servers[RandomUtils.nextInt(0, servers.length)].getServerName(); LOG.debug("Moving " + regionInfo.getRegionNameAsString() + " to " + destServerName); admin.move(regionInfo.getEncodedNameAsBytes(), Bytes.toBytes(destServerName)); } catch (Exception ex) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java index 6eab85c1538..2c9a872cc7e 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingTableAction.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.chaos.actions; import java.util.List; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.client.RegionLocator; @@ -41,6 +41,6 @@ public class RestartRsHoldingTableAction extends RestartActionBaseAction { LOG.info("Performing action: Restart random RS holding table " + this.locator.getName()); List locations = locator.getAllRegionLocations(); - restartRs(locations.get(RandomUtils.nextInt(locations.size())).getServerName(), sleepTime); + restartRs(locations.get(RandomUtils.nextInt(0, locations.size())).getServerName(), sleepTime); } } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RollingBatchRestartRsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RollingBatchRestartRsAction.java index ba251987ef8..800a4455434 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RollingBatchRestartRsAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RollingBatchRestartRsAction.java @@ -24,7 +24,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Queue; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.ServerName; @@ -104,7 +104,7 @@ public class RollingBatchRestartRsAction extends BatchRestartRsAction { break; } - sleep(RandomUtils.nextInt((int)sleepTime)); + sleep(RandomUtils.nextInt(0, (int)sleepTime)); } } @@ -149,4 +149,4 @@ public class RollingBatchRestartRsAction extends BatchRestartRsAction { action.perform(); } -} \ No newline at end of file +} diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceKillAndRebalanceAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceKillAndRebalanceAction.java index 626953dfccf..7b6f2925bc6 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceKillAndRebalanceAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceKillAndRebalanceAction.java @@ -24,7 +24,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Set; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.ServerName; import org.junit.Assert; @@ -65,7 +65,7 @@ public class UnbalanceKillAndRebalanceAction extends Action { liveCount + deadCount < victimServers.size()); List targetServers = new ArrayList<>(liveCount); for (int i = 0; i < liveCount + deadCount; ++i) { - int victimIx = RandomUtils.nextInt(victimServers.size()); + int victimIx = RandomUtils.nextInt(0, victimServers.size()); targetServers.add(victimServers.remove(victimIx)); } unbalanceRegions(status, victimServers, targetServers, HOARD_FRC_OF_REGIONS); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceRegionsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceRegionsAction.java index bdffdb18822..e5faf08967c 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceRegionsAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/UnbalanceRegionsAction.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.LinkedList; import java.util.List; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.ServerName; @@ -52,7 +52,7 @@ public class UnbalanceRegionsAction extends Action { int targetServerCount = (int)Math.ceil(fractionOfServers * victimServers.size()); List targetServers = new ArrayList<>(targetServerCount); for (int i = 0; i < targetServerCount; ++i) { - int victimIx = RandomUtils.nextInt(victimServers.size()); + int victimIx = RandomUtils.nextInt(0, victimServers.size()); targetServers.add(victimServers.remove(victimIx)); } unbalanceRegions(status, victimServers, targetServers, fractionOfRegions); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java index 951f8f8777f..70452bb5568 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.IntegrationTestingUtility; @@ -61,7 +61,7 @@ public class PolicyBasedChaosMonkey extends ChaosMonkey { /** Selects a random item from the given items */ public static T selectRandomItem(T[] items) { - return items[RandomUtils.nextInt(items.length)]; + return items[RandomUtils.nextInt(0, items.length)]; } /** Selects a random item from the given items with weights*/ @@ -71,7 +71,7 @@ public class PolicyBasedChaosMonkey extends ChaosMonkey { totalWeight += pair.getSecond(); } - int cutoff = RandomUtils.nextInt(totalWeight); + int cutoff = RandomUtils.nextInt(0, totalWeight); int cummulative = 0; T item = null; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/policies/PeriodicPolicy.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/policies/PeriodicPolicy.java index b7b6109f4d9..3b6908daee5 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/policies/PeriodicPolicy.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/policies/PeriodicPolicy.java @@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.chaos.policies; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.hadoop.hbase.util.Threads; /** A policy which does stuff every time interval. */ @@ -32,7 +32,7 @@ public abstract class PeriodicPolicy extends Policy { @Override public void run() { // Add some jitter. - int jitter = RandomUtils.nextInt((int) periodMs); + int jitter = RandomUtils.nextInt(0, (int) periodMs); LOG.info("Sleeping for " + jitter + " to add jitter"); Threads.sleep(jitter); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java index f14232188ea..591108599e9 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/util/ChaosMonkeyRunner.java @@ -22,7 +22,7 @@ import java.util.Properties; import java.util.Set; import org.apache.commons.cli.CommandLine; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java index cd84163bd4a..6371daefe74 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mapreduce/IntegrationTestBulkLoad.java @@ -31,7 +31,7 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.cli.CommandLine; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java index 272af96a9ea..97a06f46be0 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java @@ -29,7 +29,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java index 5bd2c87330e..73374238602 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestTimeBoundedRequestsWithRegionReplicas.java @@ -26,7 +26,7 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-mapreduce/pom.xml b/hbase-mapreduce/pom.xml index e377ee1c34d..fabbf54f2d3 100644 --- a/hbase-mapreduce/pom.xml +++ b/hbase-mapreduce/pom.xml @@ -284,8 +284,8 @@ commons-io - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java index 7fea2542728..ca6b1e9932e 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java @@ -34,7 +34,7 @@ import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java index b64271efbc9..44b856c6961 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ImportTsv.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java index 2e0591e4c2d..6aedc56f3d6 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/RowCounter.java @@ -24,7 +24,7 @@ import java.util.ArrayList; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java index 23a70a91300..6b058b0ac92 100644 --- a/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java +++ b/hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/PerformanceEvaluation.java @@ -43,7 +43,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-metrics-api/pom.xml b/hbase-metrics-api/pom.xml index 27a974022e4..ff0c07a543f 100644 --- a/hbase-metrics-api/pom.xml +++ b/hbase-metrics-api/pom.xml @@ -93,8 +93,8 @@ commons-logging - commons-lang - commons-lang + org.apache.commons + commons-lang3 org.apache.hbase.thirdparty diff --git a/hbase-metrics-api/src/main/java/org/apache/hadoop/hbase/metrics/MetricRegistryInfo.java b/hbase-metrics-api/src/main/java/org/apache/hadoop/hbase/metrics/MetricRegistryInfo.java index 88ba232928d..7da2c19299e 100644 --- a/hbase-metrics-api/src/main/java/org/apache/hadoop/hbase/metrics/MetricRegistryInfo.java +++ b/hbase-metrics-api/src/main/java/org/apache/hadoop/hbase/metrics/MetricRegistryInfo.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.metrics; -import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.hadoop.hbase.classification.InterfaceAudience; /** diff --git a/hbase-replication/pom.xml b/hbase-replication/pom.xml index 7e92fb949b5..cb6c8516ac7 100644 --- a/hbase-replication/pom.xml +++ b/hbase-replication/pom.xml @@ -130,8 +130,8 @@ - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java index 8506cbb257d..05757b9f9b5 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/ReplicationFactory.java @@ -18,7 +18,7 @@ */ package org.apache.hadoop.hbase.replication; -import org.apache.commons.lang.reflect.ConstructorUtils; +import org.apache.commons.lang3.reflect.ConstructorUtils; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java index 35075473bdb..a16b368544c 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesClientImpl.java @@ -18,9 +18,10 @@ */ package org.apache.hadoop.hbase.replication; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Abortable; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.ResultScanner; @@ -95,18 +96,18 @@ public class TableBasedReplicationQueuesClientImpl extends ReplicationTableBase @Override public int getHFileRefsNodeChangeVersion() throws KeeperException { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public List getAllPeersFromHFileRefsQueue() throws KeeperException { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public List getReplicableHFiles(String peerId) throws KeeperException { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } } diff --git a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java index bf55e8cf615..e91f1ad906d 100644 --- a/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java +++ b/hbase-replication/src/main/java/org/apache/hadoop/hbase/replication/TableBasedReplicationQueuesImpl.java @@ -18,13 +18,14 @@ */ package org.apache.hadoop.hbase.replication; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Abortable; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.client.Delete; @@ -45,11 +46,8 @@ import org.apache.zookeeper.KeeperException; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; @@ -298,26 +296,26 @@ public class TableBasedReplicationQueuesImpl extends ReplicationTableBase @Override public void addPeerToHFileRefs(String peerId) throws ReplicationException { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public void removePeerFromHFileRefs(String peerId) { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public void addHFileRefs(String peerId, List> pairs) throws ReplicationException { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public void removeHFileRefs(String peerId, List files) { // TODO - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } private String buildQueueRowKey(String queueId) { diff --git a/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm b/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm index 953b316ed40..c0ff317e5d3 100644 --- a/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm +++ b/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm @@ -198,6 +198,13 @@ JRuby's licence. ## Skip racc, json-generator, json-parser because it is under Ruby license ## jruby bundles jquery, but we already ref that above. +#end +#macro(commons_lang3_notice) +-- +## commons-lang3 has following note in the NOTICE file +This product includes software from the Spring Framework, +under the Apache License 2.0 (see: StringUtils.containsWhitespace()) + #end ## first bundled source #if(${bundled-logo}) @@ -255,6 +262,11 @@ JRuby's licence. #if(${dep.artifactId.equals("jruby-complete")}) #set($jruby=true) #end +#if(${dep.artifactId.equals("commons-lang3")}) +#if(${dep.groupId.equals("org.apache.commons")}) +#commons_lang3_notice() +#end +#end #if( ${dep.licenses.isEmpty()} ) ERROR: This product includes ${dep.name} which has no licenses! Revert the change if invalid or if intentional add license info to supplemental-models.xml diff --git a/hbase-rest/pom.xml b/hbase-rest/pom.xml index 36d39b64c1b..7ce6d577e7a 100644 --- a/hbase-rest/pom.xml +++ b/hbase-rest/pom.xml @@ -290,8 +290,8 @@ httpcore - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java index eb3fc26e7d1..721e108a368 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java @@ -32,7 +32,7 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; -import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java index ceb8bb24ae8..d6a3e14efe8 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RowResource.java @@ -36,7 +36,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; import javax.ws.rs.core.UriInfo; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java index ddfa8bb60ee..91e19ab18fe 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/TableResource.java @@ -31,7 +31,7 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.UriInfo; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.TableName; diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java index 0b98816e239..07544a63a04 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/CellModel.java @@ -28,9 +28,9 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlValue; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.hadoop.hbase.util.ByteStringer; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.CellUtil; diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/RowModel.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/RowModel.java index 663c838345f..b14c40994b5 100644 --- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/RowModel.java +++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/RowModel.java @@ -30,9 +30,9 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.commons.lang.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.rest.ProtobufMessageHandler; import org.codehaus.jackson.annotate.JsonProperty; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java index c5cc1217f8f..95d9432eca3 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/HBaseRESTTestingUtility.java @@ -18,7 +18,7 @@ */ package org.apache.hadoop.hbase.rest; -import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestCellModel.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestCellModel.java index d9e45df944a..96e10896419 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestCellModel.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestCellModel.java @@ -19,9 +19,9 @@ package org.apache.hadoop.hbase.rest.model; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.hadoop.hbase.testclassification.RestTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java index 5c2b90c41f5..7ba61b893de 100644 --- a/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java +++ b/hbase-rest/src/test/java/org/apache/hadoop/hbase/rest/model/TestRowModel.java @@ -23,9 +23,9 @@ import java.util.Iterator; import javax.xml.bind.JAXBContext; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.commons.lang.builder.ToStringStyle; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.hadoop.hbase.testclassification.RestTests; import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; diff --git a/hbase-rsgroup/pom.xml b/hbase-rsgroup/pom.xml index f2865c05b05..72b25523822 100644 --- a/hbase-rsgroup/pom.xml +++ b/hbase-rsgroup/pom.xml @@ -148,8 +148,8 @@ - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java index b9c19227bbc..11c2403e5a4 100644 --- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java +++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminServer.java @@ -28,7 +28,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.HRegionInfo; diff --git a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRSGroupBasedLoadBalancer.java b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRSGroupBasedLoadBalancer.java index 488afdf0e81..fe62d161738 100644 --- a/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRSGroupBasedLoadBalancer.java +++ b/hbase-rsgroup/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRSGroupBasedLoadBalancer.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.master.balancer; import org.apache.hadoop.hbase.shaded.com.google.common.collect.ArrayListMultimap; import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/pom.xml b/hbase-server/pom.xml index 3d5ecf7a927..6ec2db2a145 100644 --- a/hbase-server/pom.xml +++ b/hbase-server/pom.xml @@ -534,8 +534,8 @@ commons-io - commons-lang - commons-lang + org.apache.commons + commons-lang3 commons-logging diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon index 7088f60a700..285dbe64d1f 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RegionListTmpl.jamon @@ -22,7 +22,7 @@ <%import> java.util.*; - org.apache.commons.lang.time.FastDateFormat; + org.apache.commons.lang3.time.FastDateFormat; org.apache.hadoop.hbase.regionserver.HRegionServer; org.apache.hadoop.hbase.util.Bytes; org.apache.hadoop.hbase.HRegionInfo; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZkSplitLogWorkerCoordination.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZkSplitLogWorkerCoordination.java index e4fffa1b857..354f58167c5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZkSplitLogWorkerCoordination.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/coordination/ZkSplitLogWorkerCoordination.java @@ -26,8 +26,8 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.apache.commons.lang.math.RandomUtils; -import org.apache.commons.lang.mutable.MutableInt; +import org.apache.commons.lang3.RandomUtils; +import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -269,7 +269,7 @@ public class ZkSplitLogWorkerCoordination extends ZooKeeperListener implements // after a successful submit, sleep a little bit to allow other RSs to grab the rest tasks try { - int sleepTime = RandomUtils.nextInt(500) + 500; + int sleepTime = RandomUtils.nextInt(0, 500) + 500; Thread.sleep(sleepTime); } catch (InterruptedException e) { LOG.warn("Interrupted while yielding for other region servers", e); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java index c0010106103..54c5ddb2fdd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java @@ -31,7 +31,7 @@ import java.util.Map.Entry; import java.util.Random; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java index bc6ab3cc08e..f07ef7e364a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputSaslHelper.java @@ -73,7 +73,7 @@ import javax.security.sasl.SaslClient; import javax.security.sasl.SaslException; import org.apache.commons.codec.binary.Base64; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java index 43b5c24a379..f30ba5a034d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java @@ -45,7 +45,7 @@ import org.apache.commons.cli.OptionGroup; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java index 004f91d5e6b..6c43fc081c0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterCoprocessorHost.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.List; import java.util.Set; -import org.apache.commons.lang.ClassUtils; +import org.apache.commons.lang3.ClassUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java index 518c7b4a41e..eb5399d238a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterWrapperImpl.java @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java index ffc3e5b51f0..2c8024ed3e7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionPlacementMaintainer.java @@ -36,7 +36,7 @@ import org.apache.commons.cli.GnuParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java index d69b0c0d792..31e6300767f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/TableNamespaceManager.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.io.InterruptedIOException; import java.util.NavigableSet; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -360,4 +360,4 @@ public class TableNamespaceManager { } return maxRegions; } -} \ No newline at end of file +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java index f7203b92b10..162ba92d49b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java @@ -20,11 +20,9 @@ package org.apache.hadoop.hbase.master.balancer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.Collections; import java.util.Comparator; import java.util.Deque; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -36,12 +34,13 @@ import java.util.TreeMap; import java.util.function.Predicate; import java.util.stream.Collectors; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.HBaseIOException; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerLoad; @@ -53,15 +52,12 @@ import org.apache.hadoop.hbase.master.MasterServices; import org.apache.hadoop.hbase.master.RackManager; import org.apache.hadoop.hbase.master.RegionPlan; import org.apache.hadoop.hbase.master.balancer.BaseLoadBalancer.Cluster.Action.Type; -import org.apache.hadoop.hbase.security.access.AccessControlLists; -import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting; import org.apache.hadoop.hbase.shaded.com.google.common.base.Joiner; import org.apache.hadoop.hbase.shaded.com.google.common.collect.ArrayListMultimap; import org.apache.hadoop.hbase.shaded.com.google.common.collect.Lists; import org.apache.hadoop.hbase.shaded.com.google.common.collect.Sets; -import org.apache.zookeeper.KeeperException; /** * The base class for load balancers. It provides the the functions used to by @@ -634,7 +630,7 @@ public abstract class BaseLoadBalancer implements LoadBalancer { public Action undoAction() { // TODO implement this. This action is not being used by the StochasticLB for now // in case it uses it, we should implement this function. - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } @Override public String toString() { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java index 3453b7a8905..7c54c733ceb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/MasterQuotaManager.java @@ -27,7 +27,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; -import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.DoNotRetryIOException; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java index f16db1ef426..c04967b72c1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/SnapshotQuotaObserverChore.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import java.util.function.Predicate; import java.util.stream.Collectors; -import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java index 6da57d35cf9..a3ab2e6d847 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CellSet.java @@ -18,6 +18,7 @@ */ package org.apache.hadoop.hbase.regionserver; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting; import java.util.Collection; import java.util.Comparator; @@ -61,7 +62,7 @@ public class CellSet implements NavigableSet { } public Cell ceiling(Cell e) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Iterator descendingIterator() { @@ -69,11 +70,11 @@ public class CellSet implements NavigableSet { } public NavigableSet descendingSet() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Cell floor(Cell e) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public SortedSet headSet(final Cell toElement) { @@ -86,7 +87,7 @@ public class CellSet implements NavigableSet { } public Cell higher(Cell e) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Iterator iterator() { @@ -94,24 +95,24 @@ public class CellSet implements NavigableSet { } public Cell lower(Cell e) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Cell pollFirst() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Cell pollLast() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public SortedSet subSet(Cell fromElement, Cell toElement) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public NavigableSet subSet(Cell fromElement, boolean fromInclusive, Cell toElement, boolean toInclusive) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public SortedSet tailSet(Cell fromElement) { @@ -123,7 +124,7 @@ public class CellSet implements NavigableSet { } public Comparator comparator() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Cell first() { @@ -139,7 +140,7 @@ public class CellSet implements NavigableSet { } public boolean addAll(Collection c) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public void clear() { @@ -152,7 +153,7 @@ public class CellSet implements NavigableSet { } public boolean containsAll(Collection c) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public boolean isEmpty() { @@ -164,11 +165,11 @@ public class CellSet implements NavigableSet { } public boolean removeAll(Collection c) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public boolean retainAll(Collection c) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public Cell get(Cell kv) { @@ -180,10 +181,10 @@ public class CellSet implements NavigableSet { } public Object[] toArray() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } public T[] toArray(T[] a) { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(HConstants.NOT_IMPLEMENTED); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 1fed43e1cce..9b7eef3a2c5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -56,8 +56,8 @@ import javax.management.MalformedObjectNameException; import javax.management.ObjectName; import javax.servlet.http.HttpServlet; -import org.apache.commons.lang.SystemUtils; -import org.apache.commons.lang.math.RandomUtils; +import org.apache.commons.lang3.SystemUtils; +import org.apache.commons.lang3.RandomUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -1821,7 +1821,7 @@ public class HRegionServer extends HasThread implements if (((HRegion)r).shouldFlush(whyFlush)) { FlushRequester requester = server.getFlushRequester(); if (requester != null) { - long randomDelay = RandomUtils.nextInt(RANGE_OF_DELAY) + MIN_DELAY_TIME; + long randomDelay = RandomUtils.nextInt(0, RANGE_OF_DELAY) + MIN_DELAY_TIME; LOG.info(getName() + " requesting flush of " + r.getRegionInfo().getRegionNameAsString() + " because " + whyFlush.toString() + @@ -3507,7 +3507,7 @@ public class HRegionServer extends HasThread implements private boolean isHealthCheckerConfigured() { String healthScriptLocation = this.conf.get(HConstants.HEALTH_SCRIPT_LOC); - return org.apache.commons.lang.StringUtils.isNotBlank(healthScriptLocation); + return org.apache.commons.lang3.StringUtils.isNotBlank(healthScriptLocation); } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java index 85ac097d10d..e28ac74d9d7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsRegionServerWrapperImpl.java @@ -23,7 +23,7 @@ import java.util.List; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.CompatibilitySingletonFactory; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java index 8778f5d7058..c10aff963c5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonLazyKeyValueScanner.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonReversedNonLazyKeyValueScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonReversedNonLazyKeyValueScanner.java index 1eb05f0fbe3..1f8e897660e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonReversedNonLazyKeyValueScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/NonReversedNonLazyKeyValueScanner.java @@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.Cell; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java index 707321d229e..4efa01cb0c0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java @@ -43,7 +43,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.LongAdder; -import org.apache.commons.lang.mutable.MutableObject; +import org.apache.commons.lang3.mutable.MutableObject; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java index dfe22ba5453..17ee48c75ee 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java @@ -31,7 +31,7 @@ import java.util.regex.Matcher; import org.apache.commons.collections.map.AbstractReferenceMap; import org.apache.commons.collections.map.ReferenceMap; -import org.apache.commons.lang.ClassUtils; +import org.apache.commons.lang3.ClassUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java index 9bcf2012376..9e9e29cb3d4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionServerCoprocessorHost.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.Comparator; import java.util.List; -import org.apache.commons.lang.ClassUtils; +import org.apache.commons.lang3.ClassUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedKeyValueHeap.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedKeyValueHeap.java index 2035902341f..b0974dcc14d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedKeyValueHeap.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ReversedKeyValueHeap.java @@ -21,7 +21,8 @@ package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import java.util.List; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; +import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; @@ -188,6 +189,6 @@ public class ReversedKeyValueHeap extends KeyValueHeap { @Override public boolean seekToLastRow() throws IOException { - throw new NotImplementedException("Not implemented"); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java index 08ded8807e0..ffdf295c1d1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/SegmentScanner.java @@ -22,7 +22,7 @@ import java.io.IOException; import java.util.Iterator; import java.util.SortedSet; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java index a79d4c83b6d..846c87d43a7 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java @@ -42,7 +42,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.ReentrantLock; -import org.apache.commons.lang.mutable.MutableLong; +import org.apache.commons.lang3.mutable.MutableLong; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -366,7 +366,7 @@ public abstract class AbstractFSWAL implements WAL { } if (walFileSuffix.isEmpty()) { // in the case of the null suffix, we need to ensure the filename ends with a timestamp. - return org.apache.commons.lang.StringUtils + return org.apache.commons.lang3.StringUtils .isNumeric(fileNameString.substring(prefixPathStr.length())); } else if (!fileNameString.endsWith(walFileSuffix)) { return false; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java index 6c795378faa..7a4f28f9f3f 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/HBaseInterClusterReplicationEndpoint.java @@ -37,7 +37,7 @@ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -446,4 +446,4 @@ public class HBaseInterClusterReplicationEndpoint extends HBaseReplicationEndpoi } } } -} \ No newline at end of file +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java index 620b28bc9eb..80ef6e398a5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java @@ -30,7 +30,7 @@ import java.util.TreeMap; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index f3a37ddc5d8..1a17a2ed95b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicLong; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java index a2a99b352fa..c6fc186e609 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/visibility/VisibilityUtils.java @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java index 3051ab4235e..56517a4835c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java @@ -48,7 +48,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.apache.commons.lang.time.StopWatch; +import org.apache.commons.lang3.time.StopWatch; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -1572,4 +1572,4 @@ public final class Canary implements Tool { executor.shutdown(); System.exit(exitCode); } -} \ No newline at end of file +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java index 1f27d04d2de..a02dde9c182 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java @@ -48,7 +48,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; -import org.apache.commons.lang.mutable.MutableInt; +import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java index 7b745baf684..c6b11a98dfb 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java @@ -21,7 +21,7 @@ package org.apache.hadoop.hbase.util; import java.io.IOException; import java.util.Locale; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java index a73883b0b2d..a76dd5da28b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java @@ -29,7 +29,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import edu.umd.cs.findbugs.annotations.Nullable; -import org.apache.commons.lang.NotImplementedException; +import org.apache.commons.lang3.NotImplementedException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -372,7 +372,7 @@ public class FSTableDescriptors implements TableDescriptors { } TableName tableName = htd.getTableName(); if (TableName.META_TABLE_NAME.equals(tableName)) { - throw new NotImplementedException(); + throw new NotImplementedException(HConstants.NOT_IMPLEMENTED); } if (HConstants.HBASE_NON_USER_TABLE_DIRS.contains(tableName.getNameAsString())) { throw new NotImplementedException( diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java index 886d0da03e2..94ad7717dca 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java @@ -69,8 +69,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.RandomStringUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java index d487eb09e1e..b3c711a047a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/RegionSplitter.java @@ -34,8 +34,8 @@ import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; -import org.apache.commons.lang.ArrayUtils; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRepair.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRepair.java index 8cda518ac86..3c64d2e8730 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRepair.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/OfflineMetaRepair.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.util.hbck; import java.io.IOException; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/NettyAsyncFSWALConfigHelper.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/NettyAsyncFSWALConfigHelper.java index 08796bea823..34ef3f09040 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/NettyAsyncFSWALConfigHelper.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/NettyAsyncFSWALConfigHelper.java @@ -25,7 +25,7 @@ import org.apache.hadoop.hbase.shaded.io.netty.channel.EventLoopGroup; import java.util.HashMap; import java.util.Map; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.util.Pair; diff --git a/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp b/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp index a3701fffe6e..ce62fa1fa62 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp @@ -18,7 +18,7 @@ */ --%> <%@ page contentType="text/html;charset=UTF-8" - import="static org.apache.commons.lang.StringEscapeUtils.escapeXml" + import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml" import="java.util.Collections" import="java.util.Comparator" import="java.util.ArrayList" diff --git a/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp b/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp index d8e29ce577f..6e87e72ac7c 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/processMaster.jsp @@ -21,7 +21,7 @@ import="java.util.Date" import="java.util.List" import="org.apache.hadoop.hbase.HBaseConfiguration" - import="static org.apache.commons.lang.StringEscapeUtils.escapeXml" + import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml" import="javax.management.ObjectName" import="java.lang.management.ManagementFactory" import="java.lang.management.MemoryPoolMXBean" diff --git a/hbase-server/src/main/resources/hbase-webapps/master/processRS.jsp b/hbase-server/src/main/resources/hbase-webapps/master/processRS.jsp index 6abf8a1141c..cc18d5bb1f9 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/processRS.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/processRS.jsp @@ -21,7 +21,7 @@ import="java.util.Date" import="java.util.List" import="org.apache.hadoop.hbase.HBaseConfiguration" - import="static org.apache.commons.lang.StringEscapeUtils.escapeXml" + import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml" import="javax.management.ObjectName" import="java.lang.management.ManagementFactory" import="java.lang.management.MemoryPoolMXBean" diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index 6f3baf06b7d..6c401a9d223 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -19,7 +19,7 @@ --%> <%@page import="org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.RegionSpecifier.RegionSpecifierType"%> <%@ page contentType="text/html;charset=UTF-8" - import="static org.apache.commons.lang.StringEscapeUtils.escapeXml" + import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml" import="org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString" import="java.net.URLEncoder" import="java.util.ArrayList" @@ -31,7 +31,7 @@ import="java.util.Collection" import="java.util.Collections" import="java.util.Comparator" - import="org.apache.commons.lang.StringEscapeUtils" + import="org.apache.commons.lang3.StringEscapeUtils" import="org.apache.hadoop.conf.Configuration" import="org.apache.hadoop.util.StringUtils" import="org.apache.hadoop.hbase.HRegionInfo" @@ -73,7 +73,7 @@ MetaTableLocator metaTableLocator = new MetaTableLocator(); String fqtn = request.getParameter("name"); - final String escaped_fqtn = StringEscapeUtils.escapeHtml(fqtn); + final String escaped_fqtn = StringEscapeUtils.escapeHtml4(fqtn); String sortKey = request.getParameter("sort"); String reverse = request.getParameter("reverse"); final boolean reverseOrder = (reverse==null||!reverse.equals("false")); @@ -122,7 +122,7 @@ <% if ( !readOnly && action != null ) { %> - HBase Master: <%= StringEscapeUtils.escapeHtml(master.getServerName().toString()) %> + HBase Master: <%= StringEscapeUtils.escapeHtml4(master.getServerName().toString()) %> <% } else { %> Table: <%= escaped_fqtn %> <% } %> @@ -276,7 +276,7 @@ if ( fqtn != null ) { %> <%= escapeXml(meta.getRegionNameAsString()) %> - <%= StringEscapeUtils.escapeHtml(metaLocation.getHostname().toString()) + ":" + master.getRegionServerInfoPort(metaLocation) %> + <%= StringEscapeUtils.escapeHtml4(metaLocation.getHostname().toString()) + ":" + master.getRegionServerInfoPort(metaLocation) %> <%= readReq%> <%= writeReq%> <%= fileSize%> @@ -317,7 +317,7 @@ if ( fqtn != null ) { } catch (Exception e) { // Nothing really to do here for(StackTraceElement element : e.getStackTrace()) { - %><%= StringEscapeUtils.escapeHtml(element.toString()) %><% + %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% } %> Unknown <% } @@ -398,7 +398,7 @@ if ( fqtn != null ) { for (HColumnDescriptor family: families) { %> - <%= StringEscapeUtils.escapeHtml(family.getNameAsString()) %> + <%= StringEscapeUtils.escapeHtml4(family.getNameAsString()) %> @@ -411,10 +411,10 @@ if ( fqtn != null ) { %> <% } %> @@ -708,7 +708,7 @@ ShowDetailName&Start/End Key"><%= StringEscapeUtils.escapeHtml(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> + <%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> <% } else { @@ -761,7 +761,7 @@ if (withReplica) { String url = "//" + URLEncoder.encode(addr.getHostname()) + ":" + master.getRegionServerInfoPort(addr) + "/"; %> - + <% if (withReplica) { @@ -776,7 +776,7 @@ if (withReplica) { <% } } catch(Exception ex) { for(StackTraceElement element : ex.getStackTrace()) { - %><%= StringEscapeUtils.escapeHtml(element.toString()) %><% + %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><% } } finally { admin.close(); @@ -894,7 +894,7 @@ Actions:
- <%= StringEscapeUtils.escapeHtml(familyKey.toString()) %> + <%= StringEscapeUtils.escapeHtml4(familyKey.toString()) %> - <%= StringEscapeUtils.escapeHtml(familyValues.get(familyKey).toString()) %> + <%= StringEscapeUtils.escapeHtml4(familyValues.get(familyKey).toString()) %>
<%= StringEscapeUtils.escapeHtml(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %><%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %> <%= rdEntry.getValue()%>