/** * */ void stop() { U.cancel(workers); U.join(workers, log); top = null; }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { U.cancel(cleanupWorker); U.join(cleanupWorker, log); }
/** {@inheritDoc} */ @Override public void close() { if (addrSnds == null) return; for (AddressSender addrSnd : addrSnds) U.interrupt(addrSnd); for (AddressSender addrSnd : addrSnds) U.join(addrSnd, log); }
/** * Kills the java process. * * @throws Exception If any problem occurred. */ public void kill() throws Exception { Process killProc = U.isWindows() ? Runtime.getRuntime().exec(new String[] {"taskkill", "/pid", pid, "/f", "/t"}) : Runtime.getRuntime().exec(new String[] {"kill", "-9", pid}); killProc.waitFor(); assert killProc.exitValue() == 0 : "Process killing was not successful"; if (procKilledC != null) procKilledC.apply(); U.interrupt(osGrabber); U.interrupt(esGrabber); U.join(osGrabber, log); U.join(esGrabber, log); }
/** * Before stop callback. */ public void beforeStop() { if (readWorker != null) readWorker.cancel(); U.closeQuiet(sock); if (readWorker != null) U.join(readWorker, log); }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { GridGgfsDeleteWorker delWorker0 = delWorker; if (delWorker0 != null) delWorker0.cancel(); if (delWorker0 != null) { try { U.join(delWorker0); } catch (GridInterruptedException ignored) { // No-op. } } busyLock.block(); }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { GridGgfsDeleteWorker delWorker0 = delWorker; if (delWorker0 != null) delWorker0.cancel(); if (delWorker0 != null) { try { U.join(delWorker0); } catch (GridInterruptedException ignored) { // No-op. } } busyLock.block(); }
/** {@inheritDoc} */ @Override protected void stop0(boolean cancel) { // Safety. kernalStartLatch.countDown(); if (bindWorker != null) { bindWorker.cancel(); U.join(bindWorker, log); } if (!F.isEmpty(srvrs)) { for (GridGgfsServer srv : srvrs) srv.stop(cancel); } }
/** {@inheritDoc} */ @Override protected void stop0(boolean cancel) { // Safety. kernalStartLatch.countDown(); if (bindWorker != null) { bindWorker.cancel(); U.join(bindWorker, log); } if (!F.isEmpty(srvrs)) { for (GridGgfsServer srv : srvrs) srv.stop(cancel); } }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { if (cancel) delWorker.cancel(); else delWorker.stop(); try { // Always wait thread exit. U.join(delWorker); } catch (GridInterruptedException e) { log.warning("Got interrupter while waiting for delete worker to stop (will continue stopping).", e); } if (putExecSvcShutdown) U.shutdownNow(getClass(), putExecSvc, log); }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { if (cancel) delWorker.cancel(); else delWorker.stop(); try { // Always wait thread exit. U.join(delWorker); } catch (GridInterruptedException e) { log.warning("Got interrupter while waiting for delete worker to stop (will continue stopping).", e); } if (putExecSvcShutdown) U.shutdownNow(getClass(), putExecSvc, log); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws GridException { U.interrupt(timeoutWorker); U.join(timeoutWorker); if (log.isDebugEnabled()) log.debug("Timeout processor stopped."); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws GridException { // Stop receiving notifications. getSpi().setListener(null); // Stop segment check worker. U.cancel(segChkWrk); U.join(segChkWrk, log); // Stop discovery worker. U.cancel(discoWrk); U.join(discoWrk, log); // Stop metrics updater. U.cancel(metricsUpdater); U.join(metricsUpdater, log); // Stop SPI itself. stopSpi(); if (log.isDebugEnabled()) log.debug(stopInfo()); }
/** {@inheritDoc} */ @Override public void stop() { U.cancel(checkPntWorker); U.join(checkPntWorker, log); for (LogFile f : files) { f.stopReads(); try { f.stopWrites(); } catch (GridException e) { U.error(log, "Failed to stop file operations: " + f, e); } } }
/** {@inheritDoc} */ @Override public void onKernalStop0(boolean cancel) { if (cctx.config().getCacheMode() == LOCAL || cctx.config().getAtomicityMode() == ATOMIC) // No-op for local and atomic caches. return; cctx.io().removeHandler(GridCacheDgcRequest.class, reqHnd); cctx.io().removeHandler(GridCacheDgcResponse.class, resHnd); if (reqThread != null) { U.interrupt(reqThread); U.join(reqThread, log); } if (resThread != null) { U.interrupt(resThread); U.join(resThread, log); } if (gcThread != null) { U.interrupt(gcThread); U.join(gcThread, log); } }
/** {@inheritDoc} */ @Override public void spiStop() throws GridSpiException { if (timeoutTask != null) { U.interrupt(timeoutTask); U.join(timeoutTask, log); } unregisterMBean(); // Clean resources. folder = null; host = null; // Ack ok stop. if (log.isDebugEnabled()) log.debug(stopInfo()); }
/** {@inheritDoc} */ @Override public void onKernalStop(boolean cancel) { super.onKernalStop(cancel); rw.writeLock(); try { stopping = false; if (timeCoord != null) { timeCoord.cancel(); U.join(timeCoord, log); timeCoord = null; } if (srv != null) srv.beforeStop(); } finally { rw.writeUnlock(); } }
/** {@inheritDoc} */ @Override protected void onKernalStop0(boolean cancel) { super.onKernalStop0(cancel); // Change stopping first. stopping = true; busyLock.block(); // Stop backup worker. if (evictSync && !cctx.isNear() && backupWorker != null) { backupWorker.cancel(); U.join(backupWorkerThread, log); } // Cancel all active futures. for (EvictionFuture fut : futs.values()) fut.cancel(); if (log.isDebugEnabled()) log.debug("Eviction manager stopped on node: " + cctx.nodeId()); }