HBASE-12635 Delete acl notify znode of table after the table is deleted (Liu Shaohui)

This commit is contained in:
Andrew Purtell 2014-12-04 16:43:33 -08:00
parent 04444299ab
commit e690a83d41
2 changed files with 19 additions and 0 deletions

View File

@ -926,6 +926,7 @@ public class AccessController extends BaseMasterAndRegionObserver
return null;
}
});
this.authManager.getZKPermissionWatcher().deleteTableACLNode(tableName);
}
@Override

View File

@ -193,4 +193,22 @@ public class ZKPermissionWatcher extends ZooKeeperListener {
watcher.abort("Failed writing node "+zkNode+" to zookeeper", e);
}
}
/***
* Delete the acl notify node of table
* @param tableName
*/
public void deleteTableACLNode(final TableName tableName) {
String zkNode = ZKUtil.joinZNode(watcher.baseZNode, ACL_NODE);
zkNode = ZKUtil.joinZNode(zkNode, tableName.getNameAsString());
try {
ZKUtil.deleteNode(watcher, zkNode);
} catch (KeeperException.NoNodeException e) {
LOG.warn("No acl notify node of table '" + tableName + "'");
} catch (KeeperException e) {
LOG.error("Failed deleting acl node of table '" + tableName + "'", e);
watcher.abort("Failed deleting node " + zkNode, e);
}
}
}