|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.apache.hadoop.hbase.master.HMaster
public class HMaster
HMaster is the "master server" for a HBase. There is only one HMaster for a single HBase deployment. NOTE: This class extends Thread rather than Chore because the sleep time can be interrupted when there is something to do, rather than the Chore sleep time which is invariant.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
static String |
MASTER
Name of master server |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Fields inherited from interface org.apache.hadoop.hbase.ipc.HBaseRPCProtocolVersion |
---|
versionID |
Constructor Summary | |
---|---|
HMaster(HBaseConfiguration conf)
Build the HMaster out of a raw configuration item. |
|
HMaster(org.apache.hadoop.fs.Path rd,
HServerAddress address,
HBaseConfiguration conf)
Build the HMaster |
Method Summary | |
---|---|
void |
addColumn(byte[] tableName,
HColumnDescriptor column)
Adds a column to the specified table |
protected boolean |
checkFileSystem()
Checks to see if the file system is still accessible. |
protected org.apache.hadoop.io.MapWritable |
createConfigurationSubset()
|
void |
createTable(HTableDescriptor desc)
Creates a new table |
void |
deleteColumn(byte[] tableName,
byte[] c)
Deletes a column from the specified table |
protected void |
deleteEmptyMetaRows(HRegionInterface s,
byte[] metaRegionName,
List<byte[]> emptyRows)
|
void |
deleteTable(byte[] tableName)
Deletes a table |
void |
disableTable(byte[] tableName)
Take table offline |
protected static void |
doMain(String[] args,
Class<? extends HMaster> masterClass)
|
void |
enableTable(byte[] tableName)
Puts the table on-line (only needed if table has been previously taken offline) |
HServerAddress |
findRootRegion()
Get the location of the root region |
double |
getAverageLoad()
|
HBaseConfiguration |
getConfiguration()
|
protected RowResult |
getFromMETA(byte[] row,
byte[][] columns)
Get row from meta table. |
InfoServer |
getInfoServer()
|
HServerAddress |
getMasterAddress()
|
MasterMetrics |
getMetrics()
|
Map<byte[],MetaRegion> |
getOnlineMetaRegions()
|
long |
getProtocolVersion(String protocol,
long clientVersion)
|
org.apache.hadoop.fs.Path |
getRootDir()
|
HServerAddress |
getRootRegionLocation()
|
Map<String,HServerLoad> |
getServersToLoad()
|
Map<String,HServerInfo> |
getServersToServerInfo()
|
boolean |
isMasterRunning()
|
static void |
main(String[] args)
Main program |
void |
modifyColumn(byte[] tableName,
byte[] columnName,
HColumnDescriptor descriptor)
Modifies an existing column on the specified table |
void |
modifyTable(byte[] tableName,
int op,
org.apache.hadoop.io.Writable[] args)
Modify a table's metadata |
HMsg[] |
regionServerReport(HServerInfo serverInfo,
HMsg[] msgs,
HRegionInfo[] mostLoadedRegions)
Called to renew lease, tell master what the region server is doing and to receive new instructions from the master |
org.apache.hadoop.io.MapWritable |
regionServerStartup(HServerInfo serverInfo)
Called when a region server first starts |
void |
run()
Main processing loop |
void |
shutdown()
Shutdown an HBase cluster. |
void |
waitForRootRegionLocation()
Wait until root region is available |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MASTER
Constructor Detail |
---|
public HMaster(HBaseConfiguration conf) throws IOException
conf
- - Configuration object
IOException
public HMaster(org.apache.hadoop.fs.Path rd, HServerAddress address, HBaseConfiguration conf) throws IOException
rd
- base directory of this HBase instance. Must be fully
qualified so includes filesystem to use.address
- server address and port numberconf
- configuration
IOException
Method Detail |
---|
public long getProtocolVersion(String protocol, long clientVersion)
getProtocolVersion
in interface org.apache.hadoop.ipc.VersionedProtocol
public InfoServer getInfoServer()
protected boolean checkFileSystem()
public HServerAddress getMasterAddress()
public org.apache.hadoop.fs.Path getRootDir()
public Map<String,HServerInfo> getServersToServerInfo()
public Map<String,HServerLoad> getServersToLoad()
public double getAverageLoad()
public HServerAddress getRootRegionLocation()
getRootRegionLocation
in interface HMasterRegionInterface
-ROOT-
region.public void waitForRootRegionLocation()
public Map<byte[],MetaRegion> getOnlineMetaRegions()
public void run()
run
in interface Runnable
run
in class Thread
public org.apache.hadoop.io.MapWritable regionServerStartup(HServerInfo serverInfo)
HMasterRegionInterface
regionServerStartup
in interface HMasterRegionInterface
protected org.apache.hadoop.io.MapWritable createConfigurationSubset()
public HMsg[] regionServerReport(HServerInfo serverInfo, HMsg[] msgs, HRegionInfo[] mostLoadedRegions) throws IOException
HMasterRegionInterface
regionServerReport
in interface HMasterRegionInterface
serverInfo
- server's address and start codemsgs
- things the region server wants to tell the mastermostLoadedRegions
- Array of HRegionInfos that should contain the
reporting server's most loaded regions. These are candidates for being
rebalanced.
IOException
public boolean isMasterRunning()
isMasterRunning
in interface HMasterInterface
public void shutdown()
HMasterInterface
shutdown
in interface HMasterInterface
public void createTable(HTableDescriptor desc) throws IOException
HMasterInterface
createTable
in interface HMasterInterface
desc
- table descriptor
IOException
public void deleteTable(byte[] tableName) throws IOException
HMasterInterface
deleteTable
in interface HMasterInterface
IOException
public void addColumn(byte[] tableName, HColumnDescriptor column) throws IOException
HMasterInterface
addColumn
in interface HMasterInterface
column
- column descriptor
IOException
public void modifyColumn(byte[] tableName, byte[] columnName, HColumnDescriptor descriptor) throws IOException
HMasterInterface
modifyColumn
in interface HMasterInterface
columnName
- name of the column to editdescriptor
- new column descriptor
IOException
public void deleteColumn(byte[] tableName, byte[] c) throws IOException
HMasterInterface
deleteColumn
in interface HMasterInterface
IOException
public void enableTable(byte[] tableName) throws IOException
HMasterInterface
enableTable
in interface HMasterInterface
IOException
public void disableTable(byte[] tableName) throws IOException
HMasterInterface
disableTable
in interface HMasterInterface
IOException
protected RowResult getFromMETA(byte[] row, byte[][] columns) throws IOException
row
- columns
-
IOException
public void modifyTable(byte[] tableName, int op, org.apache.hadoop.io.Writable[] args) throws IOException
HMasterInterface
modifyTable
in interface HMasterInterface
IOException
public HServerAddress findRootRegion()
HMasterInterface
findRootRegion
in interface HMasterInterface
public MasterMetrics getMetrics()
public HBaseConfiguration getConfiguration()
protected void deleteEmptyMetaRows(HRegionInterface s, byte[] metaRegionName, List<byte[]> emptyRows)
protected static void doMain(String[] args, Class<? extends HMaster> masterClass)
public static void main(String[] args)
args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |