hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject hbase git commit: HBASE-12635 Delete acl notify znode of table after the table is deleted (Liu Shaohui)
Date Fri, 05 Dec 2014 01:43:12 GMT
Repository: hbase
Updated Branches:
  refs/heads/0.94 65b56212f -> aafed16af


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


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/aafed16a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/aafed16a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/aafed16a

Branch: refs/heads/0.94
Commit: aafed16af960afad614427513cacdbbabd98426d
Parents: 65b5621
Author: Andrew Purtell <apurtell@apache.org>
Authored: Thu Dec 4 16:43:33 2014 -0800
Committer: Andrew Purtell <apurtell@apache.org>
Committed: Thu Dec 4 17:41:05 2014 -0800

----------------------------------------------------------------------
 .../hbase/security/access/AccessController.java   |  1 +
 .../security/access/ZKPermissionWatcher.java      | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/aafed16a/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
----------------------------------------------------------------------
diff --git a/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
b/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
index 6161382..62faa69 100644
--- a/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
+++ b/security/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
@@ -656,6 +656,7 @@ public class AccessController extends BaseRegionObserver
         return null;
       }
     });
+    this.authManager.getZKPermissionWatcher().deleteTableACLNode(tableName);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/aafed16a/security/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
----------------------------------------------------------------------
diff --git a/security/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
b/security/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
index 4870bb1..e9cf897 100644
--- a/security/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
+++ b/security/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
@@ -159,4 +159,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 byte[] tableName) {
+    String zkNode = ZKUtil.joinZNode(watcher.baseZNode, ACL_NODE);
+    zkNode = ZKUtil.joinZNode(zkNode, Bytes.toString(tableName));
+
+    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);
+    }
+  }
 }


Mime
View raw message