org.apache.hadoop.hbase.master
Interface MasterServices

All Superinterfaces:
Abortable, Server, Stoppable
All Known Implementing Classes:
HMaster, HMasterCommandLine.LocalHMaster

public interface MasterServices
extends Server

Services Master supplies


Method Summary
 void addColumn(byte[] tableName, HColumnDescriptor column)
          Add a new column to an existing table
 void checkTableModifiable(byte[] tableName)
          Check table is modifiable; i.e.
 void createTable(HTableDescriptor desc, byte[][] splitKeys)
          Create a table using the given table definition.
 void deleteColumn(byte[] tableName, byte[] columnName)
          Delete a column from an existing table
 void deleteTable(byte[] tableName)
          Delete a table
 void disableTable(byte[] tableName)
          Disable an existing table
 void enableTable(byte[] tableName)
          Enable an existing table
 AssignmentManager getAssignmentManager()
           
 MasterCoprocessorHost getCoprocessorHost()
           
 ExecutorService getExecutorService()
           
 MasterFileSystem getMasterFileSystem()
           
 ServerManager getServerManager()
           
 TableDescriptors getTableDescriptors()
           
 boolean isServerShutdownHandlerEnabled()
           
 void modifyColumn(byte[] tableName, HColumnDescriptor descriptor)
          Modify the column descriptor of an existing column in an existing table
 void modifyTable(byte[] tableName, HTableDescriptor descriptor)
          Modify the descriptor of an existing table
<T extends CoprocessorProtocol>
boolean
registerProtocol(Class<T> protocol, T handler)
          Registers a new CoprocessorProtocol subclass and instance to be available for handling HMaster.execCoprocessor(org.apache.hadoop.hbase.client.coprocessor.Exec) calls.
 
Methods inherited from interface org.apache.hadoop.hbase.Server
getCatalogTracker, getConfiguration, getServerName, getZooKeeper
 
Methods inherited from interface org.apache.hadoop.hbase.Abortable
abort, isAborted
 
Methods inherited from interface org.apache.hadoop.hbase.Stoppable
isStopped, stop
 

Method Detail

getAssignmentManager

AssignmentManager getAssignmentManager()
Returns:
Master's instance of the AssignmentManager

getMasterFileSystem

MasterFileSystem getMasterFileSystem()
Returns:
Master's filesystem MasterFileSystem utility class.

getServerManager

ServerManager getServerManager()
Returns:
Master's ServerManager instance.

getExecutorService

ExecutorService getExecutorService()
Returns:
Master's instance of ExecutorService

checkTableModifiable

void checkTableModifiable(byte[] tableName)
                          throws IOException
Check table is modifiable; i.e. exists and is offline.

Parameters:
tableName - Name of table to check.
Throws:
TableNotDisabledException
TableNotFoundException
IOException

createTable

void createTable(HTableDescriptor desc,
                 byte[][] splitKeys)
                 throws IOException
Create a table using the given table definition.

Parameters:
desc - The table definition
splitKeys - Starting row keys for the initial table regions. If null a single region is created.
Throws:
IOException

deleteTable

void deleteTable(byte[] tableName)
                 throws IOException
Delete a table

Parameters:
tableName - The table name
Throws:
IOException

modifyTable

void modifyTable(byte[] tableName,
                 HTableDescriptor descriptor)
                 throws IOException
Modify the descriptor of an existing table

Parameters:
tableName - The table name
descriptor - The updated table descriptor
Throws:
IOException

enableTable

void enableTable(byte[] tableName)
                 throws IOException
Enable an existing table

Parameters:
tableName - The table name
Throws:
IOException

disableTable

void disableTable(byte[] tableName)
                  throws IOException
Disable an existing table

Parameters:
tableName - The table name
Throws:
IOException

addColumn

void addColumn(byte[] tableName,
               HColumnDescriptor column)
               throws IOException
Add a new column to an existing table

Parameters:
tableName - The table name
column - The column definition
Throws:
IOException

modifyColumn

void modifyColumn(byte[] tableName,
                  HColumnDescriptor descriptor)
                  throws IOException
Modify the column descriptor of an existing column in an existing table

Parameters:
tableName - The table name
descriptor - The updated column definition
Throws:
IOException

deleteColumn

void deleteColumn(byte[] tableName,
                  byte[] columnName)
                  throws IOException
Delete a column from an existing table

Parameters:
tableName - The table name
columnName - The column name
Throws:
IOException

getTableDescriptors

TableDescriptors getTableDescriptors()
Returns:
Return table descriptors implementation.

isServerShutdownHandlerEnabled

boolean isServerShutdownHandlerEnabled()
Returns:
true if master enables ServerShutdownHandler;

getCoprocessorHost

MasterCoprocessorHost getCoprocessorHost()
Returns:
returns the master coprocessor host

registerProtocol

<T extends CoprocessorProtocol> boolean registerProtocol(Class<T> protocol,
                                                         T handler)
Registers a new CoprocessorProtocol subclass and instance to be available for handling HMaster.execCoprocessor(org.apache.hadoop.hbase.client.coprocessor.Exec) calls.

Only a single protocol type/handler combination may be registered. After the first registration, subsequent calls with the same protocol type will fail with a return value of false.

Type Parameters:
T - the protocol type
Parameters:
protocol - a CoprocessorProtocol subinterface defining the protocol methods
handler - an instance implementing the interface
Returns:
true if the registration was successful, false otherwise


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.