예제 #1
0
 @Override
 public long isReady(long tid, Master environment) throws Exception {
   try {
     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
     return Utils.reserveNamespace(namespaceId, tid, false, false, TableOperation.DELETE)
         + Utils.reserveTable(tableId, tid, true, true, TableOperation.DELETE);
   } catch (IllegalArgumentException ex) {
     if (ex.getCause() != null && ex.getCause() instanceof TableNotFoundException) {
       return 0;
     }
     throw ex;
   }
 }
예제 #2
0
 @Override
 public Repo<Master> call(long tid, Master environment) throws Exception {
   try {
     String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
     TableManager.getInstance().transitionTableState(tableId, TableState.DELETING);
     environment.getEventCoordinator().event("deleting table %s ", tableId);
     return new CleanUp(tableId, namespaceId);
   } catch (IllegalArgumentException ex) {
     if (ex.getCause() != null && ex.getCause() instanceof TableNotFoundException) {
       return null;
     }
     throw ex;
   }
 }
예제 #3
0
 @Override
 public void undo(long tid, Master environment) throws Exception {
   String namespaceId = Tables.getNamespaceId(environment.getInstance(), tableId);
   Utils.unreserveNamespace(namespaceId, tid, false);
   Utils.unreserveTable(tableId, tid, true);
 }