protected TableOperation(final HMaster master, final byte [] tableName)
throws IOException {
this.master = master;
if (!this.master.isMasterRunning()) {
throw new MasterNotRunningException();
}
// add the delimiters.
// TODO maybe check if this is necessary?
this.tableName = tableName;
// Don't wait for META table to come on line if we're enabling it
if (!Bytes.equals(HConstants.META_TABLE_NAME, this.tableName)) {
// We can not access any meta region if they have not already been
// assigned and scanned.
if (master.regionManager.metaScannerThread.waitForMetaRegionsOrClose()) {
// We're shutting down. Forget it.
throw new MasterNotRunningException();
}
}
this.metaRegions = master.regionManager.getMetaRegionsForTable(tableName);
}