本文整理匯總了Golang中github.com/youtube/vitess/go/vt/binlog/proto.BlpPosition.GroupId方法的典型用法代碼示例。如果您正苦於以下問題:Golang BlpPosition.GroupId方法的具體用法?Golang BlpPosition.GroupId怎麽用?Golang BlpPosition.GroupId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/youtube/vitess/go/vt/binlog/proto.BlpPosition
的用法示例。
在下文中一共展示了BlpPosition.GroupId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: waitForFilteredReplication
func (wr *Wrangler) waitForFilteredReplication(sourcePositions map[*topo.ShardInfo]*myproto.ReplicationPosition, destinationShards []*topo.ShardInfo) error {
wg := sync.WaitGroup{}
rec := concurrency.AllErrorRecorder{}
for _, si := range destinationShards {
wg.Add(1)
go func(si *topo.ShardInfo) {
for _, sourceShard := range si.SourceShards {
// we're waiting on this guy
blpPosition := blproto.BlpPosition{
Uid: sourceShard.Uid,
}
// find the position it should be at
for s, rp := range sourcePositions {
if s.Keyspace() == sourceShard.Keyspace && s.ShardName() == sourceShard.Shard {
blpPosition.GroupId = rp.MasterLogGroupId
}
}
log.Infof("Waiting for %v to catch up", si.MasterAlias)
if err := wr.ai.WaitBlpPosition(si.MasterAlias, blpPosition, wr.actionTimeout()); err != nil {
rec.RecordError(err)
} else {
log.Infof("%v caught up", si.MasterAlias)
}
wg.Done()
}
}(si)
}
wg.Wait()
return rec.Error()
}