hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject [3/3] hbase git commit: HBASE-12635 Delete acl notify znode of table after the table is deleted (Liu Shaohui)
Date Fri, 05 Dec 2014 01:19:15 GMT
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/30c70325
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/30c70325
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/30c70325

Branch: refs/heads/0.98
Commit: 30c70325c75746b7d7968f578c6a126c76252bf1
Parents: 6c92731
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 16:43:46 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/30c70325/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
index 19709e6..904da02 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/AccessController.java
@@ -985,6 +985,7 @@ public class AccessController extends BaseMasterAndRegionObserver
         return null;
       }
     });
+    this.authManager.getZKPermissionWatcher().deleteTableACLNode(tableName);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/hbase/blob/30c70325/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
index 0265e82..53de50f 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/ZKPermissionWatcher.java
@@ -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);
+    }
+  }
 }


Mime
View raw message