Source:
<code>public boolean normalizeRegions() throws IOException { if (regionNormalizerTracker == null || !regionNormalizerTracker.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; } <START> if (!normalizationInProgressLock.tryLock()) { <END> LOG.info("Normalization already in progress. Skipping request."); } else { try { List<TableName> allEnabledTables = new ArrayList<>( tableStateManager.getTablesInStates(TableState.State.ENABLED)); Collections.shuffle(allEnabledTables); for (TableName table : allEnabledTables) { if (table.isSystemTable()) { continue; } final TableDescriptor tblDesc = getTableDescriptors().get(table); if (tblDesc != null && !tblDesc.isNormalizationEnabled()) { LOG.debug( "Skipping because normalization is disabled in its table properties.", table); continue; } if (skipRegionManagementAction("region normalizer")) { return false; } final List<NormalizationPlan> plans = normalizer.computePlansForTable(table); if (CollectionUtils.isEmpty(plans)) { return true; } try (final Admin admin = asyncClusterConnection.toConnection().getAdmin()) { for (NormalizationPlan plan : plans) { plan.execute(admin); if (plan.getType() == PlanType.SPLIT) { splitPlanCount++; } else if (plan.getType() == PlanType.MERGE) { mergePlanCount++; } } } } } finally { normalizationInProgressLock.unlock(); } } return true; }</code><technical_language>is wrong this, do inverted check provide readability? if(lock.tryLock()){ try{ // do }finally{ lock.unlock(); } }else{ log.info("lock in progress"); }</technical_language>

Target:
public boolean normalizeRegions() throws IOException { if (regionNormalizerTracker == null || !regionNormalizerTracker.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; } if (!normalizationInProgressLock.tryLock()) { LOG.info("Normalization already in progress. Skipping request."); return true; } try { final List<TableName> allEnabledTables = new ArrayList<>( tableStateManager.getTablesInStates(TableState.State.ENABLED)); Collections.shuffle(allEnabledTables); try (final Admin admin = asyncClusterConnection.toConnection().getAdmin()) { for (TableName table : allEnabledTables) { if (table.isSystemTable()) { continue; } final TableDescriptor tblDesc = getTableDescriptors().get(table); if (tblDesc != null && !tblDesc.isNormalizationEnabled()) { LOG.debug("Skipping table because normalization is disabled in its" + " table properties.", table); continue; } if (skipRegionManagementAction("region normalizer")) { return false; } final List<NormalizationPlan> plans = normalizer.computePlansForTable(table); if (CollectionUtils.isEmpty(plans)) { LOG.debug("No normalization required for table {}.", table); continue; } for (NormalizationPlan plan : plans) { plan.execute(admin); if (plan.getType() == PlanType.SPLIT) { splitPlanCount++; } else if (plan.getType() == PlanType.MERGE) { mergePlanCount++; } } } } } finally { normalizationInProgressLock.unlock(); } return true; }