[ 
https://issues.apache.org/jira/browse/HBASE-27735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rajeshbabu Chintaguntla updated HBASE-27735:
--------------------------------------------
    Summary: Skip hbase:meta table scan if the normalizer not enabled for any 
of the tables as well as default table wise normalization disabled  (was: 
Considering Normalizer on in case of zk data is null leading to unnecessary 
meta table scans )

> Skip hbase:meta table scan if the normalizer not enabled for any of the 
> tables as well as default table wise normalization disabled
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-27735
>                 URL: https://issues.apache.org/jira/browse/HBASE-27735
>             Project: HBase
>          Issue Type: Improvement
>          Components: Normalizer
>            Reporter: Rajeshbabu Chintaguntla
>            Assignee: Rajeshbabu Chintaguntla
>            Priority: Major
>
> 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.
> {noformat}
>   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;
>     }
>   }
> {noformat}
> {noformat}
>   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);
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to