本文整理汇总了Golang中github.com/couchbase/indexing/secondary/protobuf/projector.TopicResponse.Err方法的典型用法代码示例。如果您正苦于以下问题:Golang TopicResponse.Err方法的具体用法?Golang TopicResponse.Err怎么用?Golang TopicResponse.Err使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/couchbase/indexing/secondary/protobuf/projector.TopicResponse
的用法示例。
在下文中一共展示了TopicResponse.Err方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: MutationTopicRequest
func (c *monitorTestProjectorClient) MutationTopicRequest(topic, endpointType string,
reqTimestamps []*protobuf.TsVbuuid, instances []*protobuf.Instance) (*protobuf.TopicResponse, error) {
logging.Infof("monitorTestProjectorClient.MutationTopicRequest(): start")
if len(reqTimestamps) == 0 {
util.TT.Fatal("testProjectorClient.MutationTopicRequest(): reqTimestamps is nil")
}
response := new(protobuf.TopicResponse)
response.Topic = &topic
response.InstanceIds = make([]uint64, len(instances))
for i, inst := range instances {
response.InstanceIds[i] = inst.GetIndexInstance().GetInstId()
}
response.ActiveTimestamps = reqTimestamps
if reqTimestamps[0].GetSeqnos()[10] != 406 {
response.RollbackTimestamps = make([]*protobuf.TsVbuuid, 1)
response.RollbackTimestamps[0] = protobuf.NewTsVbuuid(manager.DEFAULT_POOL_NAME, reqTimestamps[0].GetBucket(), manager.NUM_VB)
response.RollbackTimestamps[0].Append(uint16(10), uint64(406), reqTimestamps[0].Vbuuids[10], 0, 0)
response.Err = protobuf.NewError(projectorC.ErrorStreamRequest)
return response, projectorC.ErrorStreamRequest
} else {
response.RollbackTimestamps = nil
response.Err = nil
return response, nil
}
}
示例2: RestartVbuckets
func (c *streamEndTestProjectorClient) RestartVbuckets(topic string,
restartTimestamps []*protobuf.TsVbuuid) (*protobuf.TopicResponse, error) {
c.sendSync(restartTimestamps)
response := new(protobuf.TopicResponse)
response.Topic = &topic
response.InstanceIds = nil
response.ActiveTimestamps = make([]*protobuf.TsVbuuid, 1)
response.ActiveTimestamps[0] = restartTimestamps[0]
response.RollbackTimestamps = nil
response.Err = nil
return response, nil
}
示例3: MutationTopicRequest
func (c *timerTestProjectorClient) MutationTopicRequest(topic, endpointType string,
reqTimestamps []*protobuf.TsVbuuid, instances []*protobuf.Instance) (*protobuf.TopicResponse, error) {
if len(reqTimestamps) == 0 {
util.TT.Fatal("timerTestProjectorClient.MutationTopicRequest(): reqTimestamps is nil")
}
c.sendSync(instances)
response := new(protobuf.TopicResponse)
response.Topic = &topic
response.InstanceIds = make([]uint64, len(instances))
for i, inst := range instances {
response.InstanceIds[i] = inst.GetIndexInstance().GetInstId()
}
response.ActiveTimestamps = reqTimestamps
response.RollbackTimestamps = nil
response.Err = nil
return response, nil
}
示例4: MutationTopicRequest
func (c *deleteTestProjectorClient) MutationTopicRequest(topic, endpointType string,
reqTimestamps []*protobuf.TsVbuuid, instances []*protobuf.Instance) (*protobuf.TopicResponse, error) {
if len(reqTimestamps) == 0 {
util.TT.Fatal("deleteTestProjectorClient.MutationTopicRequest(): reqTimestamps is nil")
}
for _, inst := range instances {
delete_test_status[inst.GetIndexInstance().GetInstId()] = inst
}
response := new(protobuf.TopicResponse)
response.Topic = &topic
response.InstanceIds = make([]uint64, len(instances))
for i, inst := range instances {
response.InstanceIds[i] = inst.GetIndexInstance().GetInstId()
}
response.ActiveTimestamps = nil
for _, ts := range reqTimestamps {
newTs := protobuf.NewTsVbuuid("default", ts.GetBucket(), manager.NUM_VB)
if c.server == "127.0.0.1" {
for i := 0; i < manager.NUM_VB/2; i++ {
newTs.Append(uint16(i), uint64(i), uint64(1234), uint64(0), uint64(0))
}
}
if c.server == "127.0.0.2" {
for i := manager.NUM_VB / 2; i < manager.NUM_VB; i++ {
newTs.Append(uint16(i), uint64(i), uint64(1234), uint64(0), uint64(0))
}
}
response.ActiveTimestamps = append(response.ActiveTimestamps, newTs)
}
response.RollbackTimestamps = nil
response.Err = nil
return response, nil
}