public abstract class PartitionAwareOperationFactory extends Object implements OperationFactory
Intended to be used by PartitionIteratingOperation
.
Modifier and Type | Field and Description |
---|---|
protected int[] |
partitions
Partition-operations will be created for these partition IDs.
|
Constructor and Description |
---|
PartitionAwareOperationFactory() |
Modifier and Type | Method and Description |
---|---|
PartitionAwareOperationFactory |
createFactoryOnRunner(NodeEngine nodeEngine)
This method will be called on operation runner node.
|
Operation |
createOperation()
Creates the operation.
|
abstract Operation |
createPartitionOperation(int partition)
This method can be called both caller and runner nodes.
|
int[] |
getPartitions()
This method will be called on operation runner node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFactoryId, getId
readData, writeData
protected int[] partitions
public PartitionAwareOperationFactory createFactoryOnRunner(NodeEngine nodeEngine)
If PartitionAwareOperationFactory
needs to have runner-side state different from caller-side one,
this method can be used to create it. Otherwise, stateful factories may cause JMM problems.
nodeEngine
- nodeEnginepublic abstract Operation createPartitionOperation(int partition)
Creates a partition-operation for supplied partition ID.
partition
- ID of partitionpublic int[] getPartitions()
Created operations by this factory will be run on the partitions returned by this method.
Returning null
means operations will be run provided partitions by default.
null
to preserve default behaviour or return relevant partition IDs for the operations of this factorypublic Operation createOperation()
OperationFactory
createOperation
in interface OperationFactory
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.