Interface ReplicationOperation.Primary<RequestT extends ReplicationRequest<RequestT>,​ReplicaRequestT extends ReplicationRequest<ReplicaRequestT>,​PrimaryResultT extends ReplicationOperation.PrimaryResult<ReplicaRequestT>>

    • Method Detail

      • routingEntry

        ShardRouting routingEntry()
        routing entry for this primary
      • failShard

        void failShard​(java.lang.String message,
                       java.lang.Exception exception)
        Fail the primary shard.
        message - the failure message
        exception - the exception that triggered the failure
      • perform

        PrimaryResultT perform​(RequestT request)
                        throws java.lang.Exception
        Performs 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.
        request - the request to perform
        the request to send to the replicas
      • updateLocalCheckpointForShard

        void updateLocalCheckpointForShard​(java.lang.String allocationId,
                                           long checkpoint)
        Notifies the primary of a local checkpoint for the given allocation. Note: The primary will use this information to advance the global checkpoint if possible.
        allocationId - allocation ID of the shard corresponding to the supplied local checkpoint
        checkpoint - the *local* checkpoint for the shard
      • updateGlobalCheckpointForShard

        void updateGlobalCheckpointForShard​(java.lang.String allocationId,
                                            long globalCheckpoint)
        Update the local knowledge of the global checkpoint for the specified allocation ID.
        allocationId - the allocation ID to update the global checkpoint for
        globalCheckpoint - the global checkpoint
      • localCheckpoint

        long localCheckpoint()
        Returns the local checkpoint on the primary shard.
        the local checkpoint
      • globalCheckpoint

        long globalCheckpoint()
        Returns the global checkpoint on the primary shard.
        the global checkpoint
      • maxSeqNoOfUpdatesOrDeletes

        long 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.
      • getReplicationGroup

        ReplicationGroup getReplicationGroup()
        Returns the current replication group on the primary shard
        the replication group