com.hazelcast.spi
Interface OperationService

All Known Subinterfaces:
InternalOperationService
All Known Implementing Classes:
OperationServiceImpl

public interface OperationService

The OperationService is responsible for executing operations.

A single operation can be executed locally using runOperationOnCallingThread(Operation) and executeOperation(Operation). Or it can executed remotely using one of the send methods.

It also is possible to execute multiple operation on multiple partitions using one of the invoke methods.


Method Summary
 InvocationBuilder createInvocationBuilder(String serviceName, Operation op, Address target)
           
 InvocationBuilder createInvocationBuilder(String serviceName, Operation op, int partitionId)
           
 void dumpPerformanceMetrics(StringBuffer sb)
          Deprecated. 
 void executeOperation(Operation op)
          Executes an operation in the operation executor pool.
 long getExecutedOperationCount()
          Deprecated. 
 int getGenericOperationThreadCount()
          Deprecated. 
 int getOperationExecutorQueueSize()
          Deprecated. 
 int getPartitionOperationThreadCount()
          Deprecated. 
 int getPriorityOperationExecutorQueueSize()
          Deprecated. 
 int getRemoteOperationsCount()
          Deprecated. 
 int getResponseQueueSize()
          Deprecated. 
 int getRunningOperationsCount()
          Deprecated. 
 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)
          Deprecated. since 3.5 since not needed anymore.
 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)
          Deprecated. 
 

Method Detail

getResponseQueueSize

@Deprecated
int getResponseQueueSize()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getOperationExecutorQueueSize

@Deprecated
int getOperationExecutorQueueSize()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getPriorityOperationExecutorQueueSize

@Deprecated
int getPriorityOperationExecutorQueueSize()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getRunningOperationsCount

@Deprecated
int getRunningOperationsCount()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getRemoteOperationsCount

@Deprecated
int getRemoteOperationsCount()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getPartitionOperationThreadCount

@Deprecated
int getPartitionOperationThreadCount()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getGenericOperationThreadCount

@Deprecated
int getGenericOperationThreadCount()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


getExecutedOperationCount

@Deprecated
long getExecutedOperationCount()
Deprecated. 

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


dumpPerformanceMetrics

@Deprecated
void dumpPerformanceMetrics(StringBuffer sb)
Deprecated. 

Dumps all kinds of metrics: for example, performance. This can be used for performance analysis. In the future we'll have a more formal (such as map with key/value pairs) information.

This methods is deprecated since 3.5. This feature will be dropped since it is an internal implementation detail and should not directly be exposed the the SPI user.


runOperationOnCallingThread

void runOperationOnCallingThread(Operation op)
Runs an operation in the calling thread.

Parameters:
op - the operation to execute in the calling thread

executeOperation

void executeOperation(Operation op)
Executes an operation in the operation executor pool.

Parameters:
op - the operation to execute in the operation executor pool.

isAllowedToRunOnCallingThread

@Deprecated
boolean isAllowedToRunOnCallingThread(Operation op)
Deprecated. since 3.5 since not needed anymore.

Returns true if the given operation is allowed to run on the calling thread, false otherwise. If this method returns true, then the operation can be executed using runOperationOnCallingThread(Operation) method, otherwise executeOperation(Operation) should be used.

Parameters:
op - the operation to check.
Returns:
true if the operation is allowed to run on the calling thread, false otherwise.

invokeOnPartition

<E> InternalCompletableFuture<E> invokeOnPartition(String serviceName,
                                                   Operation op,
                                                   int partitionId)

invokeOnTarget

<E> InternalCompletableFuture<E> invokeOnTarget(String serviceName,
                                                Operation op,
                                                Address target)

createInvocationBuilder

InvocationBuilder createInvocationBuilder(String serviceName,
                                          Operation op,
                                          int partitionId)

createInvocationBuilder

InvocationBuilder createInvocationBuilder(String serviceName,
                                          Operation op,
                                          Address target)

invokeOnAllPartitions

Map<Integer,Object> invokeOnAllPartitions(String serviceName,
                                          OperationFactory operationFactory)
                                          throws Exception
Invokes a set of operation on each partition.

This method blocks until the operation completes.

Parameters:
serviceName - the name of the service.
operationFactory - the factory responsible for creating operations
Returns:
a Map with partitionId as key and the outcome of the operation as value.
Throws:
Exception

invokeOnPartitions

Map<Integer,Object> invokeOnPartitions(String serviceName,
                                       OperationFactory operationFactory,
                                       Collection<Integer> partitions)
                                       throws Exception
Invokes an set of operation on selected set of partitions *

This method blocks until all operations complete.

Parameters:
serviceName - the name of the service
operationFactory - the factory responsible for creating operations
partitions - the partitions the operation should be executed on.
Returns:
a Map with partitionId as key and the outcome of the operation as value.
Throws:
Exception

send

boolean send(Operation op,
             Address target)
Executes an operation remotely.

It isn't allowed

Parameters:
op - the operation to send and execute.
target - the address of that target member.
Returns:
true if send is successful, false otherwise.

send

@Deprecated
boolean send(Response response,
                        Address target)
Deprecated. 

Sends a response to a remote machine.

This methods is deprecated since 3.5. It is an implementation detail, so it is moved to the InternalOperationService.

Parameters:
response - the response to send.
target - the address of the target machine
Returns:
true if send is successful, false otherwise.


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.