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 4d34a6e0a63..a751b92b2f3 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 @@ -27,8 +27,6 @@ import java.util.List; import java.util.Set; import org.apache.commons.lang.math.RandomUtils; -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.HBaseCluster; @@ -39,6 +37,8 @@ import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.util.Bytes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * A (possibly mischievous) action that the ChaosMonkey can perform. @@ -64,7 +64,7 @@ public class Action { public static final String START_NAMENODE_TIMEOUT_KEY = "hbase.chaosmonkey.action.startnamenodetimeout"; - protected static final Log LOG = LogFactory.getLog(Action.class); + private static final Logger LOG = LoggerFactory.getLogger(Action.class); protected static final long KILL_MASTER_TIMEOUT_DEFAULT = PolicyBasedChaosMonkey.TIMEOUT; protected static final long START_MASTER_TIMEOUT_DEFAULT = PolicyBasedChaosMonkey.TIMEOUT; 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 27268a4632a..08eef68727e 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 @@ -25,6 +25,8 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action the adds a column family to a table. @@ -32,6 +34,7 @@ import org.apache.hadoop.hbase.client.Admin; public class AddColumnAction extends Action { private final TableName tableName; private Admin admin; + private static final Logger LOG = LoggerFactory.getLogger(AddColumnAction.class); public AddColumnAction(TableName tableName) { this.tableName = tableName; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/BatchRestartRsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/BatchRestartRsAction.java index ce660006b27..129721be72f 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/BatchRestartRsAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/BatchRestartRsAction.java @@ -24,12 +24,16 @@ import java.util.Set; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Restarts a ratio of the running regionservers at the same time */ public class BatchRestartRsAction extends RestartActionBaseAction { float ratio; //ratio of regionservers to restart + private static final Logger LOG = + LoggerFactory.getLogger(BatchRestartRsAction.class); public BatchRestartRsAction(long sleepTime, float ratio) { super(sleepTime); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java index 684cd629863..907c3f96345 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeBloomFilterAction.java @@ -26,6 +26,8 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.regionserver.BloomType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to adjust the bloom filter setting on all the columns of a @@ -34,6 +36,7 @@ import org.apache.hadoop.hbase.regionserver.BloomType; public class ChangeBloomFilterAction extends Action { private final long sleepTime; private final TableName tableName; + private static final Logger LOG = LoggerFactory.getLogger(ChangeBloomFilterAction.class); public ChangeBloomFilterAction(TableName tableName) { this(-1, tableName); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java index 9c7bf45e3ab..9a2a5f01e45 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeCompressionAction.java @@ -28,6 +28,9 @@ import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.io.compress.Compression.Algorithm; import org.apache.hadoop.io.compress.Compressor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Action that changes the compression algorithm on a column family from a list of tables. */ @@ -36,6 +39,7 @@ public class ChangeCompressionAction extends Action { private Admin admin; private Random random; + private static final Logger LOG = LoggerFactory.getLogger(ChangeCompressionAction.class); public ChangeCompressionAction(TableName tableName) { this.tableName = tableName; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java index c4553f15524..e678afe1d46 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeEncodingAction.java @@ -26,6 +26,8 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that changes the encoding on a column family from a list of tables. @@ -35,6 +37,7 @@ public class ChangeEncodingAction extends Action { private Admin admin; private Random random; + private static final Logger LOG = LoggerFactory.getLogger(ChangeEncodingAction.class); public ChangeEncodingAction(TableName tableName) { this.tableName = tableName; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java index b5f759f3bcb..dc1cfee5c55 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeSplitPolicyAction.java @@ -17,6 +17,8 @@ */ package org.apache.hadoop.hbase.chaos.actions; +import java.util.Random; + import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; @@ -24,10 +26,11 @@ import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy; import org.apache.hadoop.hbase.regionserver.DisabledRegionSplitPolicy; import org.apache.hadoop.hbase.regionserver.IncreasingToUpperBoundRegionSplitPolicy; - -import java.util.Random; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ChangeSplitPolicyAction extends Action { + private static final Logger LOG = LoggerFactory.getLogger(ChangeSplitPolicyAction.class); private final TableName tableName; private final String[] possiblePolicies; private final Random random; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java index 76e152f19f1..7e2332c8967 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ChangeVersionsAction.java @@ -25,6 +25,8 @@ import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that changes the number of versions on a column family from a list of tables. @@ -33,6 +35,7 @@ import org.apache.hadoop.hbase.client.Admin; */ public class ChangeVersionsAction extends Action { private final TableName tableName; + private static final Logger LOG = LoggerFactory.getLogger(ChangeVersionsAction.class); private Admin admin; private Random random; 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 114b511ee86..6003240c48f 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 @@ -26,6 +26,8 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Region that queues a compaction of a random region from the table. @@ -34,6 +36,8 @@ public class CompactRandomRegionOfTableAction extends Action { private final int majorRatio; private final long sleepTime; private final TableName tableName; + private static final Logger LOG = + LoggerFactory.getLogger(CompactRandomRegionOfTableAction.class); public CompactRandomRegionOfTableAction( TableName tableName, float majorRatio) { 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 796cc43a087..2f5436a4217 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 @@ -22,6 +22,8 @@ import org.apache.commons.lang.math.RandomUtils; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that queues a table compaction. @@ -30,6 +32,7 @@ public class CompactTableAction extends Action { private final TableName tableName; private final int majorRatio; private final long sleepTime; + private static final Logger LOG = LoggerFactory.getLogger(CompactTableAction.class); public CompactTableAction(TableName tableName, float majorRatio) { this(-1, tableName, majorRatio); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DumpClusterStatusAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DumpClusterStatusAction.java index 0403fe047f9..11246ea4a27 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DumpClusterStatusAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/DumpClusterStatusAction.java @@ -20,10 +20,15 @@ package org.apache.hadoop.hbase.chaos.actions; import java.io.IOException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Action to dump the cluster status. */ public class DumpClusterStatusAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(DumpClusterStatusAction.class); @Override public void init(ActionContext context) throws IOException { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java index c919789f9fb..c4286dbf1f9 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushRandomRegionOfTableAction.java @@ -25,16 +25,20 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to flush a random region of a table. */ public class FlushRandomRegionOfTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(FlushRandomRegionOfTableAction.class); private final long sleepTime; private final TableName tableName; public FlushRandomRegionOfTableAction(TableName tableName) { - this (-1, tableName); + this (-1, tableName); } public FlushRandomRegionOfTableAction(int sleepTime, TableName tableName) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java index ddce57e8b53..994fd057a5f 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/FlushTableAction.java @@ -21,11 +21,15 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to flush a table. */ public class FlushTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(FlushTableAction.class); private final long sleepTime; private final TableName tableName; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ForceBalancerAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ForceBalancerAction.java index 04f389a9519..d75475432a1 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ForceBalancerAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/ForceBalancerAction.java @@ -18,10 +18,16 @@ package org.apache.hadoop.hbase.chaos.actions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * Action that tries to force a balancer run. */ public class ForceBalancerAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(ForceBalancerAction.class); + @Override public void perform() throws Exception { // Don't try the flush if we're stopping 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 8645dc4c940..eac7d30100a 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 @@ -25,11 +25,15 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action to merge regions of a table. */ public class MergeRandomAdjacentRegionsOfTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(MergeRandomAdjacentRegionsOfTableAction.class); private final TableName tableName; private final long sleepTime; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java index 96cd0086456..52816f323d4 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/MoveRandomRegionOfTableAction.java @@ -25,11 +25,15 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to move a random region of a table. */ public class MoveRandomRegionOfTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(MoveRandomRegionOfTableAction.class); private final long sleepTime; private final TableName tableName; 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 d5f0e9652bf..e38309b4d36 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 @@ -29,11 +29,15 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.factories.MonkeyConstants; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.util.Bytes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to move every region of a table. */ public class MoveRegionsOfTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(MoveRegionsOfTableAction.class); private final long sleepTime; private final TableName tableName; private final long maxTime; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java index 20bdaa3c1d4..e5ca3e857d2 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RemoveColumnAction.java @@ -27,11 +27,15 @@ import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.util.Bytes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that removes a column family. */ public class RemoveColumnAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(RemoveColumnAction.class); private final TableName tableName; private final Set protectedColumns; private Admin admin; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActionBaseAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActionBaseAction.java index 22d7e2618e3..8376f51d81a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActionBaseAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActionBaseAction.java @@ -22,11 +22,15 @@ import java.io.IOException; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.util.Threads; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Base class for restarting HBaseServer's */ public class RestartActionBaseAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(RestartActionBaseAction.class); long sleepTime; // how long should we sleep public RestartActionBaseAction(long sleepTime) { diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveMasterAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveMasterAction.java index a9bc23ab754..ab7decd3f1c 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveMasterAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveMasterAction.java @@ -19,11 +19,15 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.hadoop.hbase.ServerName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to restart the active master. */ public class RestartActiveMasterAction extends RestartActionBaseAction { + private static final Logger LOG = LoggerFactory.getLogger(RestartActionBaseAction.class); + public RestartActiveMasterAction(long sleepTime) { super(sleepTime); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveNameNodeAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveNameNodeAction.java index 710ac147786..d9cbfbddc8a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveNameNodeAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartActiveNameNodeAction.java @@ -29,11 +29,15 @@ import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.hadoop.hdfs.DFSUtil; import org.apache.hadoop.hdfs.HAUtil; import org.apache.hadoop.hdfs.server.namenode.ha.proto.HAZKInfoProtos.ActiveNodeInfo; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to restart the active namenode. */ public class RestartActiveNameNodeAction extends RestartActionBaseAction { + private static final Logger LOG = + LoggerFactory.getLogger(RestartActiveNameNodeAction.class); // Value taken from org.apache.hadoop.ha.ActiveStandbyElector.java, variable :- LOCK_FILENAME private static final String ACTIVE_NN_LOCK_NAME = "ActiveStandbyElectorLock"; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomDataNodeAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomDataNodeAction.java index 7299e79ed16..09e2990db61 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomDataNodeAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomDataNodeAction.java @@ -18,6 +18,10 @@ package org.apache.hadoop.hbase.chaos.actions; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; + import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.util.FSUtils; @@ -25,15 +29,15 @@ import org.apache.hadoop.hdfs.DFSClient; import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.hadoop.hdfs.protocol.DatanodeInfo; import org.apache.hadoop.hdfs.protocol.HdfsConstants; - -import java.io.IOException; -import java.util.LinkedList; -import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that restarts a random datanode. */ public class RestartRandomDataNodeAction extends RestartActionBaseAction { + private static final Logger LOG = LoggerFactory.getLogger(RestartRandomDataNodeAction.class); + public RestartRandomDataNodeAction(long sleepTime) { super(sleepTime); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java index 7b09dd31051..48458b68dcf 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomRsAction.java @@ -20,11 +20,15 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that restarts a random HRegionServer */ public class RestartRandomRsAction extends RestartActionBaseAction { + private static final Logger LOG = LoggerFactory.getLogger(RestartRandomRsAction.class); + public RestartRandomRsAction(long sleepTime) { super(sleepTime); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomZKNodeAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomZKNodeAction.java index 6043acde1ba..7984af7ba4a 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomZKNodeAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRandomZKNodeAction.java @@ -21,11 +21,15 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.zookeeper.ZKServerTool; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that restarts a random zookeeper node. */ public class RestartRandomZKNodeAction extends RestartActionBaseAction { + private static final Logger LOG = LoggerFactory.getLogger(RestartRandomZKNodeAction.class); + public RestartRandomZKNodeAction(long sleepTime) { super(sleepTime); } diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingMetaAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingMetaAction.java index a6b4fc76601..09b3db69c3d 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingMetaAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/RestartRsHoldingMetaAction.java @@ -20,11 +20,16 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.ServerName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to restart the HRegionServer holding Meta. */ public class RestartRsHoldingMetaAction extends RestartActionBaseAction { + private static final Logger LOG = + LoggerFactory.getLogger(RestartRsHoldingMetaAction.class); + public RestartRsHoldingMetaAction(long sleepTime) { super(sleepTime); } 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 b1ea8e53126..79e91fe0820 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 @@ -26,11 +26,15 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.HTable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that restarts an HRegionServer holding one of the regions of the table. */ public class RestartRsHoldingTableAction extends RestartActionBaseAction { + private static final Logger LOG = + LoggerFactory.getLogger(RestartRsHoldingTableAction.class); private final String tableName; 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 e79ff5b5739..347340799c1 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 @@ -32,8 +32,9 @@ import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; /** * Restarts a ratio of the regionservers in a rolling fashion. At each step, either kills a - * server, or starts one, sleeping randomly (0-sleepTime) in between steps. The parameter maxDeadServers - * limits the maximum number of servers that can be down at the same time during rolling restarts. + * server, or starts one, sleeping randomly (0-sleepTime) in between steps. + * The parameter maxDeadServers limits the maximum number of servers that + * can be down at the same time during rolling restarts. */ public class RollingBatchRestartRsAction extends BatchRestartRsAction { private static final Log LOG = LogFactory.getLog(RollingBatchRestartRsAction.class); @@ -81,27 +82,27 @@ public class RollingBatchRestartRsAction extends BatchRestartRsAction { ServerName server; switch (action) { - case KILL: - server = serversToBeKilled.remove(); - try { - killRs(server); - } catch (org.apache.hadoop.util.Shell.ExitCodeException e) { - // We've seen this in test runs where we timeout but the kill went through. HBASE-9743 - // So, add to deadServers even if exception so the start gets called. - LOG.info("Problem killing but presume successful; code=" + e.getExitCode(), e); - } - deadServers.add(server); - break; - case START: - try { - server = deadServers.remove(); - startRs(server); - } catch (org.apache.hadoop.util.Shell.ExitCodeException e) { - // The start may fail but better to just keep going though we may lose server. - // - LOG.info("Problem starting, will retry; code=" + e.getExitCode(), e); - } - break; + case KILL: + server = serversToBeKilled.remove(); + try { + killRs(server); + } catch (org.apache.hadoop.util.Shell.ExitCodeException e) { + // We've seen this in test runs where we timeout but the kill went through. HBASE-9743 + // So, add to deadServers even if exception so the start gets called. + LOG.info("Problem killing but presume successful; code=" + e.getExitCode(), e); + } + deadServers.add(server); + break; + case START: + try { + server = deadServers.remove(); + startRs(server); + } catch (org.apache.hadoop.util.Shell.ExitCodeException e) { + // The start may fail but better to just keep going though we may lose server. + // + LOG.info("Problem starting, will retry; code=" + e.getExitCode(), e); + } + break; } sleep(RandomUtils.nextInt((int)sleepTime)); diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java index 15b8e86feec..7e7dc8da24c 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SnapshotTableAction.java @@ -21,11 +21,15 @@ package org.apache.hadoop.hbase.chaos.actions; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to take a snapshot of a table. */ public class SnapshotTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(SnapshotTableAction.class); private final TableName tableName; private final long sleepTime; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java index 5b29d00c403..5a24af9eeb6 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitAllRegionOfTableAction.java @@ -17,15 +17,19 @@ */ package org.apache.hadoop.hbase.chaos.actions; -import org.apache.hadoop.hbase.HBaseTestingUtility; -import org.apache.hadoop.hbase.TableName; -import org.apache.hadoop.hbase.client.Admin; - import java.io.IOException; import java.util.concurrent.ThreadLocalRandom; +import org.apache.hadoop.hbase.HBaseTestingUtility; +import org.apache.hadoop.hbase.TableName; +import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class SplitAllRegionOfTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(SplitAllRegionOfTableAction.class); private static final int DEFAULT_MAX_SPLITS = 3; private static final String MAX_SPLIT_KEY = "hbase.chaosmonkey.action.maxFullTableSplits"; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java index 25c80e918cf..df424ec9e47 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/SplitRandomRegionOfTableAction.java @@ -25,11 +25,15 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.chaos.monkies.PolicyBasedChaosMonkey; import org.apache.hadoop.hbase.client.Admin; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to split a random region of a table. */ public class SplitRandomRegionOfTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(SplitRandomRegionOfTableAction.class); private final long sleepTime; private final TableName tableName; diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java index 2a4871d3e72..12bbd094ce6 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/actions/TruncateTableAction.java @@ -24,11 +24,15 @@ import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.client.Admin; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.hadoop.hbase.TableName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to truncate of a table. */ public class TruncateTableAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(TruncateTableAction.class); private final TableName tableName; private final Random random; 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 0035c2c4c72..264a54f191c 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 @@ -28,9 +28,13 @@ import org.apache.commons.lang.math.RandomUtils; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.ServerName; import org.junit.Assert; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** This action is too specific to put in ChaosMonkey; put it here */ public class UnbalanceKillAndRebalanceAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(UnbalanceKillAndRebalanceAction.class); /** Fractions of servers to get regions and live and die respectively; from all other * servers, HOARD_FRC_OF_REGIONS will be removed to the above randomly */ private static final double FRC_SERVERS_THAT_HOARD_AND_LIVE = 0.1; 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 2779bd1ca1a..54690bf3fff 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 @@ -25,11 +25,15 @@ import java.util.List; import org.apache.commons.lang.math.RandomUtils; import org.apache.hadoop.hbase.ClusterStatus; import org.apache.hadoop.hbase.ServerName; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Action that tries to unbalance the regions of a cluster. */ public class UnbalanceRegionsAction extends Action { + private static final Logger LOG = + LoggerFactory.getLogger(UnbalanceRegionsAction.class); private double fractionOfRegions; private double fractionOfServers;