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>
(cherry picked from commit b45c0d0efa)
This commit is contained in:
Sanjeet Nishad 2019-09-26 09:38:37 +05:30 committed by Sean Busbey
parent 43b4ad9e8a
commit 6def152819
2 changed files with 6 additions and 7 deletions

View File

@ -150,6 +150,10 @@ public class ChoreService implements ChoreServicer {
} }
try { try {
if (chore.getPeriod() <= 0) {
LOG.info("The period is {} seconds, {} is disabled", chore.getPeriod(), chore.getName());
return false;
}
chore.setChoreServicer(this); chore.setChoreServicer(this);
ScheduledFuture<?> future = ScheduledFuture<?> future =
scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(), scheduler.scheduleAtFixedRate(chore, chore.getInitialDelay(), chore.getPeriod(),

View File

@ -1281,13 +1281,8 @@ public class HMaster extends HRegionServer implements MasterServices {
int mobCompactionPeriod = conf.getInt(MobConstants.MOB_COMPACTION_CHORE_PERIOD, int mobCompactionPeriod = conf.getInt(MobConstants.MOB_COMPACTION_CHORE_PERIOD,
MobConstants.DEFAULT_MOB_COMPACTION_CHORE_PERIOD); MobConstants.DEFAULT_MOB_COMPACTION_CHORE_PERIOD);
if (mobCompactionPeriod > 0) {
this.mobCompactChore = new MobCompactionChore(this, mobCompactionPeriod); this.mobCompactChore = new MobCompactionChore(this, mobCompactionPeriod);
getChoreService().scheduleChore(mobCompactChore); getChoreService().scheduleChore(mobCompactChore);
} else {
LOG
.info("The period is " + mobCompactionPeriod + " seconds, MobCompactionChore is disabled");
}
this.mobCompactThread = new MasterMobCompactionThread(this); this.mobCompactThread = new MasterMobCompactionThread(this);
} }