Search in sources :

Example 1 with ZKAccessControlManager

use of com.twitter.distributedlog.acl.ZKAccessControlManager in project distributedlog by twitter.

the class BKDistributedLogNamespace method createAccessControlManager.

@Override
public synchronized AccessControlManager createAccessControlManager() throws IOException {
    if (null == accessControlManager) {
        String aclRootPath = bkdlConfig.getACLRootPath();
        // Build the access control manager
        if (aclRootPath == null) {
            accessControlManager = DefaultAccessControlManager.INSTANCE;
            LOG.info("Created default access control manager for {}", namespace);
        } else {
            if (!isReservedStreamName(aclRootPath)) {
                throw new IOException("Invalid Access Control List Root Path : " + aclRootPath);
            }
            String zkRootPath = namespace.getPath() + "/" + aclRootPath;
            LOG.info("Creating zk based access control manager @ {} for {}", zkRootPath, namespace);
            accessControlManager = new ZKAccessControlManager(conf, sharedReaderZKCForDL, zkRootPath, scheduler);
            LOG.info("Created zk based access control manager @ {} for {}", zkRootPath, namespace);
        }
    }
    return accessControlManager;
}
Also used : ZKAccessControlManager(com.twitter.distributedlog.acl.ZKAccessControlManager) IOException(java.io.IOException)

Aggregations

ZKAccessControlManager (com.twitter.distributedlog.acl.ZKAccessControlManager)1 IOException (java.io.IOException)1