diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java index b49b5c20f33..31df068e436 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java @@ -2085,13 +2085,8 @@ Server { LOG.warn("assignRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME + " actual: " + type); } - RegionStates regionStates = assignmentManager.getRegionStates(); - HRegionInfo regionInfo = regionStates.getRegionInfo(regionName); + HRegionInfo regionInfo = assignmentManager.getRegionStates().getRegionInfo(regionName); if (regionInfo == null) throw new UnknownRegionException(Bytes.toString(regionName)); - RegionState regionState = regionStates.getRegionState(regionInfo); - if (regionState != null && !regionState.isOffline()) { - throw new IOException("Region " + regionInfo + " is not offline"); - } if (cpHost != null) { if (cpHost.preAssign(regionInfo)) { return arr; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java index 7f382fd552d..7eff4129cd2 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/RegionStates.java @@ -132,13 +132,6 @@ public class RegionStates { return regionAssignments.containsKey(hri); } - /** - * @return the server the specified region assigned to; null if not assigned. - */ - public synchronized ServerName getAssignedServer(final HRegionInfo hri) { - return regionAssignments.get(hri); - } - /** * Wait for the state map to be updated by assignment manager. */ @@ -526,11 +519,7 @@ public class RegionStates { try { Pair p = MetaReader.getRegion(server.getCatalogTracker(), regionName); - HRegionInfo hri = p == null ? null : p.getFirst(); - if (hri != null) { - createRegionState(hri); - } - return hri; + return p == null ? null : p.getFirst(); } catch (IOException e) { server.abort("Aborting because error occoured while reading " + Bytes.toStringBinary(regionName) + " from .META.", e); diff --git a/hbase-server/src/main/ruby/shell/commands/assign.rb b/hbase-server/src/main/ruby/shell/commands/assign.rb index 7dc470811b4..4c83d3cf200 100644 --- a/hbase-server/src/main/ruby/shell/commands/assign.rb +++ b/hbase-server/src/main/ruby/shell/commands/assign.rb @@ -24,7 +24,8 @@ module Shell def help return <<-EOF Assign a region.Use with caution.If region already assigned, -this command will throw an exception. For experts only. +this command will just go ahead and reassign +the region anyways. For experts only. EOF end