com.hazelcast.spi.impl.operationexecutor
Interface OperationRunnerFactory


public interface OperationRunnerFactory

A Factory for creating OperationRunner instances.


Method Summary
 OperationRunner createAdHocRunner()
          Creates an ad hoc generic OperationRunner.
 OperationRunner createGenericRunner()
          Creates an OperationRunner to execute generic Operations.
 OperationRunner createPartitionRunner(int partitionId)
          Creates an OperationRunner for a given partition.
 

Method Detail

createPartitionRunner

OperationRunner createPartitionRunner(int partitionId)
Creates an OperationRunner for a given partition. This OperationRunner will only execute generic operations and operations for that given partition.

Parameters:
partitionId - the id of the partition.
Returns:
the created OperationRunner.

createGenericRunner

OperationRunner createGenericRunner()
Creates an OperationRunner to execute generic Operations.

Returns:
the created OperationRunner

createAdHocRunner

OperationRunner createAdHocRunner()
Creates an ad hoc generic OperationRunner. Why do we need ad-hoc operation runners; why not use the generic ones? The problem is that within Operations can be executed directly on the calling thread and totally bypassing the generic threads. The problem is that for these kinds of 'ad hoc' executions, you need to have a OperationRunner. The ad hoc OperationRunner can be used for these ad hoc executions. It is immutable and won't expose the OperationRunner.currentTask(). Therefor it is save to be shared between threads without running into problems.

Returns:
the created ad hoc OperationRunner.
See Also:
OperationService.runOperationOnCallingThread(com.hazelcast.spi.Operation)


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