HBASE-5588 Deprecate/remove AssignmentManager#clearRegionFromTransition

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1301885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2012-03-17 07:34:22 +00:00
parent fda76c71cb
commit 37da60f92f
2 changed files with 5 additions and 22 deletions

View File

@ -149,7 +149,7 @@ public class AssignmentManager extends ZooKeeperListener {
* Server to regions assignment map.
* Contains the set of regions currently assigned to a given server.
* This Map and {@link #regions} are tied. Always update this in tandem
* with the other under a lock on {@link #regions}
* with the other under a lock on {@link #regions}.
* @see #regions
*/
private final NavigableMap<ServerName, Set<HRegionInfo>> servers =
@ -159,7 +159,7 @@ public class AssignmentManager extends ZooKeeperListener {
* Region to server assignment map.
* Contains the server a given region is currently assigned to.
* This Map and {@link #servers} are tied. Always update this in tandem
* with the other under a lock on {@link #regions}
* with the other under a lock on {@link #regions}.
* @see #servers
*/
private final SortedMap<HRegionInfo, ServerName> regions =
@ -1119,7 +1119,7 @@ public class AssignmentManager extends ZooKeeperListener {
if (rs.isSplitting() || rs.isSplit()) {
LOG.debug("Ephemeral node deleted, regionserver crashed?, " +
"clearing from RIT; rs=" + rs);
clearRegionFromTransition(rs.getRegion());
regionOffline(rs.getRegion());
} else {
LOG.debug("The znode of region " + regionInfo.getRegionNameAsString()
+ " has been deleted.");
@ -2720,23 +2720,6 @@ public class AssignmentManager extends ZooKeeperListener {
}
}
/**
* Clears the specified region from being in transition.
* @param hri Region to remove.
*/
public void clearRegionFromTransition(HRegionInfo hri) {
synchronized (this.regionsInTransition) {
this.regionsInTransition.remove(hri.getEncodedName());
}
synchronized (this.regions) {
this.regions.remove(hri);
for (Set<HRegionInfo> regions : this.servers.values()) {
regions.remove(hri);
}
}
clearRegionPlan(hri);
}
/**
* @param region Region whose plan we are to clear.
*/

View File

@ -1420,7 +1420,7 @@ Server {
public void clearFromTransition(HRegionInfo hri) {
if (this.assignmentManager.isRegionInTransition(hri) != null) {
this.assignmentManager.clearRegionFromTransition(hri);
this.assignmentManager.regionOffline(hri);
}
}
@ -1767,7 +1767,7 @@ Server {
}
}
if (force) {
this.assignmentManager.clearRegionFromTransition(hri);
this.assignmentManager.regionOffline(hri);
assignRegion(hri);
} else {
this.assignmentManager.unassign(hri, force);