@Override public boolean isSourceActive() { return !this.server.isStopped() && this.sourceRunning; }
@Override public void run() { while (!server.isStopped()) { try { byte[] data = queue.take(); setDataForClientZkUntilSuccess(znode, data); } catch (InterruptedException e) { if (LOG.isDebugEnabled()) { LOG.debug( "Interrupted while checking whether need to update meta location to client zk"); } Thread.currentThread().interrupt(); break; } } } }
void handle(final String path) { if (path.equals(watcher.getZNodePaths().masterAddressZNode) && !master.isStopped()) { handleMasterNodeChange(); } }
@Override public void nodeDeleted(String path) { // We need to keep track of the cluster's shutdown status while // we wait on the current master. We consider that, if the cluster // was already in a "shutdown" state when we started, that this master // is part of a new cluster that was started shortly after the old cluster // shut down, so that state is now irrelevant. This means that the shutdown // state must be set while we wait on the active master in order // to shutdown this master. See HBASE-8519. if(path.equals(watcher.getZNodePaths().clusterStateZNode) && !master.isStopped()) { clusterShutDown.set(true); } handle(path); }
break; case ERR: if (server != null && !server.isStopped()) { coordination.endTask(new SplitLogTask.Err(this.serverName), SplitLogCounters.tot_wkr_task_err, splitTaskDetails); if (server != null && server.isStopped()) { LOG.info("task execution interrupted because worker is exiting " + splitTaskDetails.toString());
while (!server.isStopped()) { try { LOG.debug("Set data for remote " + node + ", client zk wather: " + clientZkWatcher);
if (server.isStopped()) { LOG.info("Not transferring queue since we are shutting down"); return;
String backupZNode = ZNodePaths.joinZNode( this.watcher.getZNodePaths().backupMasterAddressesZNode, this.sn.toString()); while (!(master.isAborted() || master.isStopped())) { startupStatus.setStatus("Trying to register in ZK as active master"); while (clusterHasActiveMaster.get() && !master.isStopped()) { try { clusterHasActiveMaster.wait(checkInterval);
&& !server.isAborted() && !server.isStopped()) { FlushRegionCallable flushCallable = new FlushRegionCallable( connection, rpcControllerFactory,
@Override public void nodeDeleted(String path) { if(path.equals(watcher.masterAddressZNode) && !master.isStopped()) { handleMasterNodeChange(); } }
@Override public void nodeCreated(String path) { if(path.equals(watcher.masterAddressZNode) && !master.isStopped()) { handleMasterNodeChange(); } }
@Override public void nodeDeleted(String path) { // We need to keep track of the cluster's shutdown status while // we wait on the current master. We consider that, if the cluster // was already in a "shutdown" state when we started, that this master // is part of a new cluster that was started shortly after the old cluster // shut down, so that state is now irrelevant. This means that the shutdown // state must be set while we wait on the active master in order // to shutdown this master. See HBASE-8519. if(path.equals(watcher.clusterStateZNode) && !master.isStopped()) { clusterShutDown.set(true); } handle(path); }
@Override protected boolean waitUntilDone(long timeout) throws InterruptedException { long startTime = System.currentTimeMillis(); long remaining = timeout; List<HRegionInfo> regions = null; while (!server.isStopped() && remaining > 0) { Thread.sleep(waitingTimeForEvents); regions = assignmentManager.getRegionsOfTable(tableName); LOG.debug("Disable waiting until done; " + remaining + " ms remaining; " + regions); if (regions.isEmpty()) break; remaining = timeout - (System.currentTimeMillis() - startTime); } return regions != null && regions.isEmpty(); } }
void handle(final String path) { if (path.equals(watcher.getMasterAddressZNode()) && !master.isStopped()) { handleMasterNodeChange(); } }
@Override public void nodeChildrenChanged(String path) { if (path.equals(watcher.rsZNode) && !server.isAborted() && !server.isStopped()) { try { List<String> servers = ZKUtil.listChildrenAndWatchThem(watcher, watcher.rsZNode); add(servers); } catch (IOException e) { server.abort("Unexpected zk exception getting RS nodes", e); } catch (KeeperException e) { server.abort("Unexpected zk exception getting RS nodes", e); } } }