本文整理匯總了Golang中github.com/couchbase/indexing/secondary/protobuf/projector.TsVbuuid.GetSnapshots方法的典型用法代碼示例。如果您正苦於以下問題:Golang TsVbuuid.GetSnapshots方法的具體用法?Golang TsVbuuid.GetSnapshots怎麽用?Golang TsVbuuid.GetSnapshots使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/couchbase/indexing/secondary/protobuf/projector.TsVbuuid
的用法示例。
在下文中一共展示了TsVbuuid.GetSnapshots方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: StartVbStreams
// StartVbStreams implements Feeder{} interface.
func (bdcp *bucketDcp) StartVbStreams(
opaque uint16, reqTs *protobuf.TsVbuuid) error {
var err error
if bdcp.bucket != nil {
bdcp.bucket.Refresh()
}
vbnos := c.Vbno32to16(reqTs.GetVbnos())
vbuuids, seqnos := reqTs.GetVbuuids(), reqTs.GetSeqnos()
for i, vbno := range vbnos {
snapshots := reqTs.GetSnapshots()
flags, vbuuid := uint32(0), vbuuids[i]
start, end := seqnos[i], uint64(0xFFFFFFFFFFFFFFFF)
snapStart, snapEnd := snapshots[i].GetStart(), snapshots[i].GetEnd()
e := bdcp.dcpFeed.DcpRequestStream(
vbno, opaque, flags, vbuuid, start, end, snapStart, snapEnd)
if e != nil {
err = e
}
// FIXME/TODO: the below sleep avoid back-to-back dispatch of
// StreamRequest to DCP, which seem to cause some problems.
time.Sleep(time.Millisecond)
}
return err
}