You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
endSeqNosmap[uint16]uint64// endSeqNos mark the sequence numbers keyed by vBucket ID that are the end sequence numbers for a stream
63
64
}
64
65
65
-
// NewDCPCommon creates a new DCPCommon which manages updates coming from a cbgt-based DCP feed. The callback function will receive events from a DCP feed. It stores checkpoints in the metaStore starting with checkpointPrefix if persistCheckpoints is true.
66
-
// Specific stats for DCP are stored in expvars rather than SgwStats.
66
+
// NewDCPCommon creates a new DCPCommon instance which manages updates coming from a cbgt-based DCP feed.
// rollbackEx is called when a DCP open stream issues a rollback. The metadata persisted for a given uuid and sequence number and stream reopening is deferred to cbgt via AutoReconnectAfterRollback feed parameter.
Copy file name to clipboardExpand all lines: base/dcp_dest.go
+43-14Lines changed: 43 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,7 @@ func init() {
30
30
typeSGDestinterface {
31
31
cbgt.Dest
32
32
cbgt.DestEx
33
+
ForceCheckpointWrite()
33
34
}
34
35
35
36
// DCPDest implements SGDest (superset of cbgt.Dest) interface to manage updates coming from a
@@ -41,28 +42,32 @@ type DCPDest struct {
41
42
metaInitComplete []bool// Whether metadata initialization has been completed, per vbNo
42
43
}
43
44
44
-
// NewDCPDest creates a new DCPDest which manages updates coming from a cbgt-based DCP feed. The callback function will receive events from a DCP feed. If persistCheckpoints is true, stores checkpoints as documents in metadataStore starting with checkpointPrefix.
45
-
// Specific stats for DCP are stored in expvars rather than SgwStats, except for partition stat, which indicates the number of cbgt partitions assigned to this node.
45
+
typeDCPDestOptionsstruct {
46
+
Callback sgbucket.FeedEventCallbackFunc// Callback function receives DCP events.
47
+
MetadataStore sgbucket.DataStore// location to store checkpoints in
48
+
MaxVbNouint16// number of vBuckets for the backing bucket (does not have to match metadata store)
49
+
PersistCheckpointsbool// if true, write checkpoints to MetadataStore with keys prefixed by CheckpointPrefix
50
+
DcpStats*expvar.Map// Optional stats for dcp_rollback_count. This is not exposed by prometheus.
51
+
PartitionStat*SgwIntStat// Optional stat for active partition count, to track cbgt partitions.
52
+
CheckpointPrefixstring// document prefix for checkpoint documents.
53
+
EndSeqNosmap[uint16]uint64// If running a one shot DCP feed, these should match the end sequence numbers for each vbNo.
54
+
}
55
+
56
+
// NewDCPDest creates a new DCPDest which manages updates coming from a cbgt-based DCP feed.
46
57
// Each partition will have its own DCPDest object.
// cbgtFeedParams returns marshalled cbgt.DCPFeedParams as string. This contains information to for a given information , to be passed as feedparams during cbgt.Manager init.
unregisterFeedCallbackfunc(cbgt.Feed) // callback function for when a feed is unregistered. This occurs when a feed completes for any reason: Stop is requested, a rebalance of partitions, the feed naturally ends when reaching expected seequence numbers.
0 commit comments