From c1c2e160ecff09602317e9b82058ba10d76b73fd Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 7 Aug 2020 16:56:13 -0700 Subject: [PATCH] HBASE-24835 Normalizer should log a successful run at INFO level Signed-off-by: Sean Busbey Signed-off-by: Viraj Jasani --- .../org/apache/hadoop/hbase/master/HMaster.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 9d2838d86c3..8599523e6c2 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 @@ -29,6 +29,7 @@ import java.lang.reflect.InvocationTargetException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -198,6 +199,7 @@ import org.apache.hadoop.hbase.security.UserProvider; import org.apache.hadoop.hbase.trace.TraceUtil; import org.apache.hadoop.hbase.util.Addressing; import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; import org.apache.hadoop.hbase.util.FutureUtils; import org.apache.hadoop.hbase.util.HBaseFsck; import org.apache.hadoop.hbase.util.HFileArchiveUtil; @@ -1916,6 +1918,7 @@ public class HMaster extends HRegionServer implements MasterServices { * or normalization is globally disabled). */ public boolean normalizeRegions() throws IOException { + final long startTime = EnvironmentEdgeManager.currentTime(); if (regionNormalizerTracker == null || !regionNormalizerTracker.isNormalizerOn()) { LOG.debug("Region normalization is disabled, don't run region normalizer."); return false; @@ -1933,6 +1936,7 @@ public class HMaster extends HRegionServer implements MasterServices { return true; } + int affectedTables = 0; try { final List allEnabledTables = new ArrayList<>(tableStateManager.getTablesInStates(TableState.State.ENABLED)); @@ -1961,6 +1965,7 @@ public class HMaster extends HRegionServer implements MasterServices { continue; } + affectedTables++; // as of this writing, `plan.submit()` is non-blocking and uses Async Admin APIs to // submit task , so there's no artificial rate- // limiting of merge/split requests due to this serial loop. @@ -1974,11 +1979,10 @@ public class HMaster extends HRegionServer implements MasterServices { } } } - int totalPlansSubmitted = submittedPlanProcIds.size(); - if (totalPlansSubmitted > 0 && LOG.isDebugEnabled()) { - LOG.debug("Normalizer plans submitted. Total plans count: {} , procID list: {}", - totalPlansSubmitted, submittedPlanProcIds); - } + final long endTime = EnvironmentEdgeManager.currentTime(); + LOG.info("Normalizer ran successfully in {}. Submitted {} plans, affecting {} tables.", + Duration.ofMillis(endTime - startTime), submittedPlanProcIds.size(), affectedTables); + LOG.debug("Normalizer submitted procID list: {}", submittedPlanProcIds); } finally { normalizationInProgressLock.unlock(); }