|
||||||||||
| 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 HBase. An HBase cluster has one active master. If many masters are started, all compete. Whichever wins goes on to run the cluster. All others park themselves in their constructor until master or cluster shutdown or until the active master loses its lease in zookeeper. Thereafter, all running master jostle to take over master role.
HMasterInterface,
HMasterRegionInterface,
Watcher| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher |
|---|
org.apache.zookeeper.Watcher.Event |
| Field Summary | |
|---|---|
static String |
MASTER
|
| 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(org.apache.hadoop.conf.Configuration conf)
Constructor |
|
| Method Summary | |
|---|---|
void |
addColumn(byte[] tableName,
HColumnDescriptor column)
Adds a column to the specified table |
protected HMsg[] |
adornRegionServerAnswer(HServerInfo hsi,
HMsg[] msgs)
Override if you'd add messages to return to regionserver hsi
or to send an exception. |
protected boolean |
checkFileSystem()
Checks to see if the file system is still accessible. |
static HMaster |
constructMaster(Class<? extends HMaster> masterClass,
org.apache.hadoop.conf.Configuration conf)
Utility for constructing an instance of the passed HMaster class. |
protected org.apache.hadoop.io.MapWritable |
createConfigurationSubset()
|
void |
createTable(HTableDescriptor desc,
byte[][] splitKeys)
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) |
double |
getAverageLoad()
|
ClusterStatus |
getClusterStatus()
Return cluster status. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
|
protected Result |
getFromMETA(byte[] row,
byte[] family)
Get row from meta table. |
HServerAddress |
getHServerAddress()
|
InfoServer |
getInfoServer()
|
HServerAddress |
getMasterAddress()
|
MasterMetrics |
getMetrics()
|
int |
getNumRetries()
|
org.apache.hadoop.fs.Path |
getOldLogDir()
Get the directory where old logs go |
long |
getProtocolVersion(String protocol,
long clientVersion)
|
RegionManager |
getRegionManager()
|
RegionServerOperationQueue |
getRegionServerOperationQueue()
|
org.apache.hadoop.fs.Path |
getRootDir()
|
ServerManager |
getServerManager()
|
Map<String,Integer> |
getTableFragmentation()
|
ZooKeeperWrapper |
getZooKeeperWrapper()
Get the ZK wrapper object |
boolean |
isClusterStartup()
Returns true if this master process was responsible for starting the cluster. |
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,
HConstants.Modify op,
org.apache.hadoop.io.Writable[] args)
Modify a table's metadata |
void |
process(org.apache.zookeeper.WatchedEvent event)
|
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 |
resetClusterStartup()
|
void |
run()
Main processing loop |
void |
shutdown()
Shutdown an HBase cluster. |
| 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(org.apache.hadoop.conf.Configuration conf)
throws IOException
conf - configuration
IOException| Method Detail |
|---|
public boolean isClusterStartup()
public void resetClusterStartup()
public HServerAddress getHServerAddress()
protected boolean checkFileSystem()
public HServerAddress getMasterAddress()
public long getProtocolVersion(String protocol,
long clientVersion)
getProtocolVersion in interface org.apache.hadoop.ipc.VersionedProtocolpublic InfoServer getInfoServer()
public org.apache.hadoop.fs.Path getRootDir()
IOExceptionpublic int getNumRetries()
public MasterMetrics getMetrics()
public org.apache.hadoop.conf.Configuration getConfiguration()
public ServerManager getServerManager()
public RegionManager getRegionManager()
public ZooKeeperWrapper getZooKeeperWrapper()
public double getAverageLoad()
public RegionServerOperationQueue getRegionServerOperationQueue()
public org.apache.hadoop.fs.Path getOldLogDir()
public void run()
run in interface Runnablerun in class Thread
public org.apache.hadoop.io.MapWritable regionServerStartup(HServerInfo serverInfo)
throws IOException
HMasterRegionInterface
regionServerStartup in interface HMasterRegionInterfaceserverInfo - server info
IOException - eprotected org.apache.hadoop.io.MapWritable createConfigurationSubset()
public HMsg[] regionServerReport(HServerInfo serverInfo,
HMsg[] msgs,
HRegionInfo[] mostLoadedRegions)
throws IOException
HMasterRegionInterface
regionServerReport in interface HMasterRegionInterfaceserverInfo - 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 - e
protected HMsg[] adornRegionServerAnswer(HServerInfo hsi,
HMsg[] msgs)
throws IOException
hsi
or to send an exception.
msgs - Messages to add to
IOException - exceptions that were injected for the region serverspublic boolean isMasterRunning()
isMasterRunning in interface HMasterInterfacepublic void shutdown()
HMasterInterface
shutdown in interface HMasterInterface
public void createTable(HTableDescriptor desc,
byte[][] splitKeys)
throws IOException
HMasterInterface
createTable in interface HMasterInterfacedesc - table descriptor
IOException
public void deleteTable(byte[] tableName)
throws IOException
HMasterInterface
deleteTable in interface HMasterInterfacetableName - table to delete
IOException - e
public void addColumn(byte[] tableName,
HColumnDescriptor column)
throws IOException
HMasterInterface
addColumn in interface HMasterInterfacetableName - table to modifycolumn - column descriptor
IOException - e
public void modifyColumn(byte[] tableName,
byte[] columnName,
HColumnDescriptor descriptor)
throws IOException
HMasterInterface
modifyColumn in interface HMasterInterfacetableName - table namecolumnName - name of the column to editdescriptor - new column descriptor
IOException - e
public void deleteColumn(byte[] tableName,
byte[] c)
throws IOException
HMasterInterface
deleteColumn in interface HMasterInterfacetableName - table to alterc - column family to remove
IOException - e
public void enableTable(byte[] tableName)
throws IOException
HMasterInterface
enableTable in interface HMasterInterfacetableName - table to enable
IOException - e
public void disableTable(byte[] tableName)
throws IOException
HMasterInterface
disableTable in interface HMasterInterfacetableName - table to take offline
IOException - e
protected Result getFromMETA(byte[] row,
byte[] family)
throws IOException
row - family -
IOException
public void modifyTable(byte[] tableName,
HConstants.Modify op,
org.apache.hadoop.io.Writable[] args)
throws IOException
HMasterInterface
modifyTable in interface HMasterInterfacetableName - table to modifyop - the operation to doargs - arguments for operation
IOException - epublic ClusterStatus getClusterStatus()
HMasterInterface
getClusterStatus in interface HMasterInterface
protected void deleteEmptyMetaRows(HRegionInterface s,
byte[] metaRegionName,
List<byte[]> emptyRows)
public void process(org.apache.zookeeper.WatchedEvent event)
process in interface org.apache.zookeeper.WatcherWatcher.process(org.apache.zookeeper.WatchedEvent)
public static HMaster constructMaster(Class<? extends HMaster> masterClass,
org.apache.hadoop.conf.Configuration conf)
masterClass - conf -
protected static void doMain(String[] args,
Class<? extends HMaster> masterClass)
public Map<String,Integer> getTableFragmentation()
throws IOException
IOExceptionpublic static void main(String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||