/** * * @param position a name for what position this leader election is about, used in informational messages. * @param electionPath path under which the ephemeral leader election nodes should be created. The path * will be created if it does not exist. The path should not end on a slash. */ public LeaderElection(ZooKeeperItf zk, String position, String electionPath, LeaderElectionCallback callback) throws LeaderElectionSetupException, InterruptedException, KeeperException { this.zk = zk; this.position = position; this.electionPath = electionPath; this.callback = callback; proposeAsLeader(); zk.addDefaultWatcher(connectStateWatcher); leaderProvisioner.start(); }
/** * * @param position a name for what position this leader election is about, used in informational messages. * @param electionPath path under which the ephemeral leader election nodes should be created. The path * will be created if it does not exist. The path should not end on a slash. */ public LeaderElection(ZooKeeperItf zk, String position, String electionPath, LeaderElectionCallback callback) throws LeaderElectionSetupException, InterruptedException, KeeperException { this.zk = zk; this.position = position; this.electionPath = electionPath; this.callback = callback; proposeAsLeader(); zk.addDefaultWatcher(connectStateWatcher); leaderProvisioner.start(); }
public IndexerModelImpl(ZooKeeperItf zk, String zkRoot) throws InterruptedException, KeeperException { this.zk = zk; this.indexerCollectionPath = zkRoot + "/indexer"; this.indexerCollectionPathSlash = indexerCollectionPath + "/"; this.indexerTrashPath = zkRoot + "/indexer-trash"; ZkUtil.createPath(zk, indexerCollectionPath); ZkUtil.createPath(zk, indexerTrashPath); zk.addDefaultWatcher(connectStateWatcher); indexerCacheRefresher.start(); indexerCacheRefresher.waitUntilStarted(); }
public IndexerModelImpl(ZooKeeperItf zk, String zkRoot) throws InterruptedException, KeeperException { this.zk = zk; this.indexerCollectionPath = zkRoot + "/indexer"; this.indexerCollectionPathSlash = indexerCollectionPath + "/"; this.indexerTrashPath = zkRoot + "/indexer-trash"; ZkUtil.createPath(zk, indexerCollectionPath); ZkUtil.createPath(zk, indexerTrashPath); zk.addDefaultWatcher(connectStateWatcher); indexerCacheRefresher.start(); indexerCacheRefresher.waitUntilStarted(); }