|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.master.RegionManager
public class RegionManager
Class to manage assigning regions to servers, state of root and meta, etc.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
LOG
|
Method Summary | |
---|---|
void |
addMetaRegionToScan(MetaRegion m)
Add a meta region to the scan queue |
void |
applyActions(HServerInfo serverInfo,
ArrayList<HMsg> returnMsgs)
Send messages to the given region server asking it to split any regions in 'regionsToSplit', etc. |
boolean |
areAllMetaRegionsOnline()
Block until meta regions are online or we're shutting down. |
int |
countRegionsOnFS()
|
void |
createRegion(HRegionInfo newRegion,
HRegionInterface server,
byte[] metaRegionName)
Create a new HRegion, put a row for it into META (or ROOT), and mark the new region unassigned so that it will get assigned to a region server. |
void |
endAction(byte[] regionName,
HConstants.Modify op)
|
void |
endActions(byte[] regionName)
|
MetaRegion |
getFirstMetaRegionForRegion(HRegionInfo newRegion)
Search our map of online meta regions to find the first meta region that should contain a pointer to newRegion. |
List<MetaRegion> |
getListOfOnlineMetaRegions()
Get a list of online MetaRegions |
Set<HRegionInfo> |
getMarkedToClose(String serverName)
Remove the map of region names to region infos waiting to be offlined for a given server |
MetaRegion |
getMetaRegionForRow(byte[] row)
Get metaregion that would host passed in row. |
Set<MetaRegion> |
getMetaRegionsForTable(byte[] tableName)
Get a set of all the meta regions that contain info about a given table. |
HRegionInfo |
getMetaServerRegionInfo(String server)
Is this server assigned to transition a META table. |
Map<byte[],MetaRegion> |
getOnlineMetaRegions()
|
HServerAddress |
getRootRegionLocation()
Get the root region location. |
void |
incrementNumMetaRegions()
Bump the count of meta regions up one |
boolean |
isInitialMetaScanComplete()
Check if the initial meta scan has been completed. |
boolean |
isInitialRootScanComplete()
Check if the initial root scan has been completed. |
boolean |
isMetaRegionOnline(byte[] startKey)
Check if a meta region is online by its name |
boolean |
isMetaServer(HServerAddress server)
Does this server have any META regions open on it, or any meta regions being assigned to it? |
boolean |
isOfflined(String regionName)
|
boolean |
isPendingOpen(String regionName)
Check if a region has been assigned and we're waiting for a response from the region server. |
boolean |
isRootInTransitionOnThisServer(String server)
Is this server assigned to transition the ROOT table. |
boolean |
isRootServer(HServerAddress server)
|
boolean |
isUnassigned(HRegionInfo info)
Check if a region is on the unassigned list |
List<byte[]> |
listMetaRegionsForServer(HServerAddress server)
Returns the list of byte[] start-keys for any .META. |
boolean |
metaRegionsInTransition()
|
int |
numMetaRegions()
Return the number of meta regions. |
int |
numOnlineMetaRegions()
Count of online meta regions |
MetaRegion |
offlineMetaRegionWithStartKey(byte[] startKey)
Set an online MetaRegion offline - remove it from the map. |
boolean |
offlineMetaServer(HServerAddress server)
Call to take this metaserver offline for immediate reassignment. |
void |
putMetaRegionOnline(MetaRegion metaRegion)
Set a MetaRegion as online. |
boolean |
regionIsInTransition(String regionName)
|
boolean |
regionIsOpening(String regionName)
|
void |
removeRegion(HRegionInfo info)
Remove a region from the region state map. |
void |
setClosed(String regionName)
|
void |
setClosing(String serverName,
HRegionInfo regionInfo,
boolean setOffline)
Mark a region as closing |
void |
setNumMetaRegions(int num)
Set the number of meta regions. |
void |
setOpen(String regionName)
Region has been assigned to a server and the server has told us it is open |
void |
setPendingClose(String regionName)
Called when we have told a region server to close the region |
void |
setRootRegionLocation(HServerAddress address)
Set the root region location. |
void |
setUnassigned(HRegionInfo info,
boolean force)
Set a region to unassigned |
void |
startAction(byte[] regionName,
HRegionInfo info,
HServerAddress server,
HConstants.Modify op)
|
void |
stop()
Stop the region assigner |
void |
stopScanners()
Stop the root and meta scanners so that the region servers serving meta regions can shut down. |
void |
waitForRootRegionLocation()
Block until either the root region location is available or we're shutting down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
Method Detail |
---|
public int countRegionsOnFS() throws IOException
IOException
public Map<byte[],MetaRegion> getOnlineMetaRegions()
public boolean metaRegionsInTransition()
public void stopScanners()
public void stop()
public boolean areAllMetaRegionsOnline()
public MetaRegion getFirstMetaRegionForRegion(HRegionInfo newRegion)
newRegion
-
public Set<MetaRegion> getMetaRegionsForTable(byte[] tableName) throws NotAllMetaRegionsOnlineException
tableName
- Table you need to know all the meta regions for
NotAllMetaRegionsOnlineException
public MetaRegion getMetaRegionForRow(byte[] row) throws NotAllMetaRegionsOnlineException
row
- Row need to know all the meta regions for
NotAllMetaRegionsOnlineException
public void createRegion(HRegionInfo newRegion, HRegionInterface server, byte[] metaRegionName) throws IOException
newRegion
- HRegionInfo for the region to createserver
- server hosting the META (or ROOT) region where the new
region needs to be notedmetaRegionName
- name of the meta region where new region is to be
written
IOException
public void putMetaRegionOnline(MetaRegion metaRegion)
metaRegion
- public List<MetaRegion> getListOfOnlineMetaRegions()
public int numOnlineMetaRegions()
public boolean isMetaRegionOnline(byte[] startKey)
startKey
- name of the meta region to check
public MetaRegion offlineMetaRegionWithStartKey(byte[] startKey)
startKey
- Startkey to use finding region to remove.
public boolean isRootServer(HServerAddress server)
public List<byte[]> listMetaRegionsForServer(HServerAddress server)
server
- server address
public boolean isMetaServer(HServerAddress server)
server
- Server IP:port
public boolean isRootInTransitionOnThisServer(String server)
server
- Server
public HRegionInfo getMetaServerRegionInfo(String server)
server
- Server
public boolean offlineMetaServer(HServerAddress server)
server
- the server that went down
public void removeRegion(HRegionInfo info)
info
- public boolean regionIsInTransition(String regionName)
regionName
-
public boolean regionIsOpening(String regionName)
regionName
-
public void setUnassigned(HRegionInfo info, boolean force)
info
- Region to set unassignedforce
- if true mark region unassigned whatever its current statepublic boolean isUnassigned(HRegionInfo info)
info
- HRegionInfo to check for
public boolean isPendingOpen(String regionName)
regionName
- name of the region
public void setOpen(String regionName)
regionName
- public boolean isOfflined(String regionName)
regionName
-
public void setClosing(String serverName, HRegionInfo regionInfo, boolean setOffline)
serverName
- regionInfo
- setOffline
- public Set<HRegionInfo> getMarkedToClose(String serverName)
serverName
-
public void setPendingClose(String regionName)
regionName
- public void setClosed(String regionName)
regionName
- public void addMetaRegionToScan(MetaRegion m)
m
- MetaRegion that needs to get scannedpublic boolean isInitialRootScanComplete()
public boolean isInitialMetaScanComplete()
public HServerAddress getRootRegionLocation()
public void waitForRootRegionLocation()
public int numMetaRegions()
public void incrementNumMetaRegions()
public void setRootRegionLocation(HServerAddress address)
address
- Address of the region server where the root livespublic void setNumMetaRegions(int num)
num
- Number of meta regionspublic void startAction(byte[] regionName, HRegionInfo info, HServerAddress server, HConstants.Modify op)
regionName
- info
- server
- op
- public void endAction(byte[] regionName, HConstants.Modify op)
regionName
- op
- public void endActions(byte[] regionName)
regionName
- public void applyActions(HServerInfo serverInfo, ArrayList<HMsg> returnMsgs)
serverInfo
- returnMsgs
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |