Class ZKPermissionWatcher
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
org.apache.hadoop.hbase.security.access.ZKPermissionWatcher
- All Implemented Interfaces:
Closeable
,AutoCloseable
Handles synchronization of access control list entries and updates throughout all nodes in the
cluster. The
AccessController
instance on the _acl_
table regions, creates a
znode for each table as /hbase/acl/tablename
, with the znode data containing a serialized
list of the permissions granted for the table. The AccessController
instances on all
other cluster hosts watch the znodes for updates, which trigger updates in the
AuthManager
permission cache.-
Field Summary
Modifier and TypeFieldDescription(package private) static final String
private final String
private final AuthManager
private Future<?>
private final ExecutorService
private final CountDownLatch
private static final org.slf4j.Logger
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
watcher
-
Constructor Summary
ConstructorDescriptionZKPermissionWatcher
(ZKWatcher watcher, AuthManager authManager, org.apache.hadoop.conf.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionprivate Future<?>
asyncProcessNodeUpdate
(Runnable runnable) void
close()
void
deleteNamespaceACLNode
(String namespace) Delete the acl notify node of namespacevoid
deleteTableACLNode
(TableName tableName) Delete the acl notify node of tablevoid
nodeChildrenChanged
(String path) Called when an existing node has a child node added or removed.void
nodeCreated
(String path) Called when a new node has been created.void
nodeDataChanged
(String path) Called when an existing node has changed data.void
nodeDeleted
(String path) Called when a node has been deletedprivate void
refreshAuthManager
(String entry, byte[] nodeData) private void
refreshNodes
(List<ZKUtil.NodeAndData> nodes) void
start()
private void
void
writeToZookeeper
(byte[] entry, byte[] permsData) Write a table's access controls to the permissions mirror in zookeeperMethods inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
getWatcher
-
Field Details
-
LOG
-
ACL_NODE
- See Also:
-
authManager
-
aclZNode
-
initialized
-
executor
-
childrenChangedFuture
-
-
Constructor Details
-
ZKPermissionWatcher
public ZKPermissionWatcher(ZKWatcher watcher, AuthManager authManager, org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
start
- Throws:
org.apache.zookeeper.KeeperException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
waitUntilStarted
-
nodeCreated
Description copied from class:ZKListener
Called when a new node has been created.- Overrides:
nodeCreated
in classZKListener
- Parameters:
path
- full path of the new node
-
nodeDeleted
Description copied from class:ZKListener
Called when a node has been deleted- Overrides:
nodeDeleted
in classZKListener
- Parameters:
path
- full path of the deleted node
-
nodeDataChanged
Description copied from class:ZKListener
Called when an existing node has changed data.- Overrides:
nodeDataChanged
in classZKListener
- Parameters:
path
- full path of the updated node
-
nodeChildrenChanged
Description copied from class:ZKListener
Called when an existing node has a child node added or removed.- Overrides:
nodeChildrenChanged
in classZKListener
- Parameters:
path
- full path of the node whose children have changed
-
asyncProcessNodeUpdate
-
refreshNodes
-
refreshAuthManager
- Throws:
IOException
-
writeToZookeeper
Write a table's access controls to the permissions mirror in zookeeper -
deleteTableACLNode
Delete the acl notify node of table -
deleteNamespaceACLNode
Delete the acl notify node of namespace
-