public final class ClassicOperationExecutor extends Object implements OperationExecutor
OperationExecutor that schedules:
execute(Object, int, boolean) accepts an Object instead of a runnable to prevent needing to
create wrapper runnables around tasks. This is done to reduce the amount of object litter and therefor
reduce pressure on the gc.
There are 2 category of operation threads:
| Modifier and Type | Field and Description |
|---|---|
static int |
TERMINATION_TIMEOUT_SECONDS |
| Constructor and Description |
|---|
ClassicOperationExecutor(GroupProperties properties,
LoggingService loggerService,
Address thisAddress,
OperationRunnerFactory operationRunnerFactory,
HazelcastThreadGroup hazelcastThreadGroup,
NodeExtension nodeExtension,
MetricsRegistry metricsRegistry) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Operation op)
Executes an Operation.
|
void |
execute(Packet packet)
Executes a Operation packet
|
void |
execute(PartitionSpecificRunnable task)
Executes a PartitionSpecificRunnable.
|
OperationRunner[] |
getGenericOperationRunners()
Gets all the generic operation handlers.
|
int |
getGenericOperationThreadCount() |
int |
getOperationExecutorQueueSize() |
OperationRunner[] |
getPartitionOperationRunners()
Gets all the operation handlers for the partitions.
|
int |
getPartitionOperationThreadCount() |
int |
getPriorityOperationExecutorQueueSize() |
int |
getRunningOperationCount() |
void |
interruptAllPartitionThreads()
Interrupts all partition threads.
|
boolean |
isAllowedToRunInCurrentThread(Operation op)
Checks if the operation is allowed to run on the current thread.
|
boolean |
isInvocationAllowedFromCurrentThread(Operation op,
boolean isAsync)
Checks this operation can be invoked from the current thread.
|
boolean |
isOperationThread()
Checks if the current thread is an operation thread.
|
void |
runOnAllPartitionThreads(Runnable task)
Executes the task on all partition operation threads.
|
void |
runOnCallingThread(Operation operation)
Runs the operation on the calling thread.
|
void |
runOnCallingThreadIfPossible(Operation op)
Tries to run the operation on the calling thread if possible.
|
void |
shutdown()
Shuts down this OperationExecutor.
|
void |
start() |
int |
toPartitionThreadIndex(int partitionId) |
String |
toString() |
public static final int TERMINATION_TIMEOUT_SECONDS
public ClassicOperationExecutor(GroupProperties properties, LoggingService loggerService, Address thisAddress, OperationRunnerFactory operationRunnerFactory, HazelcastThreadGroup hazelcastThreadGroup, NodeExtension nodeExtension, MetricsRegistry metricsRegistry)
public void start()
public OperationRunner[] getPartitionOperationRunners()
OperationExecutorgetPartitionOperationRunners in interface OperationExecutorpublic OperationRunner[] getGenericOperationRunners()
OperationExecutorgetGenericOperationRunners in interface OperationExecutorpublic boolean isAllowedToRunInCurrentThread(Operation op)
OperationExecutorisAllowedToRunInCurrentThread in interface OperationExecutorop - the Operation to checkpublic boolean isOperationThread()
OperationExecutorisOperationThread in interface OperationExecutorpublic boolean isInvocationAllowedFromCurrentThread(Operation op, boolean isAsync)
OperationExecutorisInvocationAllowedFromCurrentThread in interface OperationExecutorop - the Operation to checkisAsync - is the invocation async, if false invocation does not return a future to block onpublic int getRunningOperationCount()
getRunningOperationCount in interface OperationExecutorpublic int getOperationExecutorQueueSize()
getOperationExecutorQueueSize in interface OperationExecutorpublic int getPriorityOperationExecutorQueueSize()
getPriorityOperationExecutorQueueSize in interface OperationExecutorpublic int getPartitionOperationThreadCount()
getPartitionOperationThreadCount in interface OperationExecutorpublic int getGenericOperationThreadCount()
getGenericOperationThreadCount in interface OperationExecutorpublic void execute(Operation op)
OperationExecutorexecute in interface OperationExecutorop - the operation to execute.public void execute(PartitionSpecificRunnable task)
OperationExecutorexecute in interface OperationExecutortask - the task the execute.public void runOnCallingThreadIfPossible(Operation op)
OperationExecutorrunOnCallingThreadIfPossible in interface OperationExecutorop - the operation to run.public void runOnAllPartitionThreads(Runnable task)
OperationExecutorrunOnAllPartitionThreads in interface OperationExecutortask - the task the execute.public void interruptAllPartitionThreads()
OperationExecutorinterruptAllPartitionThreads in interface OperationExecutorpublic void execute(Packet packet)
OperationExecutorexecute in interface OperationExecutorpacket - the packet to execute.public void runOnCallingThread(Operation operation)
OperationExecutorrunOnCallingThread in interface OperationExecutoroperation - the operation to run.public int toPartitionThreadIndex(int partitionId)
public void shutdown()
OperationExecutorshutdown in interface OperationExecutorCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.