virajjasani commented on a change in pull request #2000:
URL: https://github.com/apache/hbase/pull/2000#discussion_r458263124



##########
File path: 
hbase-it/src/test/java/org/apache/hadoop/hbase/chaos/monkies/PolicyBasedChaosMonkey.java
##########
@@ -60,19 +66,30 @@ public PolicyBasedChaosMonkey(IntegrationTestingUtility 
util, Collection<Policy>
   }
 
   public PolicyBasedChaosMonkey(Properties monkeyProps, 
IntegrationTestingUtility util,
-    Policy... policies) {
-    this.monkeyProps = monkeyProps;
-    this.util = util;
-    this.policies = policies;
+    Collection<Policy> policies) {
+    this(monkeyProps, util, policies.toArray(new Policy[0]));
   }
 
   public PolicyBasedChaosMonkey(Properties monkeyProps, 
IntegrationTestingUtility util,
-    Collection<Policy> policies) {
+    Policy... policies) {
     this.monkeyProps = monkeyProps;
-    this.util = util;
-    this.policies = policies.toArray(new Policy[policies.size()]);
+    this.util = Objects.requireNonNull(util);
+    this.policies = Objects.requireNonNull(policies);
+    if (policies.length == 0) {
+      throw new IllegalArgumentException("policies may not be empty");
+    }
+    this.monkeyThreadPool = buildMonkeyThreadPool(policies.length);
   }
 
+  private static ExecutorService buildMonkeyThreadPool(final int size) {
+    return Executors.newFixedThreadPool(size, new ThreadFactoryBuilder()

Review comment:
       That's true, we should use only one of them, filed: 
https://issues.apache.org/jira/browse/HBASE-24750




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to