@Override public MasterInterceptor<MASTER_RESULT, WORKER_RESULT> createMasterCoordinator() { return new AsyncMasterCoordinator<MASTER_RESULT, WORKER_RESULT>(); }
@Override public void process(WatchedEvent event) { LOG.debug("DEBUG: process: Got a new event, path = {}, type = {}, state = {}", event.getPath(), event.getType(), event.getState()); if((event.getPath() == null) && (event.getType() == EventType.None)) { if(event.getState() == KeeperState.SyncConnected) { LOG.info("process: Asynchronous connection complete."); super.getZkConnLatch().countDown(); } else { LOG.warn("process: Got unknown null path event " + event); } return; } /** * Check lock signal condition. */ String appWorkerBaseNode = getWorkerBaseNode(getAppId(), getCurrentIteration()).toString(); if(event.getPath().equals(appWorkerBaseNode) && (event.getType() == EventType.NodeChildrenChanged)) { if(getCurrentIteration() == 0) { this.workerInitLock.signal(); } else { this.workerIterationLock.signal(); } } }
.toString(); new RetryCoordinatorCommand(isFixedTime(), getSleepTime()) { @Override public boolean retryExecution() throws KeeperException, InterruptedException { getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false); getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false); znode = getCurrentMasterNode(context.getAppId(), context.getCurrentIteration()).toString(); getZooKeeper().createExt(znode, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT, false); } catch (KeeperException.NodeExistsException e) { LOG.warn("Node exists: {}", znode);
new RetryCoordinatorCommand(isFixedTime(), getSleepTime()) { @Override public boolean retryExecution() throws KeeperException, InterruptedException { TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - start)); setWorkerResults(context, appCurrentWorkersNode, context.getAppId(), currentIteration);
@Override public void preApplication(final MasterContext<MASTER_RESULT, WORKER_RESULT> context) { initialize(context.getProps()); this.setAppId(context.getAppId());
@Override public void preIteration(final MasterContext<MASTER_RESULT, WORKER_RESULT> context) { this.setCurrentIteration(context.getCurrentIteration());