virajjasani commented on a change in pull request #2000:
URL: https://github.com/apache/hbase/pull/2000#discussion_r452936475
##########
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:
This one actually sets daemon to true, we don't want that so maybe we
can have separate method for setting daemon to false.
However, this work could be separate Jira and if we have majority, maybe we
can make all Executor pool in HBase use our internal ThreadFactory and not from
guava.
----------------------------------------------------------------
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:
[email protected]