public class PromotionCommitOperation extends Operation implements MigrationCycleOperation
beforeStateCompleted
property. First it invokes
BeforePromotionOperation
s for every promoted partition. After all operations return it will reschedule itself
and finalize the promotions by sending FinalizePromotionOperation
for every promotion.GENERIC_PARTITION_ID
Constructor and Description |
---|
PromotionCommitOperation() |
PromotionCommitOperation(PartitionRuntimeState partitionState,
Collection<MigrationInfo> promotions,
String expectedMemberUuid) |
Modifier and Type | Method and Description |
---|---|
void |
afterRun() |
void |
beforeRun() |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
Object |
getResponse()
Called if and only if
Operation.returnsResponse() returned true , shortly after Operation.run()
returns. |
String |
getServiceName() |
void |
onExecutionFailure(Throwable e)
Called when an Exception/Error is thrown during operation execution.
|
ExceptionAction |
onInvocationException(Throwable throwable)
Called when an Exception/Error is thrown
during an invocation.
|
protected void |
readInternal(ObjectDataInput in) |
boolean |
returnsResponse()
Method is intended to be subclassed.
|
void |
run() |
protected void |
writeInternal(ObjectDataOutput out) |
call, executedLocally, getCallerAddress, getCallerUuid, getCallId, getCallTimeout, getConnection, getInvocationTime, getLogger, getNodeEngine, getOperationResponseHandler, getPartitionId, getReplicaIndex, getService, getWaitTimeout, isUrgent, logError, onSetCallId, readData, sendResponse, setCallerUuid, setNodeEngine, setOperationResponseHandler, setPartitionId, setReplicaIndex, setService, setServiceName, setValidateTarget, setWaitTimeout, toString, toString, validatesTarget, writeData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
readData, writeData
public PromotionCommitOperation()
public PromotionCommitOperation(PartitionRuntimeState partitionState, Collection<MigrationInfo> promotions, String expectedMemberUuid)
public void beforeRun() throws Exception
public void afterRun() throws Exception
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public boolean returnsResponse()
Operation
true
, Operation.getResponse()
will be
called right after Operation.run()
method. If it returns false
, Operation.sendResponse(Object)
must be called later to finish the operation.
In other words, true
is for synchronous operation and false
is for asynchronous one.
Default implementation is synchronous operation (true
).
returnsResponse
in class Operation
public Object getResponse()
Operation
Operation.returnsResponse()
returned true
, shortly after Operation.run()
returns.getResponse
in class Operation
public String getServiceName()
getServiceName
in class Operation
public ExceptionAction onInvocationException(Throwable throwable)
Operation
onInvocationException
in class Operation
throwable
- Exception/Error thrown during invocationpublic void onExecutionFailure(Throwable e)
Operation
onExecutionFailure
in class Operation
e
- Exception/Error thrown during operation executionprotected void readInternal(ObjectDataInput in) throws IOException
readInternal
in class Operation
IOException
protected void writeInternal(ObjectDataOutput out) throws IOException
writeInternal
in class Operation
IOException
public final int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.