Search in sources :

Example 1 with CreateTableProcedure

use of org.apache.hadoop.hbase.master.procedure.CreateTableProcedure in project hbase by apache.

the class HMaster method createSystemTable.

@Override
public long createSystemTable(final HTableDescriptor hTableDescriptor) throws IOException {
    if (isStopped()) {
        throw new MasterNotRunningException();
    }
    TableName tableName = hTableDescriptor.getTableName();
    if (!(tableName.isSystemTable())) {
        throw new IllegalArgumentException("Only system table creation can use this createSystemTable API");
    }
    HRegionInfo[] newRegions = ModifyRegionUtils.createHRegionInfos(hTableDescriptor, null);
    LOG.info(getClientIdAuditPrefix() + " create " + hTableDescriptor);
    // This special create table is called locally to master.  Therefore, no RPC means no need
    // to use nonce to detect duplicated RPC call.
    long procId = this.procedureExecutor.submitProcedure(new CreateTableProcedure(procedureExecutor.getEnvironment(), hTableDescriptor, newRegions));
    return procId;
}
Also used : HRegionInfo(org.apache.hadoop.hbase.HRegionInfo) TableName(org.apache.hadoop.hbase.TableName) MasterNotRunningException(org.apache.hadoop.hbase.MasterNotRunningException) CreateTableProcedure(org.apache.hadoop.hbase.master.procedure.CreateTableProcedure)

Aggregations

HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)1 MasterNotRunningException (org.apache.hadoop.hbase.MasterNotRunningException)1 TableName (org.apache.hadoop.hbase.TableName)1 CreateTableProcedure (org.apache.hadoop.hbase.master.procedure.CreateTableProcedure)1