List<String> workers; try { workers = cf.getChildren().forPath(indexerZkConfig.getStatusPath()); String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId);
workers = cf.getChildren().forPath(indexerZkConfig.getStatusPath()); final String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId); if (!zkWorkers.containsKey(workerId) && cf.checkExists().forPath(workerAnnouncePath) == null) { try {
@Inject public WorkerCuratorCoordinator( ObjectMapper jsonMapper, IndexerZkConfig indexerZkConfig, RemoteTaskRunnerConfig config, CuratorFramework curatorFramework, Worker worker ) { this.jsonMapper = jsonMapper; this.config = config; this.curatorFramework = curatorFramework; this.worker = worker; this.announcer = new Announcer(curatorFramework, Execs.directExecutor()); this.baseAnnouncementsPath = getPath(Arrays.asList(indexerZkConfig.getAnnouncementsPath(), worker.getHost())); this.baseTaskPath = getPath(Arrays.asList(indexerZkConfig.getTasksPath(), worker.getHost())); this.baseStatusPath = getPath(Arrays.asList(indexerZkConfig.getStatusPath(), worker.getHost())); }
final String workerId = worker.getHost(); log.info("Cleaning up task[%s] on worker[%s]", taskId, workerId); final String statusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId, taskId); try { cf.delete().guaranteed().forPath(statusPath);
cancelWorkerCleanup(worker.getHost()); final String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), worker.getHost()); final PathChildrenCache statusCache = workerStatusPathChildrenCacheFactory.make(cf, workerStatusPath); final SettableFuture<ZkWorker> retVal = SettableFuture.create();
List<String> workers; try { workers = cf.getChildren().forPath(indexerZkConfig.getStatusPath()); String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId);
workers = cf.getChildren().forPath(indexerZkConfig.getStatusPath()); final String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId); if (!zkWorkers.containsKey(workerId) && cf.checkExists().forPath(workerAnnouncePath) == null) { try {
@Inject public WorkerCuratorCoordinator( ObjectMapper jsonMapper, IndexerZkConfig indexerZkConfig, RemoteTaskRunnerConfig config, CuratorFramework curatorFramework, Worker worker ) { this.jsonMapper = jsonMapper; this.config = config; this.curatorFramework = curatorFramework; this.worker = worker; this.announcer = new Announcer(curatorFramework, MoreExecutors.sameThreadExecutor()); this.baseAnnouncementsPath = getPath(Arrays.asList(indexerZkConfig.getAnnouncementsPath(), worker.getHost())); this.baseTaskPath = getPath(Arrays.asList(indexerZkConfig.getTasksPath(), worker.getHost())); this.baseStatusPath = getPath(Arrays.asList(indexerZkConfig.getStatusPath(), worker.getHost())); }
final String workerId = worker.getHost(); log.info("Cleaning up task[%s] on worker[%s]", taskId, workerId); final String statusPath = JOINER.join(indexerZkConfig.getStatusPath(), workerId, taskId); try { cf.delete().guaranteed().forPath(statusPath);
cancelWorkerCleanup(worker.getHost()); final String workerStatusPath = JOINER.join(indexerZkConfig.getStatusPath(), worker.getHost()); final PathChildrenCache statusCache = workerStatusPathChildrenCacheFactory.make(cf, workerStatusPath); final SettableFuture<ZkWorker> retVal = SettableFuture.create();