Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
- index 312bcce..f099847 100644
- --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
- +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
- @@ -91,35 +91,26 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Schedu
- /**
- * Checks if pool can be updated immediately.
- * @param conf configuration
- - * @return true if pool can be updated immediately, false otherwise
- */
- - synchronized boolean canUpdateImmediately(Configuration conf) {
- + synchronized void canUpdateImmediately(Configuration conf) {
- int newSize = calculatePoolSize(conf.get(CHORE_POOL_SIZE, DEFAULT_CHORE_POOL_SIZE));
- if (newSize == size) {
- LOG.trace("Size from configuration is same as previous={}, no need to update.", newSize);
- - return false;
- + return;
- }
- size = newSize;
- - if (pool.getPoolSize() == 0) {
- - // chore has no working thread.
- - return true;
- - }
- // Chore is working, update it later.
- reconfigNotification.set(true);
- - return false;
- }
- /**
- * Update pool with new size.
- */
- synchronized void updatePool(long timeout) {
- - while (cleanerLatch != 0) {
- - try {
- - wait(timeout);
- - } catch (InterruptedException ie) {
- - // It's ok to ignore
- - }
- - break;
- + try {
- + wait(timeout);
- + } catch (InterruptedException ie) {
- + Thread.currentThread().interrupt();
- }
- pool.shutdownNow();
- LOG.info("Update chore's pool size from {} to {}", pool.getParallelism(), size);
- @@ -243,10 +234,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Schedu
- @Override
- public void onConfigurationChange(Configuration conf) {
- - if (POOL.canUpdateImmediately(conf)) {
- - // Can immediately update, no need to wait.
- - POOL.updatePool(0);
- - }
- + POOL.canUpdateImmediately(conf);
- }
- /**
Advertisement
Add Comment
Please, Sign In to add comment