@Deprecated public boolean isInShutdownHook() { return isShutdown(); }
@Deprecated public boolean isInShutdownHook() { return isShutdown(); }
@Deprecated public boolean isInShutdownHook() { return isShutdown(); }
public void rejectedExecution(Runnable task, ThreadPoolExecutor executor) { if (executor.isShutdown()) { if (!StorageService.instance.isShutdown()) throw new RejectedExecutionException("ScheduledThreadPoolExecutor has shut down."); //Give some notification to the caller the task isn't going to run if (task instanceof Future) ((Future) task).cancel(false); logger.debug("ScheduledThreadPoolExecutor has shut down as part of C* shutdown"); } else { throw new AssertionError("Unknown rejection of ScheduledThreadPoolExecutor task"); } } };
public void rejectedExecution(Runnable task, ThreadPoolExecutor executor) { if (executor.isShutdown()) { if (!StorageService.instance.isShutdown()) throw new RejectedExecutionException("ScheduledThreadPoolExecutor has shut down."); //Give some notification to the caller the task isn't going to run if (task instanceof Future) ((Future) task).cancel(false); logger.debug("ScheduledThreadPoolExecutor has shut down as part of C* shutdown"); } else { throw new AssertionError("Unknown rejection of ScheduledThreadPoolExecutor task"); } } };
/** * Some services are shutdown during draining and we should not attempt to start them again. * * @param service - the name of the service we are trying to start. * @throws IllegalStateException - an exception that nodetool is able to convert into a message to display to the user */ synchronized void checkServiceAllowedToStart(String service) { if (isDraining()) // when draining isShutdown is also true, so we check first to return a more accurate message throw new IllegalStateException(String.format("Unable to start %s because the node is draining.", service)); if (isShutdown()) // do not rely on operationMode in case it gets changed to decomissioned or other throw new IllegalStateException(String.format("Unable to start %s because the node was drained.", service)); }
public void rejectedExecution(Runnable task, ThreadPoolExecutor executor) { if (executor.isShutdown()) { if (!StorageService.instance.isShutdown()) throw new RejectedExecutionException("ScheduledThreadPoolExecutor has shut down."); //Give some notification to the caller the task isn't going to run if (task instanceof Future) ((Future) task).cancel(false); logger.debug("ScheduledThreadPoolExecutor has shut down as part of C* shutdown"); } else { throw new AssertionError("Unknown rejection of ScheduledThreadPoolExecutor task"); } } };
/** * Some services are shutdown during draining and we should not attempt to start them again. * * @param service - the name of the service we are trying to start. * @throws IllegalStateException - an exception that nodetool is able to convert into a message to display to the user */ synchronized void checkServiceAllowedToStart(String service) { if (isDraining()) // when draining isShutdown is also true, so we check first to return a more accurate message throw new IllegalStateException(String.format("Unable to start %s because the node is draining.", service)); if (isShutdown()) // do not rely on operationMode in case it gets changed to decomissioned or other throw new IllegalStateException(String.format("Unable to start %s because the node was drained.", service)); }
/** * Some services are shutdown during draining and we should not attempt to start them again. * * @param service - the name of the service we are trying to start. * @throws IllegalStateException - an exception that nodetool is able to convert into a message to display to the user */ synchronized void checkServiceAllowedToStart(String service) { if (isDraining()) // when draining isShutdown is also true, so we check first to return a more accurate message throw new IllegalStateException(String.format("Unable to start %s because the node is draining.", service)); if (isShutdown()) // do not rely on operationMode in case it gets changed to decomissioned or other throw new IllegalStateException(String.format("Unable to start %s because the node was drained.", service)); }