Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
Currently when the zk data is null considering normaliser on which leads to unnecessary hbase meta scans. Would be better to scan through meta only when normalizer enabled explictly.
public boolean isNormalizerOn() { byte[] upData = super.getData(false); try { // if data in ZK is null, use default of on. return upData == null || parseFrom(upData).getNormalizerOn(); } catch (DeserializationException dex) { LOG .error("ZK state for RegionNormalizer could not be parsed " + Bytes.toStringBinary(upData)); // return false to be safe. return false; } }
public boolean normalizeRegions(final NormalizeTableFilterParams ntfp, final boolean isHighPriority) throws IOException { if (regionNormalizerManager == null || !regionNormalizerManager.isNormalizerOn()) { LOG.debug("Region normalization is disabled, don't run region normalizer."); return false; } if (skipRegionManagementAction("region normalizer")) { return false; } if (assignmentManager.hasRegionsInTransition()) { return false; } final Set<TableName> matchingTables = getTableDescriptors(new LinkedList<>(), ntfp.getNamespace(), ntfp.getRegex(), ntfp.getTableNames(), false).stream() .map(TableDescriptor::getTableName).collect(Collectors.toSet()); final Set<TableName> allEnabledTables = tableStateManager.getTablesInStates(TableState.State.ENABLED);