@InterfaceAudience.Private public class CreateTableHandler extends EventHandler
EventHandler.EventHandlerListener
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected MasterFileSystem |
fileSystemManager |
protected HTableDescriptor |
hTableDescriptor |
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)
|
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.
|
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.
|
String |
toString() |
compareTo, getEventType, getInformativeName, getListener, getPriority, getSeqid, handleException, run, setListener
protected final MasterFileSystem fileSystemManager
protected final HTableDescriptor hTableDescriptor
protected final org.apache.hadoop.conf.Configuration conf
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
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.protected List<HRegionInfo> addReplicas(HTableDescriptor hTableDescriptor, List<HRegionInfo> regions)
hTableDescriptor
- regions
- default replicasprotected 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.