[
https://issues.apache.org/jira/browse/HBASE-20095?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16414989#comment-16414989
]
Reid Chan commented on HBASE-20095:
-----------------------------------
BTW, {{wait}} without while loop will trigger {{findbugs}} warning.
What about this impl:
{code}
synchronized void updatePool(long timeout) {
long stopWaitTime = System.currentTimeMillis() + timeout;
while (cleanerLatch != 0 && timeout > 0) {
try {
wait(timeout);
timeout = stopWaitTime - System.currentTimeMillis();
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
}
}
pool.shutdownNow();
LOG.info("Update chore's pool size from {} to {}", pool.getParallelism(),
size);
pool = new ForkJoinPool(size);
}
{code}
I think this impl may be better than my previous one if more than 2 cleaners
are available..
> Redesign single instance pool in CleanerChore
> ---------------------------------------------
>
> Key: HBASE-20095
> URL: https://issues.apache.org/jira/browse/HBASE-20095
> Project: HBase
> Issue Type: Improvement
> Reporter: Reid Chan
> Assignee: Reid Chan
> Priority: Critical
> Fix For: 3.0.0, 2.1.0
>
> Attachments: 20095.addendum, HBASE-20095.master.001.patch,
> HBASE-20095.master.002.patch, HBASE-20095.master.003.patch,
> HBASE-20095.master.004.patch, HBASE-20095.master.005.patch,
> HBASE-20095.master.006.patch, HBASE-20095.master.007.patch,
> HBASE-20095.master.008.patch, HBASE-20095.master.009.patch,
> HBASE-20095.master.010.patch, HBASE-20095.master.011.patch,
> HBASE-20095.master.012.patch, HBASE-20095.master.013.patch,
> HBASE-20095.master.014.patch
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)