/** {@inheritDoc} */ @Override public void stop(boolean cancel) { busyLock.block(); // Clear interrupted flag temporarily. boolean interrupted = Thread.interrupted(); if (secondaryFs != null) { // Force all workers to finish their batches. for (IgfsFileWorkerBatch batch : workerMap.values()) batch.cancel(); try { if (secondaryFs instanceof LifecycleAware) ((LifecycleAware)secondaryFs).stop(); } catch (Exception e) { log.error("Failed to close secondary file system.", e); } } // Restore interrupted flag. if (interrupted) Thread.currentThread().interrupt(); if (dualPool != null) dualPool.shutdownNow(); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws IgniteCheckedException { if (!isEnabled) return; ctx.io().removeMessageListener(GridTopic.TOPIC_AUTH, ioLsnr); ctx.event().removeDiscoveryEventListener(discoLsnr, DISCO_EVT_TYPES); cancelFutures("Node stopped"); if (!cancel) exec.shutdown(); else exec.shutdownNow(); }
asyncRunner.shutdownNow();
/** {@inheritDoc} */ @Override public void stop(boolean cancel) { busyLock.block(); // Clear interrupted flag temporarily. boolean interrupted = Thread.interrupted(); if (secondaryFs != null) { // Force all workers to finish their batches. for (IgfsFileWorkerBatch batch : workerMap.values()) batch.cancel(); try { if (secondaryFs instanceof LifecycleAware) ((LifecycleAware)secondaryFs).stop(); } catch (Exception e) { log.error("Failed to close secondary file system.", e); } } // Restore interrupted flag. if (interrupted) Thread.currentThread().interrupt(); if (dualPool != null) dualPool.shutdownNow(); }
/** {@inheritDoc} */ @Override public void stop(boolean cancel) throws IgniteCheckedException { if (!isEnabled) return; ctx.io().removeMessageListener(GridTopic.TOPIC_AUTH, ioLsnr); ctx.event().removeDiscoveryEventListener(discoLsnr, DISCO_EVT_TYPES); cancelFutures("Node stopped"); if (!cancel) exec.shutdown(); else exec.shutdownNow(); }
asyncRunner.shutdownNow();