hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject hbase git commit: HBASE-13803 - Disable the MobCompactionChore when the interval is not larger than 0 (Jingcheng Du)
Date Mon, 01 Jun 2015 05:08:58 GMT
Repository: hbase
Updated Branches:
  refs/heads/hbase-11339 b5641d8ed -> 7693e15b2


HBASE-13803 - Disable the MobCompactionChore when the interval is not
larger than 0 (Jingcheng Du)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7693e15b
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7693e15b
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7693e15b

Branch: refs/heads/hbase-11339
Commit: 7693e15b2b34c7caee2cf00887601142b513beff
Parents: b5641d8
Author: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Authored: Mon Jun 1 10:37:54 2015 +0530
Committer: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Committed: Mon Jun 1 10:37:54 2015 +0530

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/master/HMaster.java    | 12 ++++++++++--
 .../apache/hadoop/hbase/master/MobCompactionChore.java  | 12 ++++--------
 2 files changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7693e15b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
----------------------------------------------------------------------
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 fc9aac7..6cc229a 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
@@ -103,6 +103,7 @@ import org.apache.hadoop.hbase.master.procedure.ProcedurePrepareLatch;
 import org.apache.hadoop.hbase.master.procedure.ProcedureSyncWait;
 import org.apache.hadoop.hbase.master.procedure.TruncateTableProcedure;
 import org.apache.hadoop.hbase.master.snapshot.SnapshotManager;
+import org.apache.hadoop.hbase.mob.MobConstants;
 import org.apache.hadoop.hbase.monitoring.MemoryBoundedLogMessageBuffer;
 import org.apache.hadoop.hbase.monitoring.MonitoredTask;
 import org.apache.hadoop.hbase.monitoring.TaskMonitor;
@@ -795,8 +796,15 @@ public class HMaster extends HRegionServer implements MasterServices,
Server {
     this.expiredMobFileCleanerChore = new ExpiredMobFileCleanerChore(this);
     getChoreService().scheduleChore(expiredMobFileCleanerChore);
 
-    this.mobCompactChore = new MobCompactionChore(this);
-    getChoreService().scheduleChore(mobCompactChore);
+    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.mobCompactThread = new MasterMobCompactionThread(this);
 
     if (this.cpHost != null) {

http://git-wip-us.apache.org/repos/asf/hbase/blob/7693e15b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MobCompactionChore.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MobCompactionChore.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MobCompactionChore.java
index 28af3eb..f122955 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MobCompactionChore.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/MobCompactionChore.java
@@ -25,12 +25,11 @@ import java.util.concurrent.TimeUnit;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.hbase.ScheduledChore;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.ScheduledChore;
 import org.apache.hadoop.hbase.TableDescriptors;
 import org.apache.hadoop.hbase.client.TableState;
-import org.apache.hadoop.hbase.mob.MobConstants;
 import org.apache.hadoop.hbase.mob.MobUtils;
 
 /**
@@ -44,12 +43,9 @@ public class MobCompactionChore extends ScheduledChore {
   private TableLockManager tableLockManager;
   private ExecutorService pool;
 
-  public MobCompactionChore(HMaster master) {
-    super(master.getServerName() + "-MobCompactionChore", master, master.getConfiguration()
-      .getInt(MobConstants.MOB_COMPACTION_CHORE_PERIOD,
-        MobConstants.DEFAULT_MOB_COMPACTION_CHORE_PERIOD), master.getConfiguration().getInt(
-      MobConstants.MOB_COMPACTION_CHORE_PERIOD,
-      MobConstants.DEFAULT_MOB_COMPACTION_CHORE_PERIOD), TimeUnit.SECONDS);
+  public MobCompactionChore(HMaster master, int period) {
+    // use the period as initial delay.
+    super(master.getServerName() + "-MobCompactionChore", master, period, period, TimeUnit.SECONDS);
     this.master = master;
     this.tableLockManager = master.getTableLockManager();
     this.pool = MobUtils.createMobCompactorThreadPool(master.getConfiguration());


Mime
View raw message