org.apache.hadoop.hbase
Class HMaster

java.lang.Object
  extended by org.apache.hadoop.hbase.HMaster
All Implemented Interfaces:
Runnable, HConstants, HMasterInterface, HMasterRegionInterface, VersionedProtocol

public class HMaster
extends Object
implements HConstants, HMasterInterface, HMasterRegionInterface, Runnable

HMaster is the "master server" for a HBase. There is only one HMaster for a single HBase deployment.


Field Summary
 
Fields inherited from interface org.apache.hadoop.hbase.HConstants
COL_REGIONINFO, COL_SERVER, COL_STARTCODE, COLUMN_FAMILY, COLUMN_FAMILY_ARRAY, COMPLETE_CACHEFLUSH, DEFAULT_HBASE_DIR, DEFAULT_HOST, DEFAULT_MASTER_ADDRESS, DEFAULT_MAX_FILE_SIZE, DEFAULT_REGION_SERVER_CLASS, DEFAULT_REGIONSERVER_ADDRESS, DELETE_BYTES, HBASE_DIR, HREGION_LOGDIR_NAME, HREGION_OLDLOGFILE_NAME, HREGIONDIR_PREFIX, MASTER_ADDRESS, META_TABLE_NAME, REGION_SERVER_CLASS, REGIONSERVER_ADDRESS, ROOT_TABLE_NAME, THREAD_WAKE_FREQUENCY, UTF8_ENCODING
 
Fields inherited from interface org.apache.hadoop.hbase.HMasterInterface
versionID
 
Fields inherited from interface org.apache.hadoop.hbase.HMasterRegionInterface
versionID
 
Constructor Summary
HMaster(Configuration conf)
          Build the HMaster out of a raw configuration item.
HMaster(Path dir, HServerAddress address, Configuration conf)
          Build the HMaster
 
Method Summary
 void addColumn(Text tableName, HColumnDescriptor column)
          
 void createTable(HTableDescriptor desc)
          
 void deleteColumn(Text tableName, Text columnName)
          
 void deleteTable(Text tableName)
          
 void disableTable(Text tableName)
          
 void enableTable(Text tableName)
          
 HServerAddress findRootRegion()
          
 HServerAddress getMasterAddress()
           
 long getProtocolVersion(String protocol, long clientVersion)
          Return protocol version corresponding to protocol interface.
 boolean isMasterRunning()
          
static void main(String[] args)
          Main program
 HMsg[] regionServerReport(HServerInfo serverInfo, HMsg[] msgs)
          
 void regionServerStartup(HServerInfo serverInfo)
          
 void run()
          Main processing loop
 void shutdown()
          Shutdown an HBase cluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HMaster

public HMaster(Configuration conf)
        throws IOException
Build the HMaster out of a raw configuration item.

Parameters:
conf - - Configuration object
Throws:
IOException

HMaster

public HMaster(Path dir,
               HServerAddress address,
               Configuration conf)
        throws IOException
Build the HMaster

Parameters:
dir - - base directory
address - - server address and port number
conf - - configuration
Throws:
IOException
Method Detail

getProtocolVersion

public long getProtocolVersion(String protocol,
                               long clientVersion)
                        throws IOException
Return protocol version corresponding to protocol interface.

Specified by:
getProtocolVersion in interface VersionedProtocol
Parameters:
protocol - The classname of the protocol interface
clientVersion - The version of the protocol that the client speaks
Returns:
the version that the server will speak
Throws:
IOException

getMasterAddress

public HServerAddress getMasterAddress()
Returns:
HServerAddress of the master server

run

public void run()
Main processing loop

Specified by:
run in interface Runnable

regionServerStartup

public void regionServerStartup(HServerInfo serverInfo)
                         throws IOException

Specified by:
regionServerStartup in interface HMasterRegionInterface
Throws:
IOException

regionServerReport

public HMsg[] regionServerReport(HServerInfo serverInfo,
                                 HMsg[] msgs)
                          throws IOException

Specified by:
regionServerReport in interface HMasterRegionInterface
Throws:
IOException

isMasterRunning

public boolean isMasterRunning()

Specified by:
isMasterRunning in interface HMasterInterface

shutdown

public void shutdown()
Shutdown an HBase cluster.

Specified by:
shutdown in interface HMasterInterface

createTable

public void createTable(HTableDescriptor desc)
                 throws IOException

Specified by:
createTable in interface HMasterInterface
Throws:
IOException

deleteTable

public void deleteTable(Text tableName)
                 throws IOException

Specified by:
deleteTable in interface HMasterInterface
Throws:
IOException

addColumn

public void addColumn(Text tableName,
                      HColumnDescriptor column)
               throws IOException

Specified by:
addColumn in interface HMasterInterface
Throws:
IOException

deleteColumn

public void deleteColumn(Text tableName,
                         Text columnName)
                  throws IOException

Specified by:
deleteColumn in interface HMasterInterface
Throws:
IOException

enableTable

public void enableTable(Text tableName)
                 throws IOException

Specified by:
enableTable in interface HMasterInterface
Throws:
IOException

disableTable

public void disableTable(Text tableName)
                  throws IOException

Specified by:
disableTable in interface HMasterInterface
Throws:
IOException

findRootRegion

public HServerAddress findRootRegion()

Specified by:
findRootRegion in interface HMasterInterface

main

public static void main(String[] args)
Main program

Parameters:
args -


Copyright © 2006 The Apache Software Foundation