Module org.elasticsearch.server
Interface ReplicationOperation.Primary<RequestT extends ReplicationRequest<RequestT>,ReplicaRequestT extends ReplicationRequest<ReplicaRequestT>,PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequestT>>  
- Enclosing class:
- ReplicationOperation<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>, PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequest>> 
public static interface ReplicationOperation.Primary<RequestT extends ReplicationRequest<RequestT>,ReplicaRequestT extends ReplicationRequest<ReplicaRequestT>,PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequestT>>  
An encapsulation of an operation that is to be performed on the primary shard
- 
Method SummaryModifier and TypeMethodDescriptionlongReturns the global checkpoint computed on the primary shard.voidFail the primary shard.Returns the pending replication actions on the primary shardReturns the current replication group on the primary shardlongReturns the persisted global checkpoint on the primary shard.longReturns the persisted local checkpoint on the primary shard.longReturns the maximum seq_no of updates (index operations overwrite Lucene) or deletes on the primary.voidperform(RequestT request, ActionListener<PrimaryResultT> listener) Performs the given request on this primary.routing entry for this primaryvoidupdateGlobalCheckpointForShard(String allocationId, long globalCheckpoint) Update the local knowledge of the global checkpoint for the specified allocation ID.voidupdateLocalCheckpointForShard(String allocationId, long checkpoint) Notifies the primary of a local checkpoint for the given allocation.
- 
Method Details- 
routingEntryShardRouting routingEntry()routing entry for this primary
- 
failShardFail the primary shard.- Parameters:
- message- the failure message
- exception- the exception that triggered the failure
 
- 
performPerforms the given request on this primary. Yes, this returns as soon as it can with the request for the replicas and calls a listener when the primary request is completed. Yes, the primary request might complete before the method returns. Yes, it might also complete after. Deal with it.- Parameters:
- request- the request to perform
- listener- result listener
 
- 
updateLocalCheckpointForShardNotifies the primary of a local checkpoint for the given allocation. Note: The primary will use this information to advance the global checkpoint if possible.- Parameters:
- allocationId- allocation ID of the shard corresponding to the supplied local checkpoint
- checkpoint- the *local* checkpoint for the shard
 
- 
updateGlobalCheckpointForShardUpdate the local knowledge of the global checkpoint for the specified allocation ID.- Parameters:
- allocationId- the allocation ID to update the global checkpoint for
- globalCheckpoint- the global checkpoint
 
- 
localCheckpointlong localCheckpoint()Returns the persisted local checkpoint on the primary shard.- Returns:
- the local checkpoint
 
- 
computedGlobalCheckpointlong computedGlobalCheckpoint()Returns the global checkpoint computed on the primary shard.- Returns:
- the computed global checkpoint
 
- 
globalCheckpointlong globalCheckpoint()Returns the persisted global checkpoint on the primary shard.- Returns:
- the persisted global checkpoint
 
- 
maxSeqNoOfUpdatesOrDeleteslong maxSeqNoOfUpdatesOrDeletes()Returns the maximum seq_no of updates (index operations overwrite Lucene) or deletes on the primary. This value must be captured after the execution of a replication request on the primary is completed.
- 
getReplicationGroupReplicationGroup getReplicationGroup()Returns the current replication group on the primary shard- Returns:
- the replication group
 
- 
getPendingReplicationActionsPendingReplicationActions getPendingReplicationActions()Returns the pending replication actions on the primary shard- Returns:
- the pending replication actions
 
 
-