HBASE-24835 Normalizer should log a successful run at INFO level

Signed-off-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Viraj Jasani <vjasani@apache.org>
This commit is contained in:
Nick Dimiduk 2020-08-07 16:56:13 -07:00 committed by Nick Dimiduk
parent bd30555ac8
commit 17a0c2aabf

View File

@ -31,6 +31,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;
@ -194,6 +195,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.HBaseFsck;
import org.apache.hadoop.hbase.util.HFileArchiveUtil;
import org.apache.hadoop.hbase.util.IdLock;
@ -1888,6 +1890,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;
@ -1905,6 +1908,7 @@ public class HMaster extends HRegionServer implements MasterServices {
return true;
}
int affectedTables = 0;
try {
final List<TableName> allEnabledTables =
new ArrayList<>(tableStateManager.getTablesInStates(TableState.State.ENABLED));
@ -1933,6 +1937,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.
@ -1946,11 +1951,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();
}