Package com.couchbase.client.dcp.state
Class PartitionState
java.lang.Object
com.couchbase.client.dcp.state.PartitionState
Represents the individual current session state for a given partition.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToFailoverLog(long seqno, long vbuuid) Deprecated.static PartitionStatefromOffset(StreamOffset offset) longlongReturns the current end sequence number.Returns the full failover log stored, in sorted order.longConvenience method to get the last UUID returned on the failover log.longReturns the current snapshot end sequence number.longReturns the current snapshot start sequence number.longReturns the current start sequence number.booleanisAtEnd()Check if the current partition is at the end (start >= end seqno).voidsetCollectionsManifest(CollectionsManifest collectionsManifest) voidsetCollectionsManifestUid(long collectionsManifestUid) voidsetEndSeqno(long endSeqno) Allows to set the current end sequence number.voidSets the failover log.voidsetKeyExtractor(KeyExtractor keyExtractor) voidvoidsetPendingSnapshot(SnapshotMarker snapshot) voidsetSnapshotEndSeqno(long snapshotEndSeqno) Deprecated.in favor ofsetSnapshot(SnapshotMarker)voidsetSnapshotStartSeqno(long snapshotStartSeqno) Deprecated.in favor ofsetSnapshot(SnapshotMarker)voidsetStartSeqno(long startSeqno) Use this when advancing the partition's sequence number in response to a data event.voidsetStartSeqno(long startSeqno, SnapshotMarker snapshot) Use this when initializing or resetting the partition's sequence number.toString()
-
Constructor Details
-
PartitionState
public PartitionState()
-
-
Method Details
-
fromOffset
-
getCollectionsManifestUid
public long getCollectionsManifestUid() -
setCollectionsManifestUid
public void setCollectionsManifestUid(long collectionsManifestUid) -
getCollectionsManifest
-
setCollectionsManifest
-
getKeyExtractor
-
setKeyExtractor
-
getEndSeqno
public long getEndSeqno()Returns the current end sequence number. -
getStartSeqno
public long getStartSeqno()Returns the current start sequence number. -
setStartSeqno
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
Returns the full failover log stored, in sorted order. -
setFailoverLog
Sets the failover log. -
addToFailoverLog
Deprecated.in favor ofsetFailoverLog(List)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.in favor ofsetSnapshot(SnapshotMarker)Allows to set the current snapshot start sequence number. -
setPendingSnapshot
-
getSnapshot
-
getSnapshotEndSeqno
public long getSnapshotEndSeqno()Returns the current snapshot end sequence number. -
setSnapshotEndSeqno
Deprecated.in favor ofsetSnapshot(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
-
getMostRecentOpenStreamOffset
-
setMostRecentOpenStreamOffset
-
toString
-
setFailoverLog(List)