Class PartitionState

java.lang.Object
com.couchbase.client.dcp.state.PartitionState

public class PartitionState extends Object
Represents the individual current session state for a given partition.
  • Constructor Details

    • PartitionState

      public PartitionState()
  • Method Details

    • fromOffset

      public static PartitionState fromOffset(StreamOffset offset)
    • getCollectionsManifestUid

      public long getCollectionsManifestUid()
    • setCollectionsManifestUid

      public void setCollectionsManifestUid(long collectionsManifestUid)
    • getCollectionsManifest

      public CollectionsManifest getCollectionsManifest()
    • setCollectionsManifest

      public void setCollectionsManifest(CollectionsManifest collectionsManifest)
    • getKeyExtractor

      public KeyExtractor getKeyExtractor()
    • setKeyExtractor

      public void setKeyExtractor(KeyExtractor keyExtractor)
    • getEndSeqno

      public long getEndSeqno()
      Returns the current end sequence number.
    • getStartSeqno

      public long getStartSeqno()
      Returns the current start sequence number.
    • setStartSeqno

      public void setStartSeqno(long startSeqno, SnapshotMarker snapshot)
      Use this when initializing or resetting the partition's sequence number.
    • setStartSeqno

      public void setStartSeqno(long startSeqno)
      Use this when advancing the partition's sequence number in response to a data event.

      If there is a pending snapshot marker, it is promoted to "current" and associated with the given seqno (and with all future seqnos until the server sends another snapshot marker).

    • setEndSeqno

      public void setEndSeqno(long endSeqno)
      Allows to set the current end sequence number.
    • getFailoverLog

      public List<FailoverLogEntry> getFailoverLog()
      Returns the full failover log stored, in sorted order.
    • setFailoverLog

      public void setFailoverLog(List<FailoverLogEntry> log)
      Sets the failover log.
    • addToFailoverLog

      @Deprecated public void addToFailoverLog(long seqno, long vbuuid)
      Deprecated.
      Add a new seqno/uuid combination to the failover log.
      Parameters:
      seqno - the sequence number.
      vbuuid - the uuid for the sequence.
    • getSnapshotStartSeqno

      public long getSnapshotStartSeqno()
      Returns the current snapshot start sequence number.
    • setSnapshotStartSeqno

      @Deprecated public void setSnapshotStartSeqno(long snapshotStartSeqno)
      Deprecated.
      in favor of setSnapshot(SnapshotMarker)
      Allows to set the current snapshot start sequence number.
    • setPendingSnapshot

      public void setPendingSnapshot(SnapshotMarker snapshot)
    • getSnapshot

      public SnapshotMarker getSnapshot()
    • getSnapshotEndSeqno

      public long getSnapshotEndSeqno()
      Returns the current snapshot end sequence number.
    • setSnapshotEndSeqno

      @Deprecated public void setSnapshotEndSeqno(long snapshotEndSeqno)
      Deprecated.
      in favor of setSnapshot(SnapshotMarker)
      Allows to set the current snapshot end sequence number.
    • isAtEnd

      public boolean isAtEnd()
      Check if the current partition is at the end (start >= end seqno).
    • getLastUuid

      public long getLastUuid()
      Convenience method to get the last UUID returned on the failover log.

      Note that if the failover log is empty, 0 is sent out to indicate the start.

      The server inserts failover records into the head of the list, so the first one is the most recent.

    • getOffset

      public StreamOffset getOffset()
    • getMostRecentOpenStreamOffset

      @Nullable public StreamOffset getMostRecentOpenStreamOffset()
    • setMostRecentOpenStreamOffset

      public void setMostRecentOpenStreamOffset(@Nullable StreamOffset offset)
    • toString

      public String toString()
      Overrides:
      toString in class Object