public interface OperationExecutor
Executor
with the big difference that it is designed for assigning packets,
operations and PartitionSpecificRunnable to a thread instead of only runnables.
It depends on the implementation if an operation is executed on the calling thread or not. For example the
ClassicOperationExecutor
will always offload a partition specific
Operation to the correct partition-operation-thread.
The actual processing of a operation-packet, Operation, or a PartitionSpecificRunnable is forwarded to the
OperationRunner
.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()
Deprecated.
|
int |
getOperationExecutorQueueSize()
Deprecated.
|
OperationRunner[] |
getPartitionOperationRunners()
Gets all the operation handlers for the partitions.
|
int |
getPartitionOperationThreadCount()
Deprecated.
|
int |
getPriorityOperationExecutorQueueSize()
Deprecated.
|
int |
getRunningOperationCount()
Deprecated.
|
void |
interruptAllPartitionThreads()
Interrupts all partition threads.
|
boolean |
isAllowedToRunInCurrentThread(Operation op)
Deprecated.
|
boolean |
isInvocationAllowedFromCurrentThread(Operation op,
boolean isAsync)
Checks this operation can be invoked from the current thread.
|
boolean |
isOperationThread()
Deprecated.
it should not matter if a thread is an operation thread or not; this is something operationExecutor specific.
|
void |
runOnAllPartitionThreads(Runnable task)
Executes the task on all partition operation threads.
|
void |
runOnCallingThread(Operation op)
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.
|
@Deprecated int getRunningOperationCount()
@Deprecated int getOperationExecutorQueueSize()
@Deprecated int getPriorityOperationExecutorQueueSize()
@Deprecated int getPartitionOperationThreadCount()
@Deprecated int getGenericOperationThreadCount()
OperationRunner[] getPartitionOperationRunners()
OperationRunner[] getGenericOperationRunners()
void execute(Operation op)
op
- the operation to execute.NullPointerException
- if op is null.void execute(PartitionSpecificRunnable task)
task
- the task the execute.NullPointerException
- if task is null.void execute(Packet packet)
packet
- the packet to execute.NullPointerException
- if packet is nullvoid runOnCallingThread(Operation op)
op
- the operation to run.NullPointerException
- if op is null.IllegalThreadStateException
- if the operation is not allowed to be run on the calling thread.void runOnCallingThreadIfPossible(Operation op)
op
- the operation to run.NullPointerException
- if op is null.void runOnAllPartitionThreads(Runnable task)
task
- the task the execute.NullPointerException
- if task is null.void interruptAllPartitionThreads()
@Deprecated boolean isAllowedToRunInCurrentThread(Operation op)
op
- the Operation to checkNullPointerException
- if op is null.boolean isOperationThread()
boolean isInvocationAllowedFromCurrentThread(Operation op, boolean isAsync)
op
- the Operation to checkisAsync
- is the invocation async, if false invocation does not return a future to block onvoid shutdown()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.