Package org.apache.cassandra.concurrent
Enum Stage
- java.lang.Object
-
- java.lang.Enum<Stage>
-
- org.apache.cassandra.concurrent.Stage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceStage.ExecutorServiceInitialiser
-
Enum Constant Summary
Enum Constants Enum Constant Description ANTI_ENTROPYCOUNTER_MUTATIONGOSSIPIMMEDIATEINTERNAL_RESPONSEMIGRATIONMISCMUTATIONPAXOS_REPAIRREADREQUEST_RESPONSETRACINGVIEW_MUTATION
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringjmxNamebooleanshutdownBeforeCommitlogSet true if this executor should be gracefully shutdown before stopping the commitlog allocator.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanareMutationExecutorsTerminated()voidexecute(java.lang.Runnable task)voidexecute(ExecutorLocals locals, java.lang.Runnable task)ExecutorPlusexecutor()static StagefromPoolName(java.lang.String stageName)intgetCorePoolSize()Returns core thread pool sizeintgetMaximumPoolSize()Returns maximum pool size of thread pool.voidmaybeExecuteImmediately(java.lang.Runnable task)voidsetCorePoolSize(int newCorePoolSize)Allows user to resize core thread pool sizevoidsetMaximumPoolSize(int newMaximumPoolSize)Allows user to resize maximum size of the thread pool.static voidshutdownAndAwaitMutatingExecutors(boolean interrupt, long timeout, java.util.concurrent.TimeUnit units)static voidshutdownAndWait(long timeout, java.util.concurrent.TimeUnit units)static voidshutdownNow()This method shuts down all registered stages.Future<?>submit(java.lang.Runnable task)<T> Future<T>submit(java.lang.Runnable task, T result)<T> Future<T>submit(java.util.concurrent.Callable<T> task)static StagevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Stage[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
READ
public static final Stage READ
-
MUTATION
public static final Stage MUTATION
-
COUNTER_MUTATION
public static final Stage COUNTER_MUTATION
-
VIEW_MUTATION
public static final Stage VIEW_MUTATION
-
GOSSIP
public static final Stage GOSSIP
-
REQUEST_RESPONSE
public static final Stage REQUEST_RESPONSE
-
ANTI_ENTROPY
public static final Stage ANTI_ENTROPY
-
MIGRATION
public static final Stage MIGRATION
-
MISC
public static final Stage MISC
-
TRACING
public static final Stage TRACING
-
INTERNAL_RESPONSE
public static final Stage INTERNAL_RESPONSE
-
IMMEDIATE
public static final Stage IMMEDIATE
-
PAXOS_REPAIR
public static final Stage PAXOS_REPAIR
-
-
Field Detail
-
jmxName
public final java.lang.String jmxName
-
shutdownBeforeCommitlog
public final boolean shutdownBeforeCommitlog
Set true if this executor should be gracefully shutdown before stopping the commitlog allocator. Tasks on executors that issue mutations may block indefinitely waiting for a new commitlog segment, preventing a clean drain/shutdown.
-
-
Method Detail
-
values
public static Stage[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Stage c : Stage.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Stage valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
fromPoolName
public static Stage fromPoolName(java.lang.String stageName)
-
execute
public void execute(java.lang.Runnable task)
-
execute
public void execute(ExecutorLocals locals, java.lang.Runnable task)
-
maybeExecuteImmediately
public void maybeExecuteImmediately(java.lang.Runnable task)
-
submit
public <T> Future<T> submit(java.util.concurrent.Callable<T> task)
-
submit
public Future<?> submit(java.lang.Runnable task)
-
submit
public <T> Future<T> submit(java.lang.Runnable task, T result)
-
executor
public ExecutorPlus executor()
-
shutdownNow
public static void shutdownNow()
This method shuts down all registered stages.
-
shutdownAndAwaitMutatingExecutors
public static void shutdownAndAwaitMutatingExecutors(boolean interrupt, long timeout, java.util.concurrent.TimeUnit units) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.TimeoutException
-
areMutationExecutorsTerminated
public static boolean areMutationExecutorsTerminated()
-
shutdownAndWait
public static void shutdownAndWait(long timeout, java.util.concurrent.TimeUnit units) throws java.lang.InterruptedException, java.util.concurrent.TimeoutException- Throws:
java.lang.InterruptedExceptionjava.util.concurrent.TimeoutException
-
getCorePoolSize
public int getCorePoolSize()
Returns core thread pool size
-
setCorePoolSize
public void setCorePoolSize(int newCorePoolSize)
Allows user to resize core thread pool size
-
getMaximumPoolSize
public int getMaximumPoolSize()
Returns maximum pool size of thread pool.
-
setMaximumPoolSize
public void setMaximumPoolSize(int newMaximumPoolSize)
Allows user to resize maximum size of the thread pool.
-
-