/** * Get the full znode path for the node used by the coordinator to trigger a global barrier * execution and release on each subprocedure. * @param controller controller running the procedure * @param opInstanceName name of the running procedure instance (not the procedure description). * @return full znode path to the commit barrier */ public static String getReachedBarrierNode(ZKProcedureUtil controller, String opInstanceName) { return ZNodePaths.joinZNode(controller.reachedZnode, opInstanceName); }
/** * Get the full znode path for the node used by the coordinator to trigger a global barrier * acquire on each subprocedure. * @param controller controller running the procedure * @param opInstanceName name of the running procedure instance (not the procedure description). * @return full znode path to the prepare barrier/start node */ public static String getAcquireBarrierNode(ZKProcedureUtil controller, String opInstanceName) { return ZNodePaths.joinZNode(controller.acquiredZnode, opInstanceName); }
/** * Get the full znode path for the node used by the coordinator or member to trigger an abort * of the global barrier acquisition or execution in subprocedures. * @param controller controller running the procedure * @param opInstanceName name of the running procedure instance (not the procedure description). * @return full znode path to the abort znode */ public static String getAbortNode(ZKProcedureUtil controller, String opInstanceName) { return ZNodePaths.joinZNode(controller.abortZnode, opInstanceName); }
/** * Get the zookeeper node associated with archiving the given table * @param table name of the table to check * @return znode for the table's archive status */ private String getTableNode(byte[] table) { return ZNodePaths.joinZNode(archiveZnode, Bytes.toString(table)); } }
public ZKReplicationQueueStorage(ZKWatcher zookeeper, Configuration conf) { super(zookeeper, conf); String queuesZNodeName = conf.get("zookeeper.znode.replication.rs", "rs"); String hfileRefsZNodeName = conf.get(ZOOKEEPER_ZNODE_REPLICATION_HFILE_REFS_KEY, ZOOKEEPER_ZNODE_REPLICATION_HFILE_REFS_DEFAULT); this.queuesZNode = ZNodePaths.joinZNode(replicationZNode, queuesZNodeName); this.hfileRefsZNode = ZNodePaths.joinZNode(replicationZNode, hfileRefsZNodeName); this.regionsZNode = ZNodePaths.joinZNode(replicationZNode, conf .get(ZOOKEEPER_ZNODE_REPLICATION_REGIONS_KEY, ZOOKEEPER_ZNODE_REPLICATION_REGIONS_DEFAULT)); }
public ZKReplicationPeerStorage(ZKWatcher zookeeper, Configuration conf) { super(zookeeper, conf); this.peerStateNodeName = conf.get(PEERS_STATE_ZNODE, PEERS_STATE_ZNODE_DEFAULT); String peersZNodeName = conf.get(PEERS_ZNODE, PEERS_ZNODE_DEFAULT); this.peersZNode = ZNodePaths.joinZNode(replicationZNode, peersZNodeName); }
public ZKSecretWatcher(Configuration conf, ZKWatcher watcher, AuthenticationTokenSecretManager secretManager) { super(watcher); this.secretManager = secretManager; String keyZNodeParent = conf.get("zookeeper.znode.tokenauth.parent", DEFAULT_ROOT_NODE); this.baseKeyZNode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, keyZNodeParent); this.keysParentZNode = ZNodePaths.joinZNode(baseKeyZNode, DEFAULT_KEYS_PARENT); }
@VisibleForTesting protected String getTableCFsNode(String peerId) { String replicationZNode = ZNodePaths.joinZNode(zookeeper.getZNodePaths().baseZNode, conf.get(REPLICATION_ZNODE, REPLICATION_ZNODE_DEFAULT)); String peersZNode = ZNodePaths.joinZNode(replicationZNode, conf.get(PEERS_ZNODE, PEERS_ZNODE_DEFAULT)); return ZNodePaths.joinZNode(peersZNode, ZNodePaths.joinZNode(peerId, conf.get(TABLE_CFS_ZNODE, TABLE_CFS_ZNODE_DEFAULT))); }
/** * @param conf conf to read for the base archive node * @param zooKeeper zookeeper to used for building the full path * @return get the znode for long-term archival of a table for */ public static String getArchiveZNode(Configuration conf, ZKWatcher zooKeeper) { return ZNodePaths.joinZNode(zooKeeper.getZNodePaths().baseZNode, conf.get( ZOOKEEPER_ZNODE_HFILE_ARCHIVE_KEY, TableHFileArchiveTracker.HFILE_ARCHIVE_ZNODE_PARENT)); } }
protected ZKReplicationStorageBase(ZKWatcher zookeeper, Configuration conf) { this.zookeeper = zookeeper; this.conf = conf; this.replicationZNode = ZNodePaths.joinZNode(this.zookeeper.getZNodePaths().baseZNode, conf.get(REPLICATION_ZNODE, REPLICATION_ZNODE_DEFAULT)); }
public ZKVisibilityLabelWatcher(ZKWatcher watcher, VisibilityLabelsCache labelsCache, Configuration conf) { super(watcher); this.labelsCache = labelsCache; String labelZnodeParent = conf.get(VISIBILITY_LABEL_ZK_PATH, DEFAULT_VISIBILITY_LABEL_NODE); String userAuthsZnodeParent = conf.get(VISIBILITY_USER_AUTHS_ZK_PATH, DEFAULT_VISIBILITY_USER_AUTHS_NODE); this.labelZnode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, labelZnodeParent); this.userAuthsZnode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, userAuthsZnodeParent); }
public RpcThrottleStorage(ZKWatcher zookeeper, Configuration conf) { this.zookeeper = zookeeper; this.rpcThrottleZNode = ZNodePaths.joinZNode(zookeeper.getZNodePaths().baseZNode, conf.get(RPC_THROTTLE_ZNODE, RPC_THROTTLE_ZNODE_DEFAULT)); }
@VisibleForTesting public String getPeerNode(String peerId) { return ZNodePaths.joinZNode(peersZNode, peerId); }
public ZKPermissionWatcher(ZKWatcher watcher, AuthManager authManager, Configuration conf) { super(watcher); this.authManager = authManager; String aclZnodeParent = conf.get("zookeeper.znode.acl.parent", ACL_NODE); this.aclZNode = ZNodePaths.joinZNode(watcher.getZNodePaths().baseZNode, aclZnodeParent); executor = Executors.newSingleThreadExecutor( new DaemonThreadFactory("zk-permission-watcher")); }
/** * Gets the full path node name for the log file being split. * This method will url encode the filename. * @param zkw zk reference * @param filename log file name (only the basename) */ public static String getEncodedNodeName(ZKWatcher zkw, String filename) { return ZNodePaths.joinZNode(zkw.getZNodePaths().splitLogZNode, encode(filename)); }
@VisibleForTesting public String getPeerStateNode(String peerId) { return ZNodePaths.joinZNode(getPeerNode(peerId), peerStateNodeName); }
@VisibleForTesting public String getSyncReplicationStateNode(String peerId) { return ZNodePaths.joinZNode(getPeerNode(peerId), SYNC_REPLICATION_STATE_ZNODE); }
public LeaderElector(ZKWatcher watcher, String serverName) { setDaemon(true); setName("ZKSecretWatcher-leaderElector"); zkLeader = new ZKLeaderManager(watcher, ZNodePaths.joinZNode(zkWatcher.getRootKeyZNode(), "keymaster"), Bytes.toBytes(serverName), this); }
private static String initPeerClusterState(String baseZKNode) throws IOException, KeeperException { // Add a dummy region server and set up the cluster id Configuration testConf = new Configuration(conf); testConf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, baseZKNode); ZKWatcher zkw1 = new ZKWatcher(testConf, "test1", null); String fakeRs = ZNodePaths.joinZNode(zkw1.getZNodePaths().rsZNode, "hostname1.example.org:1234"); ZKUtil.createWithParents(zkw1, fakeRs); ZKClusterId.setClusterId(zkw1, new ClusterId()); return ZKConfig.getZooKeeperClusterKey(testConf); }
@BeforeClass public static void setUpBeforeClass() throws Exception { utility = new HBaseZKTestingUtility(); utility.startMiniZKCluster(); conf = utility.getConfiguration(); conf.setBoolean(HConstants.REPLICATION_BULKLOAD_ENABLE_KEY, true); zkw = utility.getZooKeeperWatcher(); String replicationZNodeName = conf.get("zookeeper.znode.replication", "replication"); replicationZNode = ZNodePaths.joinZNode(zkw.getZNodePaths().baseZNode, replicationZNodeName); KEY_ONE = initPeerClusterState("/hbase1"); KEY_TWO = initPeerClusterState("/hbase2"); }