public abstract class InvocationBuilder extends Object
Modifier and Type | Field and Description |
---|---|
protected long |
callTimeout |
static long |
DEFAULT_CALL_TIMEOUT
Default call timeout.
|
static boolean |
DEFAULT_DESERIALIZE_RESULT
True that 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 milliseconds.
|
protected Runnable |
doneCallback |
protected ExecutionCallback<Object> |
executionCallback |
protected boolean |
failOnIndeterminateOperationState |
protected Operation |
op |
protected int |
partitionId |
protected int |
replicaIndex |
protected boolean |
resultDeserialized |
protected String |
serviceName |
protected Address |
target |
protected int |
tryCount |
protected long |
tryPauseMillis |
Modifier | Constructor and Description |
---|---|
protected |
InvocationBuilder(String serviceName,
Operation op,
int partitionId,
Address target)
Creates an InvocationBuilder
|
Modifier and Type | Method and Description |
---|---|
long |
getCallTimeout() |
ExecutionCallback<Object> |
getExecutionCallback()
Gets the ExecutionCallback.
|
Operation |
getOp()
Gets the operation to execute.
|
int |
getPartitionId()
Returns the partition ID.
|
int |
getReplicaIndex()
Gets the replicaIndex.
|
String |
getServiceName()
Gets the name of the service.
|
Address |
getTarget()
Returns the target machine.
|
protected ExecutionCallback |
getTargetExecutionCallback() |
int |
getTryCount()
Gets the try count; the number of times this operation can be retried.
|
long |
getTryPauseMillis()
Gets the pause time in milliseconds.
|
abstract <E> InternalCompletableFuture<E> |
invoke() |
boolean |
isResultDeserialized()
Checks if the Future should automatically deserialize the result.
|
InvocationBuilder |
setCallTimeout(long callTimeout) |
InvocationBuilder |
setDoneCallback(Runnable doneCallback)
Sets a callback that will respond to the "task done" event for the invocation this builder is about to create.
|
InvocationBuilder |
setExecutionCallback(ExecutionCallback<Object> executionCallback)
Sets the ExecutionCallback.
|
InvocationBuilder |
setFailOnIndeterminateOperationState(boolean failOnIndeterminateOperationState)
Enables / disables throwing
IndeterminateOperationStateException for this invocation. |
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 milliseconds.
|
boolean |
shouldFailOnIndeterminateOperationState()
Returns true if
IndeterminateOperationStateException is enabled for this invocation |
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 String serviceName
protected final Operation op
protected final int partitionId
protected final Address target
protected ExecutionCallback<Object> executionCallback
protected Runnable doneCallback
protected long callTimeout
protected int replicaIndex
protected int tryCount
protected long tryPauseMillis
protected boolean resultDeserialized
protected boolean failOnIndeterminateOperationState
protected InvocationBuilder(String serviceName, Operation op, int partitionId, Address target)
serviceName
- the name of the serviceop
- the operation to executepartitionId
- the ID of the partition upon which to execute the operationtarget
- the target machine. Either the partitionId or the target needs to be set.public InvocationBuilder setReplicaIndex(int replicaIndex)
replicaIndex
- the replica indexIllegalArgumentException
- 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; the number of times this operation can be retriedpublic boolean shouldFailOnIndeterminateOperationState()
IndeterminateOperationStateException
is enabled for this invocationIndeterminateOperationStateException
is enabled for this invocationpublic InvocationBuilder setFailOnIndeterminateOperationState(boolean failOnIndeterminateOperationState)
IndeterminateOperationStateException
for this invocation.
Can be used only for partition invocationsIndeterminateOperationStateException
public InvocationBuilder setTryPauseMillis(long tryPauseMillis)
tryPauseMillis
- the pause time in milliseconds.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 ExecutionCallback<Object> getExecutionCallback()
public InvocationBuilder setExecutionCallback(ExecutionCallback<Object> executionCallback)
executionCallback
- the new ExecutionCallback. If null is passed, the ExecutionCallback is unset.protected ExecutionCallback getTargetExecutionCallback()
public InvocationBuilder setDoneCallback(Runnable doneCallback)
public abstract <E> InternalCompletableFuture<E> invoke()
Copyright © 2018 Hazelcast, Inc.. All rights reserved.