@InterfaceAudience.Private public class CreateTableHandler extends EventHandler
EventHandler.EventHandlerListener
Modifier and Type | Field and Description |
---|---|
private User |
activeUser |
private AssignmentManager |
assignmentManager |
protected org.apache.hadoop.conf.Configuration |
conf |
protected MasterFileSystem |
fileSystemManager |
protected HTableDescriptor |
hTableDescriptor |
private static org.apache.commons.logging.Log |
LOG |
private HRegionInfo[] |
newRegions |
private TableLockManager.TableLock |
tableLock |
private TableLockManager |
tableLockManager |
eventType, seqids, server, waitingTimeForEvents
Constructor and Description |
---|
CreateTableHandler(Server server,
MasterFileSystem fileSystemManager,
HTableDescriptor hTableDescriptor,
org.apache.hadoop.conf.Configuration conf,
HRegionInfo[] newRegions,
MasterServices masterServices) |
Modifier and Type | Method and Description |
---|---|
protected void |
addRegionsToMeta(List<HRegionInfo> regionInfos,
int regionReplication)
Add the specified set of regions to the hbase:meta table.
|
protected List<HRegionInfo> |
addReplicas(HTableDescriptor hTableDescriptor,
List<HRegionInfo> regions)
Create any replicas for the regions (the default replicas that was
already created is passed to the method)
|
(package private) static void |
checkAndSetEnablingTable(AssignmentManager assignmentManager,
TableName tableName,
boolean skipTableStateCheck) |
protected void |
completed(Throwable exception)
Called after that process() is completed.
|
protected List<HRegionInfo> |
handleCreateHdfsRegions(org.apache.hadoop.fs.Path tableRootDir,
TableName tableName)
Create the on-disk structure for the table, and returns the regions info.
|
private void |
handleCreateTable(TableName tableName)
Responsible of table creation (on-disk and META) and assignment.
|
CreateTableHandler |
prepare()
Event handlers should do all the necessary checks in this method (rather than
in the constructor, or in process()) so that the caller, which is mostly executed
in the ipc context can fail fast.
|
void |
process()
This method is the main processing loop to be implemented by the various
subclasses.
|
private void |
releaseTableLock() |
(package private) static void |
removeEnablingTable(AssignmentManager assignmentManager,
TableName tableName) |
String |
toString() |
compareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, handleException, run, setListener
private static final org.apache.commons.logging.Log LOG
protected final MasterFileSystem fileSystemManager
protected final HTableDescriptor hTableDescriptor
protected final org.apache.hadoop.conf.Configuration conf
private final AssignmentManager assignmentManager
private final TableLockManager tableLockManager
private final HRegionInfo[] newRegions
private final TableLockManager.TableLock tableLock
private User activeUser
public CreateTableHandler(Server server, MasterFileSystem fileSystemManager, HTableDescriptor hTableDescriptor, org.apache.hadoop.conf.Configuration conf, HRegionInfo[] newRegions, MasterServices masterServices)
public CreateTableHandler prepare() throws NotAllMetaRegionsOnlineException, TableExistsException, IOException
EventHandler
prepare
in class EventHandler
NotAllMetaRegionsOnlineException
TableExistsException
IOException
static void checkAndSetEnablingTable(AssignmentManager assignmentManager, TableName tableName, boolean skipTableStateCheck) throws IOException
IOException
static void removeEnablingTable(AssignmentManager assignmentManager, TableName tableName)
public String toString()
toString
in class EventHandler
public void process()
EventHandler
process
in class EventHandler
protected void completed(Throwable exception)
exception
- null if process() is successful or not null if something has failed.private void handleCreateTable(TableName tableName) throws IOException, CoordinatedStateException
IOException
CoordinatedStateException
protected List<HRegionInfo> addReplicas(HTableDescriptor hTableDescriptor, List<HRegionInfo> regions)
hTableDescriptor
- regions
- default replicasprivate void releaseTableLock()
protected List<HRegionInfo> handleCreateHdfsRegions(org.apache.hadoop.fs.Path tableRootDir, TableName tableName) throws IOException
tableRootDir
- directory where the table is being createdtableName
- name of the table under constructionIOException
protected void addRegionsToMeta(List<HRegionInfo> regionInfos, int regionReplication) throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.