public static interface ReplicationOperation.Primary<RequestT extends ReplicationRequest<RequestT>,ReplicaRequestT extends ReplicationRequest<ReplicaRequestT>,PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequestT>>
Modifier and Type | Method | Description |
---|---|---|
void |
failShard(java.lang.String message,
java.lang.Exception exception) |
Fail the primary shard.
|
ReplicationGroup |
getReplicationGroup() |
Returns the current replication group on the primary shard
|
long |
globalCheckpoint() |
Returns the global checkpoint on the primary shard.
|
long |
localCheckpoint() |
Returns the local checkpoint on the primary shard.
|
PrimaryResultT |
perform(RequestT request) |
Performs the given request on this primary.
|
ShardRouting |
routingEntry() |
routing entry for this primary
|
void |
updateGlobalCheckpointForShard(java.lang.String allocationId,
long globalCheckpoint) |
Update the local knowledge of the global checkpoint for the specified allocation ID.
|
void |
updateLocalCheckpointForShard(java.lang.String allocationId,
long checkpoint) |
Notifies the primary of a local checkpoint for the given allocation.
|
ShardRouting routingEntry()
void failShard(java.lang.String message, java.lang.Exception exception)
message
- the failure messageexception
- the exception that triggered the failurePrimaryResultT perform(RequestT request) throws java.lang.Exception
request
- the request to performjava.lang.Exception
void updateLocalCheckpointForShard(java.lang.String allocationId, long checkpoint)
allocationId
- allocation ID of the shard corresponding to the supplied local checkpointcheckpoint
- the *local* checkpoint for the shardvoid updateGlobalCheckpointForShard(java.lang.String allocationId, long globalCheckpoint)
allocationId
- the allocation ID to update the global checkpoint forglobalCheckpoint
- the global checkpointlong localCheckpoint()
long globalCheckpoint()
ReplicationGroup getReplicationGroup()