Guest User

Untitled

a guest
Mar 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. 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
  2. index 312bcce..f099847 100644
  3. --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
  4. +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
  5. @@ -91,35 +91,26 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Schedu
  6. /**
  7. * Checks if pool can be updated immediately.
  8. * @param conf configuration
  9. - * @return true if pool can be updated immediately, false otherwise
  10. */
  11. - synchronized boolean canUpdateImmediately(Configuration conf) {
  12. + synchronized void canUpdateImmediately(Configuration conf) {
  13. int newSize = calculatePoolSize(conf.get(CHORE_POOL_SIZE, DEFAULT_CHORE_POOL_SIZE));
  14. if (newSize == size) {
  15. LOG.trace("Size from configuration is same as previous={}, no need to update.", newSize);
  16. - return false;
  17. + return;
  18. }
  19. size = newSize;
  20. - if (pool.getPoolSize() == 0) {
  21. - // chore has no working thread.
  22. - return true;
  23. - }
  24. // Chore is working, update it later.
  25. reconfigNotification.set(true);
  26. - return false;
  27. }
  28.  
  29. /**
  30. * Update pool with new size.
  31. */
  32. synchronized void updatePool(long timeout) {
  33. - while (cleanerLatch != 0) {
  34. - try {
  35. - wait(timeout);
  36. - } catch (InterruptedException ie) {
  37. - // It's ok to ignore
  38. - }
  39. - break;
  40. + try {
  41. + wait(timeout);
  42. + } catch (InterruptedException ie) {
  43. + Thread.currentThread().interrupt();
  44. }
  45. pool.shutdownNow();
  46. LOG.info("Update chore's pool size from {} to {}", pool.getParallelism(), size);
  47. @@ -243,10 +234,7 @@ public abstract class CleanerChore<T extends FileCleanerDelegate> extends Schedu
  48.  
  49. @Override
  50. public void onConfigurationChange(Configuration conf) {
  51. - if (POOL.canUpdateImmediately(conf)) {
  52. - // Can immediately update, no need to wait.
  53. - POOL.updatePool(0);
  54. - }
  55. + POOL.canUpdateImmediately(conf);
  56. }
  57.  
  58. /**
Advertisement
Add Comment
Please, Sign In to add comment