org.apache.hadoop.hbase.master
Interface MasterServices

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

@InterfaceAudience.Private
public interface MasterServices
extends Server

Services Master supplies


Method Summary
 void addColumn(TableName tableName, HColumnDescriptor column)
          Add a new column to an existing table
 void checkTableModifiable(TableName tableName)
          Check table is modifiable; i.e.
 void createNamespace(NamespaceDescriptor descriptor)
          Create a new namespace
 void createTable(HTableDescriptor desc, byte[][] splitKeys)
          Create a table using the given table definition.
 void deleteColumn(TableName tableName, byte[] columnName)
          Delete a column from an existing table
 void deleteNamespace(String name)
          Delete an existing namespace.
 void deleteTable(TableName tableName)
          Delete a table
 void disableTable(TableName tableName)
          Disable an existing table
 void dispatchMergingRegions(HRegionInfo region_a, HRegionInfo region_b, boolean forcible)
          Merge two regions.
 void enableTable(TableName tableName)
          Enable an existing table
 AssignmentManager getAssignmentManager()
           
 MasterCoprocessorHost getCoprocessorHost()
           
 ExecutorService getExecutorService()
           
 MasterFileSystem getMasterFileSystem()
           
 NamespaceDescriptor getNamespaceDescriptor(String name)
          Get a namespace descriptor by name
 ServerManager getServerManager()
           
 TableDescriptors getTableDescriptors()
           
 TableLockManager getTableLockManager()
           
 boolean isInitialized()
           
 boolean isServerShutdownHandlerEnabled()
           
 List<NamespaceDescriptor> listNamespaceDescriptors()
          List available namespace descriptors
 List<HTableDescriptor> listTableDescriptorsByNamespace(String name)
          Get list of table descriptors by namespace
 List<TableName> listTableNamesByNamespace(String name)
          Get list of table names by namespace
 void modifyColumn(TableName tableName, HColumnDescriptor descriptor)
          Modify the column descriptor of an existing column in an existing table
 void modifyNamespace(NamespaceDescriptor descriptor)
          Modify an existing namespace
 void modifyTable(TableName tableName, HTableDescriptor descriptor)
          Modify the descriptor of an existing table
 boolean registerService(com.google.protobuf.Service instance)
          Registers a new protocol buffer Service subclass as a master coprocessor endpoint.
 
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

getTableLockManager

TableLockManager getTableLockManager()
Returns:
Master's instance of TableLockManager

getCoprocessorHost

MasterCoprocessorHost getCoprocessorHost()
Returns:
Master's instance of MasterCoprocessorHost

checkTableModifiable

void checkTableModifiable(TableName tableName)
                          throws IOException,
                                 TableNotFoundException,
                                 TableNotDisabledException
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(TableName tableName)
                 throws IOException
Delete a table

Parameters:
tableName - The table name
Throws:
IOException

modifyTable

void modifyTable(TableName 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(TableName tableName)
                 throws IOException
Enable an existing table

Parameters:
tableName - The table name
Throws:
IOException

disableTable

void disableTable(TableName tableName)
                  throws IOException
Disable an existing table

Parameters:
tableName - The table name
Throws:
IOException

addColumn

void addColumn(TableName 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(TableName 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(TableName 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;

registerService

boolean registerService(com.google.protobuf.Service instance)
Registers a new protocol buffer Service subclass as a master coprocessor endpoint.

Only a single instance may be registered for a given Service subclass (the instances are keyed on Descriptors.ServiceDescriptor.getFullName(). After the first registration, subsequent calls with the same service name will fail with a return value of false.

Parameters:
instance - the Service subclass instance to expose as a coprocessor endpoint
Returns:
true if the registration was successful, false otherwise

dispatchMergingRegions

void dispatchMergingRegions(HRegionInfo region_a,
                            HRegionInfo region_b,
                            boolean forcible)
                            throws IOException
Merge two regions. The real implementation is on the regionserver, master just move the regions together and send MERGE RPC to regionserver

Parameters:
region_a - region to merge
region_b - region to merge
forcible - true if do a compulsory merge, otherwise we will only merge two adjacent regions
Throws:
IOException

isInitialized

boolean isInitialized()
Returns:
true if master is initialized

createNamespace

void createNamespace(NamespaceDescriptor descriptor)
                     throws IOException
Create a new namespace

Parameters:
descriptor - descriptor which describes the new namespace
Throws:
IOException

modifyNamespace

void modifyNamespace(NamespaceDescriptor descriptor)
                     throws IOException
Modify an existing namespace

Parameters:
descriptor - descriptor which updates the existing namespace
Throws:
IOException

deleteNamespace

void deleteNamespace(String name)
                     throws IOException
Delete an existing namespace. Only empty namespaces (no tables) can be removed.

Parameters:
name - namespace name
Throws:
IOException

getNamespaceDescriptor

NamespaceDescriptor getNamespaceDescriptor(String name)
                                           throws IOException
Get a namespace descriptor by name

Parameters:
name - name of namespace descriptor
Returns:
A descriptor
Throws:
IOException

listNamespaceDescriptors

List<NamespaceDescriptor> listNamespaceDescriptors()
                                                   throws IOException
List available namespace descriptors

Returns:
A descriptor
Throws:
IOException

listTableDescriptorsByNamespace

List<HTableDescriptor> listTableDescriptorsByNamespace(String name)
                                                       throws IOException
Get list of table descriptors by namespace

Parameters:
name - namespace name
Returns:
descriptors
Throws:
IOException

listTableNamesByNamespace

List<TableName> listTableNamesByNamespace(String name)
                                          throws IOException
Get list of table names by namespace

Parameters:
name - namespace name
Returns:
table names
Throws:
IOException


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