public abstract class InvocationBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected Callback<Object> |
callback |
protected long |
callTimeout |
static long |
DEFAULT_CALL_TIMEOUT
Default call timeout.
|
static boolean |
DEFAULT_DESERIALIZE_RESULT
If the result of an operation automatically should be deserialized to an object.
|
static int |
DEFAULT_REPLICA_INDEX
Default replica index.
|
static int |
DEFAULT_TRY_COUNT
Default try count.
|
static long |
DEFAULT_TRY_PAUSE_MILLIS
Default try pause in millis.
|
protected String |
executorName |
protected NodeEngineImpl |
nodeEngine |
protected Operation |
op |
protected int |
partitionId |
protected int |
replicaIndex |
protected boolean |
resultDeserialized |
protected String |
serviceName |
protected Address |
target |
protected int |
tryCount |
protected long |
tryPauseMillis |
Constructor and Description |
---|
InvocationBuilder(NodeEngineImpl nodeEngine,
String serviceName,
Operation op,
int partitionId,
Address target)
Creates an InvocationBuilder
|
Modifier and Type | Method and Description |
---|---|
Callback |
getCallback() |
long |
getCallTimeout() |
String |
getExecutorName()
Gets the name of the Executor to use.
|
Operation |
getOp() |
int |
getPartitionId() |
int |
getReplicaIndex() |
String |
getServiceName() |
Address |
getTarget() |
int |
getTryCount() |
long |
getTryPauseMillis() |
abstract InternalCompletableFuture |
invoke() |
boolean |
isResultDeserialized()
Checks if the Future should automatically deserialize the result.
|
InvocationBuilder |
setCallback(Callback<Object> callback) |
InvocationBuilder |
setCallTimeout(long callTimeout) |
InvocationBuilder |
setExecutorName(String executorName)
Sets the executor name.
|
InvocationBuilder |
setReplicaIndex(int replicaIndex)
Sets the replicaIndex
|
InvocationBuilder |
setResultDeserialized(boolean resultDeserialized)
Sets the automatic deserialized option for the result.
|
InvocationBuilder |
setTryCount(int tryCount)
Sets the try count; the number of times this operation can be retried.
|
InvocationBuilder |
setTryPauseMillis(long tryPauseMillis)
Sets the pause time in millis.
|
public static final long DEFAULT_CALL_TIMEOUT
public static final int DEFAULT_REPLICA_INDEX
public static final int DEFAULT_TRY_COUNT
public static final long DEFAULT_TRY_PAUSE_MILLIS
public static final boolean DEFAULT_DESERIALIZE_RESULT
protected final NodeEngineImpl nodeEngine
protected final String serviceName
protected final Operation op
protected final int partitionId
protected final Address target
protected long callTimeout
protected int replicaIndex
protected int tryCount
protected long tryPauseMillis
protected String executorName
protected boolean resultDeserialized
public InvocationBuilder(NodeEngineImpl nodeEngine, String serviceName, Operation op, int partitionId, Address target)
nodeEngine
- the nodeEngineserviceName
- the name of the serviceop
- the operation to executepartitionId
- the id of the partition to execute the operation ontarget
- the target machine. Either the partitionId or the target needs to be set.public String getExecutorName()
public InvocationBuilder setExecutorName(String executorName)
executorName
- the name of the executor.public InvocationBuilder setReplicaIndex(int replicaIndex)
replicaIndex
- IllegalArgumentException
- if replicaIndex smaller than 0 or larger than the max replica count.public boolean isResultDeserialized()
Data
to be returned, but the deserialized object. But in some
cases you want to get the raw Data object.
Defaults to true.public InvocationBuilder setResultDeserialized(boolean resultDeserialized)
resultDeserialized
- true if dataisResultDeserialized()
public InvocationBuilder setTryCount(int tryCount)
tryCount
- the try count.public InvocationBuilder setTryPauseMillis(long tryPauseMillis)
tryPauseMillis
- the pause time in millis.public InvocationBuilder setCallTimeout(long callTimeout)
public String getServiceName()
public Operation getOp()
public int getReplicaIndex()
public int getTryCount()
public long getTryPauseMillis()
public Address getTarget()
public int getPartitionId()
public long getCallTimeout()
public Callback getCallback()
public InvocationBuilder setCallback(Callback<Object> callback)
public abstract InternalCompletableFuture invoke()
Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.