virajjasani commented on a change in pull request #978: HBASE-22285 A
normalizer which merges small size regions with adjacen…
URL: https://github.com/apache/hbase/pull/978#discussion_r363026140
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
##########
@@ -131,108 +102,38 @@ public int compare(NormalizationPlan plan1,
NormalizationPlan plan2) {
LOG.debug("Normalization of system table " + table + " isn't allowed");
return null;
}
- boolean splitEnabled = true, mergeEnabled = true;
- try {
- splitEnabled = masterRpcServices.isSplitOrMergeEnabled(null,
-
RequestConverter.buildIsSplitOrMergeEnabledRequest(MasterSwitchType.SPLIT)).getEnabled();
- } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
e) {
- LOG.debug("Unable to determine whether split is enabled", e);
- }
- try {
- mergeEnabled = masterRpcServices.isSplitOrMergeEnabled(null,
-
RequestConverter.buildIsSplitOrMergeEnabledRequest(MasterSwitchType.MERGE)).getEnabled();
- } catch (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
e) {
- LOG.debug("Unable to determine whether merge is enabled", e);
- }
+ boolean splitEnabled = isSplitEnabled();
+ boolean mergeEnabled = isMergeEnabled();
if (!mergeEnabled && !splitEnabled) {
LOG.debug("Both split and merge are disabled for table: " + table);
return null;
}
List<NormalizationPlan> plans = new ArrayList<>();
- List<RegionInfo> tableRegions =
masterServices.getAssignmentManager().getRegionStates().
- getRegionsOfTable(table);
+ List<RegionInfo> tableRegions =
+
masterServices.getAssignmentManager().getRegionStates().getRegionsOfTable(table);
- //TODO: should we make min number of regions a config param?
if (tableRegions == null || tableRegions.size() < minRegionCount) {
int nrRegions = tableRegions == null ? 0 : tableRegions.size();
LOG.debug("Table " + table + " has " + nrRegions + " regions, required
min number"
- + " of regions for normalizer to run is " + minRegionCount + ", not
running normalizer");
+ + " of regions for normalizer to run is " + minRegionCount + ", not
running normalizer");
return null;
}
- LOG.debug("Computing normalization plan for table: " + table +
- ", number of regions: " + tableRegions.size());
-
- long totalSizeMb = 0;
- int acutalRegionCnt = 0;
+ LOG.debug("Computing normalization plan for table: " + table + ", number
of regions: "
+ + tableRegions.size());
Review comment:
{} can be used
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services