Class ReplicaCursor

    • Constructor Detail

      • ReplicaCursor

        public ReplicaCursor​(DBCursor<UpdateMsg> cursor,
                             CSN offlineCSN,
                             ReplicaId replicaId,
                             ReplicationDomainDB domainDB)
        Creates a ReplicaCursor object with a cursor to decorate and an offlineCSN to return as part of a ReplicaOfflineMsg.
        Parameters:
        cursor - the non-null underlying cursor that needs to be exhausted before we return a ReplicaOfflineMsg
        offlineCSN - the offline CSN from which to builder the ReplicaOfflineMsg to return
        replicaId - the replica identifier
        domainDB - the DB for the provided replication domain
    • Method Detail

      • setOfflineCSN

        public void setOfflineCSN​(CSN offlineCSN)
        Sets the offline CSN to be returned by this cursor.
        Parameters:
        offlineCSN - The offline CSN to be returned by this cursor. If null, it will unset any previous offlineCSN and never return a ReplicaOfflineMsg
      • getReplicaId

        public ReplicaId getReplicaId()
        Returns the replica identifier that this cursor is associated to.
        Returns:
        the replica identifier that this cursor is associated to
      • close

        public void close()
        Description copied from interface: DBCursor
        Release the resources and locks used by this Iterator. This method must be called when the iterator is no longer used. Failure to do it could cause DB deadlock.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface DBCursor<UpdateMsg>