/** * Stops default grid. This method is identical to {@code G.stop(null, cancel)} apply. * Note that method does not wait for all tasks to be completed. * * @param cancel If {@code true} then all jobs currently executing on * default grid will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} * method. Note that just like with {@link Thread#interrupt()}, it is * up to the actual job to exit from execution * @return {@code true} if default grid instance was indeed stopped, * {@code false} otherwise (if it was not started). */ public static boolean stop(boolean cancel) { return IgnitionEx.stop(cancel); }
/** * Stops default grid. This method is identical to {@code G.stop(null, cancel)} apply. * Note that method does not wait for all tasks to be completed. * * @param cancel If {@code true} then all jobs currently executing on * default grid will be cancelled by calling {@link ComputeJob#cancel()} * method. Note that just like with {@link Thread#interrupt()}, it is * up to the actual job to exit from execution * @return {@code true} if default grid instance was indeed stopped, * {@code false} otherwise (if it was not started). */ public static boolean stop(boolean cancel) { return stop(null, cancel, false); }
/** * Stops named Ignite instance. If {@code cancel} flag is set to {@code true} then * all jobs currently executing on local node will be interrupted. If * Ignite instance name is {@code null}, then default no-name Ignite instance will be stopped. * If wait parameter is set to {@code true} then Ignite instance will wait for all * tasks to be finished. * * @param name Ignite instance name. If {@code null}, then default no-name Ignite instance will * be stopped. * @param cancel If {@code true} then all jobs currently will be cancelled * by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} method. Note that just like with * {@link Thread#interrupt()}, it is up to the actual job to exit from * execution. If {@code false}, then jobs currently running will not be * canceled. In either case, grid node will wait for completion of all * jobs running on it before stopping. * @return {@code true} if named Ignite instance was indeed found and stopped, * {@code false} otherwise (the instance with given {@code name} was * not found). */ public static boolean stop(@Nullable String name, boolean cancel) { return IgnitionEx.stop(name, cancel, false); }
/** * Behavior of the method is the almost same as {@link IgnitionEx#stop(String, boolean, boolean)}. * If node stopping process will not be finished within {@code timeoutMs} whole JVM will be killed. * * @param timeoutMs Timeout to wait graceful stopping. */ public static boolean stop(@Nullable String name, boolean cancel, boolean stopNotStarted, long timeoutMs) { final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); // Schedule delayed node killing if graceful stopping will be not finished within timeout. executor.schedule(new Runnable() { @Override public void run() { if (state(name) == IgniteState.STARTED) { U.error(null, "Unable to gracefully stop node within timeout " + timeoutMs + " milliseconds. Killing node..."); // We are not able to kill only one grid so whole JVM will be stopped. Runtime.getRuntime().halt(Ignition.KILL_EXIT_CODE); } } }, timeoutMs, TimeUnit.MILLISECONDS); boolean success = stop(name, cancel, stopNotStarted); executor.shutdownNow(); return success; }
@Override public void run() { U.error(log, "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']'); IgnitionEx.stop(ignite.name(), true, true); latch.countDown(); } },
@Override public void run() { try { IgnitionEx.stop(igniteInstanceName, true, true); U.log(log, "Stopped the node successfully in response to fatal error in ZookeeperDiscoverySpi."); } catch (Throwable e) { U.error(log, "Failed to stop the node successfully in response to fatal error in " + "ZookeeperDiscoverySpi.", e); } } }, "node-stop-thread").start();
@Override public void run() { U.error(ignite.log(), "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']'); IgnitionEx.stop(ignite.name(), true, true); } },
@Override public void run() { try { IgnitionEx.stop(ignite.name(), true, true); U.log(log, "Stopped the node successfully in response to TcpDiscoverySpi's " + "message worker thread abnormal termination."); } catch (Throwable e) { U.error(log, "Failed to stop the node in response to TcpDiscoverySpi's " + "message worker thread abnormal termination.", e); } } }, "node-stop-thread").start();
@Override public void run() { U.error(ignite.log(), "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']'); IgnitionEx.stop(ignite.name(), true, true); stopLatch.countDown(); } },
helper.checkEvents(ignite(1), evts, ZookeeperDiscoverySpiTestHelper.failEvent(4)); IgnitionEx.stop(getTestIgniteInstanceName(2), true, true);
/** * Stops default grid. This method is identical to {@code G.stop(null, cancel)} apply. * Note that method does not wait for all tasks to be completed. * * @param cancel If {@code true} then all jobs currently executing on * default grid will be cancelled by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} * method. Note that just like with {@link Thread#interrupt()}, it is * up to the actual job to exit from execution * @return {@code true} if default grid instance was indeed stopped, * {@code false} otherwise (if it was not started). */ public static boolean stop(boolean cancel) { return IgnitionEx.stop(cancel); }
/** * Stops default grid. This method is identical to {@code G.stop(null, cancel)} apply. * Note that method does not wait for all tasks to be completed. * * @param cancel If {@code true} then all jobs currently executing on * default grid will be cancelled by calling {@link ComputeJob#cancel()} * method. Note that just like with {@link Thread#interrupt()}, it is * up to the actual job to exit from execution * @return {@code true} if default grid instance was indeed stopped, * {@code false} otherwise (if it was not started). */ public static boolean stop(boolean cancel) { return stop(null, cancel, false); }
/** * Stops named Ignite instance. If {@code cancel} flag is set to {@code true} then * all jobs currently executing on local node will be interrupted. If * Ignite instance name is {@code null}, then default no-name Ignite instance will be stopped. * If wait parameter is set to {@code true} then Ignite instance will wait for all * tasks to be finished. * * @param name Ignite instance name. If {@code null}, then default no-name Ignite instance will * be stopped. * @param cancel If {@code true} then all jobs currently will be cancelled * by calling {@link org.apache.ignite.compute.ComputeJob#cancel()} method. Note that just like with * {@link Thread#interrupt()}, it is up to the actual job to exit from * execution. If {@code false}, then jobs currently running will not be * canceled. In either case, grid node will wait for completion of all * jobs running on it before stopping. * @return {@code true} if named Ignite instance was indeed found and stopped, * {@code false} otherwise (the instance with given {@code name} was * not found). */ public static boolean stop(@Nullable String name, boolean cancel) { return IgnitionEx.stop(name, cancel, false); }
/** * Behavior of the method is the almost same as {@link IgnitionEx#stop(String, boolean, boolean)}. * If node stopping process will not be finished within {@code timeoutMs} whole JVM will be killed. * * @param timeoutMs Timeout to wait graceful stopping. */ public static boolean stop(@Nullable String name, boolean cancel, boolean stopNotStarted, long timeoutMs) { final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); // Schedule delayed node killing if graceful stopping will be not finished within timeout. executor.schedule(new Runnable() { @Override public void run() { if (state(name) == IgniteState.STARTED) { U.error(null, "Unable to gracefully stop node within timeout " + timeoutMs + " milliseconds. Killing node..."); // We are not able to kill only one grid so whole JVM will be stopped. Runtime.getRuntime().halt(Ignition.KILL_EXIT_CODE); } } }, timeoutMs, TimeUnit.MILLISECONDS); boolean success = stop(name, cancel, stopNotStarted); executor.shutdownNow(); return success; }
@Override public void run() { U.error(log, "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']'); IgnitionEx.stop(ignite.name(), true, true); latch.countDown(); } },
@Override public void run() { try { IgnitionEx.stop(ignite.name(), true, true); U.log(log, "Stopped the node successfully in response to TcpDiscoverySpi's " + "message worker thread abnormal termination."); } catch (Throwable e) { U.error(log, "Failed to stop the node in response to TcpDiscoverySpi's " + "message worker thread abnormal termination.", e); } } }, "node-stop-thread").start();
@Override public void run() { U.error(ignite.log(), "Stopping local node on Ignite failure: [failureCtx=" + failureCtx + ']'); IgnitionEx.stop(ignite.name(), true, true); } },