HBASE-7689 CloneTableHandler notify completion too early (Matteo Bertozzi)

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-7290@1445864 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2013-02-13 19:12:39 +00:00
parent 0efb9a3603
commit 3b006f510e
2 changed files with 15 additions and 5 deletions

View File

@ -136,16 +136,23 @@ public class CreateTableHandler extends EventHandler {
cpHost.preCreateTableHandler(this.hTableDescriptor, this.newRegions);
}
handleCreateTable(tableName);
completed(null);
if (cpHost != null) {
cpHost.postCreateTableHandler(this.hTableDescriptor, this.newRegions);
}
} catch (IOException e) {
LOG.error("Error trying to create the table " + tableName, e);
} catch (KeeperException e) {
} catch (Throwable e) {
LOG.error("Error trying to create the table " + tableName, e);
completed(e);
}
}
/**
* Called after that process() is completed.
* @param exception null if process() is successful or not null if something has failed.
*/
protected void completed(final Throwable exception) {
}
/**
* Responsible of table creation (on-disk and META) and assignment.
* - Create the table directory and descriptor (temp folder)

View File

@ -116,11 +116,14 @@ public class CloneSnapshotHandler extends CreateTableHandler implements Snapshot
// these handlers aren't futures so we need to register the error here.
this.monitor.receive(new ForeignException(NAME, rse));
throw rse;
} finally {
this.stopped = true;
}
}
@Override
protected void completed(final Throwable exception) {
this.stopped = true;
}
@Override
public boolean isFinished() {
return this.stopped;