|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.master.RegionStates
@InterfaceAudience.Private public class RegionStates
Region state accountant. It holds the states of all regions in the memory. In normal scenario, it should match the meta table and the true region states. This map is used by AssignmentManager to track region states.
Method Summary | |
---|---|
RegionState |
createRegionState(HRegionInfo hri)
Add a region to RegionStates. |
void |
createRegionStates(List<HRegionInfo> hris)
Add a list of regions to RegionStates. |
protected Map<String,Map<ServerName,List<HRegionInfo>>> |
getAssignmentsByTable()
This is an EXPENSIVE clone. |
protected double |
getAverageLoad()
Compute the average load across all region servers. |
Map<HRegionInfo,ServerName> |
getRegionAssignments()
|
protected HRegionInfo |
getRegionInfo(byte[] regionName)
Get the HRegionInfo from cache, if not there, from the META table |
ServerName |
getRegionServerOfRegion(HRegionInfo hri)
|
Map<String,RegionState> |
getRegionsInTransition()
Get regions in transition and their states |
List<HRegionInfo> |
getRegionsOfTable(byte[] tableName)
Gets the online regions of the specified table. |
protected RegionState |
getRegionState(HRegionInfo hri)
|
protected RegionState |
getRegionState(String regionName)
|
RegionState |
getRegionTransitionState(HRegionInfo hri)
Get region transition state |
RegionState |
getRegionTransitionState(String regionName)
Get region transition state |
boolean |
isRegionAssigned(HRegionInfo hri)
|
boolean |
isRegionFailedToClose(HRegionInfo hri)
|
boolean |
isRegionFailedToOpen(HRegionInfo hri)
|
boolean |
isRegionInTransition(HRegionInfo hri)
|
boolean |
isRegionInTransition(String regionName)
|
boolean |
isRegionsInTransition()
|
void |
regionOffline(HRegionInfo hri)
A region is offline, won't be in transition any more. |
void |
regionOnline(HRegionInfo hri,
ServerName serverName)
A region is online, won't be in transition any more. |
List<HRegionInfo> |
serverOffline(ServerName sn)
A server is offline, all regions on it are dead. |
RegionState |
updateRegionState(HRegionInfo hri,
RegionState.State state)
Update a region state. |
RegionState |
updateRegionState(HRegionInfo hri,
RegionState.State state,
ServerName serverName)
Update a region state. |
RegionState |
updateRegionState(RegionTransition transition,
RegionState.State state)
Update a region state. |
void |
waitForAssignment(HRegionInfo hri)
Waits until the specified region has completed assignment. |
void |
waitForUpdate(long timeout)
Wait for the state map to be updated by assignment manager. |
void |
waitOnRegionToClearRegionsInTransition(HRegionInfo hri)
Wait on region to clear regions-in-transition. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Map<HRegionInfo,ServerName> getRegionAssignments()
public ServerName getRegionServerOfRegion(HRegionInfo hri)
public Map<String,RegionState> getRegionsInTransition()
public boolean isRegionInTransition(HRegionInfo hri)
public boolean isRegionInTransition(String regionName)
public boolean isRegionsInTransition()
public boolean isRegionAssigned(HRegionInfo hri)
public boolean isRegionFailedToOpen(HRegionInfo hri)
public boolean isRegionFailedToClose(HRegionInfo hri)
public void waitForUpdate(long timeout) throws InterruptedException
InterruptedException
public RegionState getRegionTransitionState(HRegionInfo hri)
public RegionState getRegionTransitionState(String regionName)
public void createRegionStates(List<HRegionInfo> hris)
public RegionState createRegionState(HRegionInfo hri)
public RegionState updateRegionState(HRegionInfo hri, RegionState.State state)
public RegionState updateRegionState(RegionTransition transition, RegionState.State state)
public RegionState updateRegionState(HRegionInfo hri, RegionState.State state, ServerName serverName)
public void regionOnline(HRegionInfo hri, ServerName serverName)
public void regionOffline(HRegionInfo hri)
public List<HRegionInfo> serverOffline(ServerName sn)
public List<HRegionInfo> getRegionsOfTable(byte[] tableName)
.META.
.
Only returns online regions. If a region on this table has been
closed during a disable, etc., it will be included in the returned list.
So, the returned list may not necessarily be ALL regions in this table, its
all the ONLINE regions in the table.
tableName
-
tableName
public void waitOnRegionToClearRegionsInTransition(HRegionInfo hri) throws InterruptedException
If the region isn't in transition, returns immediately. Otherwise, method blocks until the region is out of transition.
InterruptedException
public void waitForAssignment(HRegionInfo hri) throws InterruptedException
If the region is already assigned, returns immediately. Otherwise, method blocks until the region is assigned.
InterruptedException
protected double getAverageLoad()
protected Map<String,Map<ServerName,List<HRegionInfo>>> getAssignmentsByTable()
protected RegionState getRegionState(HRegionInfo hri)
protected RegionState getRegionState(String regionName)
protected HRegionInfo getRegionInfo(byte[] regionName)
regionName
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |