public final class OperationServiceImpl extends Object implements InternalOperationService, PacketHandler
InternalOperationService.
UrgentSystemOperation is invoked on this OperationService, it will be executed with a
high urgency by making use of a urgent queue. So when the system is under load, and the operation queues are
filled, then system operations are executed before normal operation. The advantage is that when a system is under
pressure, it still is able to do things like recognizing new members in the cluster and moving partitions around.
When a UrgentSystemOperation is send to a remote machine, it is wrapped in a Packet and the packet is marked as a
urgent packet. When this packet is received on the remove OperationService, the urgent flag is checked and if
needed, the operation is set on the urgent queue. So local and remote execution of System operations will obey
the urgency.Invocation,
InvocationBuilderImpl,
PartitionInvocation,
TargetInvocation| Constructor and Description |
|---|
OperationServiceImpl(NodeEngineImpl nodeEngine) |
| Modifier and Type | Method and Description |
|---|---|
<V> void |
asyncInvokeOnPartition(String serviceName,
Operation op,
int partitionId,
ExecutionCallback<V> callback) |
InvocationBuilder |
createInvocationBuilder(String serviceName,
Operation op,
Address target) |
InvocationBuilder |
createInvocationBuilder(String serviceName,
Operation op,
int partitionId) |
void |
dumpPerformanceMetrics(StringBuffer sb)
Dumps all kinds of metrics: for example, performance.
|
void |
execute(PartitionSpecificRunnable task)
Executes a PartitionSpecificRunnable.
|
void |
executeOperation(Operation op)
Executes an operation in the operation executor pool.
|
long |
getExecutedOperationCount()
This methods is deprecated since 3.5.
|
int |
getGenericOperationThreadCount()
This methods is deprecated since 3.5.
|
InvocationRegistry |
getInvocationsRegistry() |
IsStillRunningService |
getIsStillRunningService() |
OperationExecutor |
getOperationExecutor() |
int |
getOperationExecutorQueueSize()
This methods is deprecated since 3.5.
|
int |
getPartitionOperationThreadCount()
This methods is deprecated since 3.5.
|
int |
getPriorityOperationExecutorQueueSize()
This methods is deprecated since 3.5.
|
int |
getRemoteOperationsCount()
This methods is deprecated since 3.5.
|
int |
getResponseQueueSize()
This methods is deprecated since 3.5.
|
int |
getRunningOperationsCount()
This methods is deprecated since 3.5.
|
List<SlowOperationDTO> |
getSlowOperationDTOs()
Returns information about long running operations.
|
void |
handle(Packet packet)
Signals the PacketHandler that there is a packet to be handled.
|
Map<Integer,Object> |
invokeOnAllPartitions(String serviceName,
OperationFactory operationFactory)
Invokes a set of operation on each partition.
|
<E> InternalCompletableFuture<E> |
invokeOnPartition(String serviceName,
Operation op,
int partitionId) |
Map<Integer,Object> |
invokeOnPartitions(String serviceName,
OperationFactory operationFactory,
Collection<Integer> partitions)
Invokes an set of operation on selected set of partitions
*
This method blocks until all operations complete.
|
<E> InternalCompletableFuture<E> |
invokeOnTarget(String serviceName,
Operation op,
Address target) |
boolean |
isAllowedToRunOnCallingThread(Operation op)
Returns true if the given operation is allowed to run on the calling thread, false otherwise.
|
boolean |
isCallTimedOut(Operation op)
Checks if this call is timed out.
|
void |
onMemberLeft(MemberImpl member) |
void |
reset() |
void |
runOperationOnCallingThread(Operation op)
Runs an operation in the calling thread.
|
boolean |
send(Operation op,
Address target)
Executes an operation remotely.
|
boolean |
send(Response response,
Address target)
Sends a response to a remote machine.
|
void |
shutdown() |
void |
start() |
public OperationServiceImpl(NodeEngineImpl nodeEngine)
public void start()
public IsStillRunningService getIsStillRunningService()
public void dumpPerformanceMetrics(StringBuffer sb)
OperationServicedumpPerformanceMetrics in interface OperationServicepublic List<SlowOperationDTO> getSlowOperationDTOs()
InternalOperationServicegetSlowOperationDTOs in interface InternalOperationServiceSlowOperationDTO instances.public InvocationRegistry getInvocationsRegistry()
public int getPartitionOperationThreadCount()
OperationServicegetPartitionOperationThreadCount in interface OperationServicepublic int getGenericOperationThreadCount()
OperationServicegetGenericOperationThreadCount in interface OperationServicepublic int getRunningOperationsCount()
OperationServicegetRunningOperationsCount in interface OperationServicepublic long getExecutedOperationCount()
OperationServicegetExecutedOperationCount in interface OperationServicepublic int getRemoteOperationsCount()
OperationServicegetRemoteOperationsCount in interface OperationServicepublic int getOperationExecutorQueueSize()
OperationServicegetOperationExecutorQueueSize in interface OperationServicepublic int getPriorityOperationExecutorQueueSize()
OperationServicegetPriorityOperationExecutorQueueSize in interface OperationServicepublic OperationExecutor getOperationExecutor()
public int getResponseQueueSize()
OperationServicegetResponseQueueSize in interface OperationServicepublic void handle(Packet packet) throws Exception
PacketHandlerhandle in interface PacketHandlerpacket - the response packet to handleExceptionpublic void execute(PartitionSpecificRunnable task)
InternalOperationServiceClientEngine when it has received a Packet containing
a request that needs to be processed.execute in interface InternalOperationServicetask - the task to executepublic InvocationBuilder createInvocationBuilder(String serviceName, Operation op, int partitionId)
createInvocationBuilder in interface OperationServicepublic InvocationBuilder createInvocationBuilder(String serviceName, Operation op, Address target)
createInvocationBuilder in interface OperationServicepublic void runOperationOnCallingThread(Operation op)
OperationServicerunOperationOnCallingThread in interface OperationServiceop - the operation to execute in the calling threadpublic void executeOperation(Operation op)
OperationServiceexecuteOperation in interface OperationServiceop - the operation to execute in the operation executor pool.public boolean isAllowedToRunOnCallingThread(Operation op)
OperationServiceOperationService.runOperationOnCallingThread(Operation)
method, otherwise OperationService.executeOperation(Operation) should be used.isAllowedToRunOnCallingThread in interface OperationServiceop - the operation to check.public <E> InternalCompletableFuture<E> invokeOnPartition(String serviceName, Operation op, int partitionId)
invokeOnPartition in interface OperationServicepublic <E> InternalCompletableFuture<E> invokeOnTarget(String serviceName, Operation op, Address target)
invokeOnTarget in interface OperationServicepublic <V> void asyncInvokeOnPartition(String serviceName, Operation op, int partitionId, ExecutionCallback<V> callback)
asyncInvokeOnPartition in interface InternalOperationServicepublic boolean isCallTimedOut(Operation op)
InternalOperationServiceisCallTimedOut in interface InternalOperationServiceop - the operation to check.public Map<Integer,Object> invokeOnAllPartitions(String serviceName, OperationFactory operationFactory) throws Exception
OperationServiceinvokeOnAllPartitions in interface OperationServiceserviceName - the name of the service.operationFactory - the factory responsible for creating operationsExceptionpublic Map<Integer,Object> invokeOnPartitions(String serviceName, OperationFactory operationFactory, Collection<Integer> partitions) throws Exception
OperationServiceinvokeOnPartitions in interface OperationServiceserviceName - the name of the serviceoperationFactory - the factory responsible for creating operationspartitions - the partitions the operation should be executed on.Exceptionpublic boolean send(Operation op, Address target)
OperationServicesend in interface OperationServiceop - the operation to send and execute.target - the address of that target member.public boolean send(Response response, Address target)
OperationServiceInternalOperationService.send in interface OperationServiceresponse - the response to send.target - the address of the target machinepublic void onMemberLeft(MemberImpl member)
public void reset()
public void shutdown()
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.