From a5dbaaa56c99f891eb30089f9b00876a6562ca68 Mon Sep 17 00:00:00 2001 From: Umesh Agashe Date: Tue, 25 Jul 2017 17:45:26 -0700 Subject: [PATCH] HBASE-18427 minor cleanup around AssignmentManager - unused imports - superfluous exception in method definitions Change-Id: I156383b9895fa718fe9d5227003c23bd945cf999 Signed-off-by: Apekshit Sharma --- .../master/assignment/AssignmentManager.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java index 58453ee4bc9..7836625a9e2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/assignment/AssignmentManager.java @@ -22,7 +22,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -67,7 +66,6 @@ import org.apache.hadoop.hbase.master.assignment.RegionStates.RegionStateNode; import org.apache.hadoop.hbase.master.assignment.RegionStates.ServerState; import org.apache.hadoop.hbase.master.assignment.RegionStates.ServerStateNode; // TODO: why are they here? -import org.apache.hadoop.hbase.master.normalizer.NormalizationPlan.PlanType; import org.apache.hadoop.hbase.master.normalizer.RegionNormalizer; import org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv; import org.apache.hadoop.hbase.master.procedure.MasterProcedureScheduler; @@ -78,7 +76,6 @@ import org.apache.hadoop.hbase.procedure2.ProcedureEvent; import org.apache.hadoop.hbase.procedure2.ProcedureExecutor; import org.apache.hadoop.hbase.procedure2.ProcedureInMemoryChore; import org.apache.hadoop.hbase.procedure2.util.StringUtils; -import org.apache.hadoop.hbase.quotas.QuotaExceededException; import org.apache.hadoop.hbase.shaded.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition; import org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.RegionStateTransition.TransitionCode; @@ -858,8 +855,7 @@ public class AssignmentManager implements ServerListener { } private void updateRegionMergeTransition(final ServerName serverName, final TransitionCode state, - final HRegionInfo merged, final HRegionInfo hriA, final HRegionInfo hriB) - throws PleaseHoldException, UnexpectedStateException, IOException { + final HRegionInfo merged, final HRegionInfo hriA, final HRegionInfo hriB) throws IOException { checkFailoverCleanupCompleted(merged); if (state != TransitionCode.READY_TO_MERGE) { @@ -1090,7 +1086,7 @@ public class AssignmentManager implements ServerListener { public boolean isRegionOverThreshold(final HRegionInfo regionInfo) { Map m = this.ritsOverThreshold; - return m != null? m.containsKey(regionInfo.getEncodedName()): false; + return m != null && m.containsKey(regionInfo.getEncodedName()); } public boolean isRegionTwiceOverThreshold(final HRegionInfo regionInfo) { @@ -1311,7 +1307,7 @@ public class AssignmentManager implements ServerListener { " to dead servers, submitted shutdown handler to be executed meta=" + carryingMeta); } - public void offlineRegion(final HRegionInfo regionInfo) throws IOException { + public void offlineRegion(final HRegionInfo regionInfo) { // TODO used by MasterRpcServices ServerCrashProcedure final RegionStateNode node = regionStates.getRegionNode(regionInfo); if (node != null) node.offline(); @@ -1336,8 +1332,7 @@ public class AssignmentManager implements ServerListener { * @return Pair indicating the status of the alter command (pending/total) * @throws IOException */ - public Pair getReopenStatus(TableName tableName) - throws IOException { + public Pair getReopenStatus(TableName tableName) { if (isTableDisabled(tableName)) return new Pair(0, 0); final List states = regionStates.getTableRegionStates(tableName); @@ -1483,7 +1478,7 @@ public class AssignmentManager implements ServerListener { metrics.incrementOperationCounter(); } - public void undoRegionAsClosing(final RegionStateNode regionNode) throws IOException { + public void undoRegionAsClosing(final RegionStateNode regionNode) { // TODO: Metrics. Do opposite of metrics.incrementOperationCounter(); // There is nothing to undo? }