hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject [hbase] branch master updated: HBASE-23038 Provide consistent and clear logging about disabling chores
Date Fri, 27 Sep 2019 21:55:23 GMT
This is an automated email from the ASF dual-hosted git repository.

busbey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
     new b45c0d0  HBASE-23038 Provide consistent and clear logging about disabling chores
b45c0d0 is described below

commit b45c0d0efa261509ac101748587051ba1c9184bb
Author: Sanjeet Nishad <sanjeetnishad95@gmail.com>
AuthorDate: Thu Sep 26 09:38:37 2019 +0530

    HBASE-23038 Provide consistent and clear logging about disabling chores
    
    Signed-off-by: Viraj Jasani <virajjasani007@gmail.com>
    Signed-off-by: Sean Busbey <busbey@apache.org>
---
 .../src/main/java/org/apache/hadoop/hbase/ChoreService.java      | 4 ++++
 .../src/main/java/org/apache/hadoop/hbase/master/HMaster.java    | 9 ++-------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/ChoreService.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/ChoreService.java
index 85d6131..5e83ef3 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/ChoreService.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/ChoreService.java
@@ -150,6 +150,10 @@ public class ChoreService implements ChoreServicer {
     }
 
     try {
+      if (chore.getPeriod() <= 0) {
+        LOG.info("The period is {} seconds, {} is disabled", chore.getPeriod(), chore.getName());
+        return false;
+      }
       chore.setChoreServicer(this);
       ScheduledFuture<?> future =
           scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(),
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 5939053..2a821d7 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -1304,13 +1304,8 @@ public class HMaster extends HRegionServer implements MasterServices
{
 
     int mobCompactionPeriod = conf.getInt(MobConstants.MOB_COMPACTION_CHORE_PERIOD,
         MobConstants.DEFAULT_MOB_COMPACTION_CHORE_PERIOD);
-    if (mobCompactionPeriod > 0) {
-      this.mobCompactChore = new MobCompactionChore(this, mobCompactionPeriod);
-      getChoreService().scheduleChore(mobCompactChore);
-    } else {
-      LOG
-        .info("The period is " + mobCompactionPeriod + " seconds, MobCompactionChore is disabled");
-    }
+    this.mobCompactChore = new MobCompactionChore(this, mobCompactionPeriod);
+    getChoreService().scheduleChore(mobCompactChore);
     this.mobCompactThread = new MasterMobCompactionThread(this);
   }
 


Mime
View raw message