当前位置: 首页>>代码示例>>Golang>>正文


Golang TopicResponse.ActiveTimestamps方法代码示例

本文整理汇总了Golang中github.com/couchbase/indexing/secondary/protobuf/projector.TopicResponse.ActiveTimestamps方法的典型用法代码示例。如果您正苦于以下问题:Golang TopicResponse.ActiveTimestamps方法的具体用法?Golang TopicResponse.ActiveTimestamps怎么用?Golang TopicResponse.ActiveTimestamps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/couchbase/indexing/secondary/protobuf/projector.TopicResponse的用法示例。


在下文中一共展示了TopicResponse.ActiveTimestamps方法的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
	}
}
开发者ID:jchris,项目名称:indexing,代码行数:31,代码来源:stream_monitor_test.go

示例2: 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
}
开发者ID:jchris,项目名称:indexing,代码行数:39,代码来源:stream_delete_test.go

示例3: 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
}
开发者ID:jchris,项目名称:indexing,代码行数:15,代码来源:stream_end_test.go

示例4: 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
}
开发者ID:jchris,项目名称:indexing,代码行数:21,代码来源:stream_timer_test.go


注:本文中的github.com/couchbase/indexing/secondary/protobuf/projector.TopicResponse.ActiveTimestamps方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。