protobuf

package
v0.0.0-...-d8c7374 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package protobuf is a generated protocol buffer package.

It is generated from these files:

common.proto
index.proto
partn_single.proto
partn_tp.proto
projector.proto

It has these top-level messages:

Error
Vbuckets
Snapshot
TsVb
TsVbFull
TsVbuuid
FailoverLog

Index

Constants

This section is empty.

Variables

View Source
var ErrorInvalidVbmap = errors.New("protobuf.errorInvalidVbmap")
View Source
var ExprType_name = map[int32]string{
	1: "JAVASCRIPT",
	2: "N1QL",
}
View Source
var ExprType_value = map[string]int32{
	"JAVASCRIPT": 1,
	"N1QL":       2,
}
View Source
var FeedVersion_name = map[int32]string{
	1: "sherlock",
	2: "watson",
}
View Source
var FeedVersion_value = map[string]int32{
	"sherlock": 1,
	"watson":   2,
}
View Source
var IndexState_name = map[int32]string{
	1: "IndexInitial",
	2: "IndexPending",
	3: "IndexLoading",
	4: "IndexActive",
	5: "IndexDeleted",
}
View Source
var IndexState_value = map[string]int32{
	"IndexInitial": 1,
	"IndexPending": 2,
	"IndexLoading": 3,
	"IndexActive":  4,
	"IndexDeleted": 5,
}
View Source
var PartitionScheme_name = map[int32]string{
	1: "TEST",
	2: "SINGLE",
	3: "KEY",
	4: "HASH",
	5: "RANGE",
}
View Source
var PartitionScheme_value = map[string]int32{
	"TEST":   1,
	"SINGLE": 2,
	"KEY":    3,
	"HASH":   4,
	"RANGE":  5,
}
View Source
var StorageType_name = map[int32]string{
	1: "forestdb",
	2: "memdb",
	3: "memory_optimized",
}
View Source
var StorageType_value = map[string]int32{
	"forestdb":         1,
	"memdb":            2,
	"memory_optimized": 3,
}

Functions

func CollateJSONEncode

func CollateJSONEncode(val qvalue.Value, encodeBuf []byte) ([]byte, []byte, error)

func CompileN1QLExpression

func CompileN1QLExpression(expressions []string) ([]interface{}, error)

CompileN1QLExpression will take expressions defined in N1QL's DDL statement and compile them for evaluation.

func N1QLTransform

func N1QLTransform(
	docid, doc []byte, cExprs []interface{},
	meta map[string]interface{}, encodeBuf []byte) ([]byte, []byte, error)

N1QLTransform will use compiled list of expression from N1QL's DDL statement and evaluate a document using them to return a secondary key as JSON object. `meta` supplies a dictionary of,

`id`, `byseqno`, `revseqno`, `flags`, `expiration`, `locktime`,
`nru`, `cas`

Types

type AddBucketsRequest

type AddBucketsRequest struct {
	Topic         *string     `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	ReqTimestamps []*TsVbuuid `protobuf:"bytes,2,rep,name=reqTimestamps" json:"reqTimestamps,omitempty"`
	// list of instances applicable for buckets.
	Instances        []*Instance  `protobuf:"bytes,3,rep,name=instances" json:"instances,omitempty"`
	Version          *FeedVersion `protobuf:"varint,4,opt,name=version,enum=protobuf.FeedVersion,def=1" json:"version,omitempty"`
	XXX_unrecognized []byte       `json:"-"`
}

AddBucketsRequest will start vbucket-streams specified buckets and add them to the topic that has already started. Respond back with TopicResponse

func NewAddBucketsRequest

func NewAddBucketsRequest(
	topic string, instances []*Instance) *AddBucketsRequest

NewAddBucketsRequest creates an AddBucketsRequest for topic to add one or more new instances/engines to a topic.

func (*AddBucketsRequest) AddStreams

func (req *AddBucketsRequest) AddStreams(
	pool, bucket string, ts *c.TsVbuuid) *AddBucketsRequest

AddStreams will add a subset of vbuckets to for a bucket to the new topic.

func (*AddBucketsRequest) ContentType

func (req *AddBucketsRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*AddBucketsRequest) Decode

func (req *AddBucketsRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*AddBucketsRequest) Encode

func (req *AddBucketsRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*AddBucketsRequest) GetEvaluators

func (req *AddBucketsRequest) GetEvaluators() (map[uint64]c.Evaluator, error)

GetEvaluators impelement Subscriber{} interface

func (*AddBucketsRequest) GetInstances

func (m *AddBucketsRequest) GetInstances() []*Instance

func (*AddBucketsRequest) GetReqTimestamps

func (m *AddBucketsRequest) GetReqTimestamps() []*TsVbuuid

func (*AddBucketsRequest) GetRouters

func (req *AddBucketsRequest) GetRouters() (map[uint64]c.Router, error)

GetRouters impelement Subscriber{} interface

func (*AddBucketsRequest) GetTopic

func (m *AddBucketsRequest) GetTopic() string

func (*AddBucketsRequest) GetVersion

func (m *AddBucketsRequest) GetVersion() FeedVersion

func (*AddBucketsRequest) Name

func (req *AddBucketsRequest) Name() string

Name implement MessageMarshaller{} interface

func (*AddBucketsRequest) ProtoMessage

func (*AddBucketsRequest) ProtoMessage()

func (*AddBucketsRequest) Reset

func (m *AddBucketsRequest) Reset()

func (*AddBucketsRequest) String

func (m *AddBucketsRequest) String() string

type AddInstancesRequest

type AddInstancesRequest struct {
	Topic            *string      `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	Instances        []*Instance  `protobuf:"bytes,2,rep,name=instances" json:"instances,omitempty"`
	Version          *FeedVersion `protobuf:"varint,3,opt,name=version,enum=protobuf.FeedVersion,def=1" json:"version,omitempty"`
	XXX_unrecognized []byte       `json:"-"`
}

AddInstancesRequest to add index-instances to a topic. Respond back with TimestampResponse

func NewAddInstancesRequest

func NewAddInstancesRequest(
	topic string, instances []*Instance) *AddInstancesRequest

NewAddInstancesRequest creates an AddInstancesRequest for topic to add one or more new instances/engines to a topic.

func (*AddInstancesRequest) ContentType

func (req *AddInstancesRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*AddInstancesRequest) Decode

func (req *AddInstancesRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*AddInstancesRequest) Encode

func (req *AddInstancesRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*AddInstancesRequest) GetEvaluators

func (req *AddInstancesRequest) GetEvaluators() (map[uint64]c.Evaluator, error)

GetEvaluators impelement Subscriber{} interface

func (*AddInstancesRequest) GetInstances

func (m *AddInstancesRequest) GetInstances() []*Instance

func (*AddInstancesRequest) GetRouters

func (req *AddInstancesRequest) GetRouters() (map[uint64]c.Router, error)

GetRouters impelement Subscriber{} interface

func (*AddInstancesRequest) GetTopic

func (m *AddInstancesRequest) GetTopic() string

func (*AddInstancesRequest) GetVersion

func (m *AddInstancesRequest) GetVersion() FeedVersion

func (*AddInstancesRequest) Name

func (req *AddInstancesRequest) Name() string

Name implement MessageMarshaller{} interface

func (*AddInstancesRequest) ProtoMessage

func (*AddInstancesRequest) ProtoMessage()

func (*AddInstancesRequest) Reset

func (m *AddInstancesRequest) Reset()

func (*AddInstancesRequest) String

func (m *AddInstancesRequest) String() string

type DelBucketsRequest

type DelBucketsRequest struct {
	Topic            *string  `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	Buckets          []string `protobuf:"bytes,2,rep,name=buckets" json:"buckets,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

DelBucketsRequest will shutdown vbucket-streams for specified buckets and remove the buckets from topic. Respond back with TopicResponse

func NewDelBucketsRequest

func NewDelBucketsRequest(
	topic string, buckets []string) *DelBucketsRequest

NewDelBucketsRequest creates an DelBucketsRequest for topic to add one or more new instances/engines to a topic.

func (*DelBucketsRequest) ContentType

func (req *DelBucketsRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*DelBucketsRequest) Decode

func (req *DelBucketsRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*DelBucketsRequest) Encode

func (req *DelBucketsRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*DelBucketsRequest) GetBuckets

func (m *DelBucketsRequest) GetBuckets() []string

func (*DelBucketsRequest) GetTopic

func (m *DelBucketsRequest) GetTopic() string

func (*DelBucketsRequest) Name

func (req *DelBucketsRequest) Name() string

Name implement MessageMarshaller{} interface

func (*DelBucketsRequest) ProtoMessage

func (*DelBucketsRequest) ProtoMessage()

func (*DelBucketsRequest) Reset

func (m *DelBucketsRequest) Reset()

func (*DelBucketsRequest) String

func (m *DelBucketsRequest) String() string

type DelInstancesRequest

type DelInstancesRequest struct {
	Topic            *string  `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	InstanceIds      []uint64 `protobuf:"varint,2,rep,name=instanceIds" json:"instanceIds,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

DelInstancesRequest to add index-instances to a topic. Respond back with TopicResponse

func NewDelInstancesRequest

func NewDelInstancesRequest(topic string, uuids []uint64) *DelInstancesRequest

NewDelInstancesRequest creates an DelInstancesRequest for topic to add one or more new instances/engines to a topic.

func (*DelInstancesRequest) ContentType

func (req *DelInstancesRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*DelInstancesRequest) Decode

func (req *DelInstancesRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*DelInstancesRequest) Encode

func (req *DelInstancesRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*DelInstancesRequest) GetInstanceIds

func (m *DelInstancesRequest) GetInstanceIds() []uint64

func (*DelInstancesRequest) GetTopic

func (m *DelInstancesRequest) GetTopic() string

func (*DelInstancesRequest) Name

func (req *DelInstancesRequest) Name() string

Name implement MessageMarshaller{} interface

func (*DelInstancesRequest) ProtoMessage

func (*DelInstancesRequest) ProtoMessage()

func (*DelInstancesRequest) Reset

func (m *DelInstancesRequest) Reset()

func (*DelInstancesRequest) String

func (m *DelInstancesRequest) String() string

type Error

type Error struct {
	Error            *string `protobuf:"bytes,1,req,name=error" json:"error,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

Error message can be sent back as response or encapsulated in response packets.

func NewError

func NewError(err error) *Error

NewError create a protobuf message `Error` and return its reference back to the caller.

func (*Error) ContentType

func (req *Error) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*Error) Decode

func (req *Error) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*Error) Encode

func (req *Error) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*Error) GetError

func (m *Error) GetError() string

func (*Error) Name

func (req *Error) Name() string

Name implement MessageMarshaller{} interface

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) Reset

func (m *Error) Reset()

func (*Error) String

func (m *Error) String() string

type ExprType

type ExprType int32

Type of expression used to evaluate document.

const (
	ExprType_JAVASCRIPT ExprType = 1
	ExprType_N1QL       ExprType = 2
)

func (ExprType) Enum

func (x ExprType) Enum() *ExprType

func (ExprType) String

func (x ExprType) String() string

func (*ExprType) UnmarshalJSON

func (x *ExprType) UnmarshalJSON(data []byte) error

type FailoverLog

type FailoverLog struct {
	Vbno             *uint32  `protobuf:"varint,1,req,name=vbno" json:"vbno,omitempty"`
	Vbuuids          []uint64 `protobuf:"varint,2,rep,name=vbuuids" json:"vbuuids,omitempty"`
	Seqnos           []uint64 `protobuf:"varint,3,rep,name=seqnos" json:"seqnos,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

failover log for a vbucket.

func (*FailoverLog) GetSeqnos

func (m *FailoverLog) GetSeqnos() []uint64

func (*FailoverLog) GetVbno

func (m *FailoverLog) GetVbno() uint32

func (*FailoverLog) GetVbuuids

func (m *FailoverLog) GetVbuuids() []uint64

func (*FailoverLog) ProtoMessage

func (*FailoverLog) ProtoMessage()

func (*FailoverLog) Reset

func (m *FailoverLog) Reset()

func (*FailoverLog) String

func (m *FailoverLog) String() string

type FailoverLogRequest

type FailoverLogRequest struct {
	Pool             *string  `protobuf:"bytes,1,req,name=pool" json:"pool,omitempty"`
	Bucket           *string  `protobuf:"bytes,2,req,name=bucket" json:"bucket,omitempty"`
	Vbnos            []uint32 `protobuf:"varint,3,rep,name=vbnos" json:"vbnos,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

Requested by Coordinator during system-start, re-connect, rollback

func (*FailoverLogRequest) ContentType

func (req *FailoverLogRequest) ContentType() string

ContentType implement MessageMarshaller interface

func (*FailoverLogRequest) Decode

func (req *FailoverLogRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller interface

func (*FailoverLogRequest) Encode

func (req *FailoverLogRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller interface

func (*FailoverLogRequest) GetBucket

func (m *FailoverLogRequest) GetBucket() string

func (*FailoverLogRequest) GetPool

func (m *FailoverLogRequest) GetPool() string

func (*FailoverLogRequest) GetVbnos

func (m *FailoverLogRequest) GetVbnos() []uint32

func (*FailoverLogRequest) Name

func (req *FailoverLogRequest) Name() string

Name implement MessageMarshaller interface

func (*FailoverLogRequest) ProtoMessage

func (*FailoverLogRequest) ProtoMessage()

func (*FailoverLogRequest) Reset

func (m *FailoverLogRequest) Reset()

func (*FailoverLogRequest) String

func (m *FailoverLogRequest) String() string

type FailoverLogResponse

type FailoverLogResponse struct {
	Logs             []*FailoverLog `protobuf:"bytes,1,rep,name=logs" json:"logs,omitempty"`
	Err              *Error         `protobuf:"bytes,2,opt,name=err" json:"err,omitempty"`
	XXX_unrecognized []byte         `json:"-"`
}

func (*FailoverLogResponse) ContentType

func (resp *FailoverLogResponse) ContentType() string

ContentType implement MessageMarshaller interface

func (*FailoverLogResponse) Decode

func (resp *FailoverLogResponse) Decode(data []byte) (err error)

Decode implement MessageMarshaller interface

func (*FailoverLogResponse) Encode

func (resp *FailoverLogResponse) Encode() (data []byte, err error)

Encode implement MessageMarshaller interface

func (*FailoverLogResponse) GetErr

func (m *FailoverLogResponse) GetErr() *Error

func (*FailoverLogResponse) GetLogs

func (m *FailoverLogResponse) GetLogs() []*FailoverLog

func (*FailoverLogResponse) LatestBranch

func (resp *FailoverLogResponse) LatestBranch() map[uint16]uint64

LatestBranch return a map of vbucket -> latest-vbuuid from failoverlog.

func (*FailoverLogResponse) Name

func (resp *FailoverLogResponse) Name() string

Name implement MessageMarshaller interface

func (*FailoverLogResponse) ProtoMessage

func (*FailoverLogResponse) ProtoMessage()

func (*FailoverLogResponse) Reset

func (m *FailoverLogResponse) Reset()

func (*FailoverLogResponse) String

func (m *FailoverLogResponse) String() string

func (*FailoverLogResponse) ToFailoverLog

func (resp *FailoverLogResponse) ToFailoverLog(vbnos []uint16) couchbase.FailoverLog

ToFailoverLog return couchbase.FailoverLog for `vbnos` from FailoverLogResponse.

type FeedVersion

type FeedVersion int32
const (
	FeedVersion_sherlock FeedVersion = 1
	FeedVersion_watson   FeedVersion = 2
)
const Default_AddBucketsRequest_Version FeedVersion = FeedVersion_sherlock
const Default_AddInstancesRequest_Version FeedVersion = FeedVersion_sherlock
const Default_MutationTopicRequest_Version FeedVersion = FeedVersion_sherlock

func (FeedVersion) Enum

func (x FeedVersion) Enum() *FeedVersion

func (FeedVersion) String

func (x FeedVersion) String() string

func (*FeedVersion) UnmarshalJSON

func (x *FeedVersion) UnmarshalJSON(data []byte) error

type IndexDefn

type IndexDefn struct {
	DefnID           *uint64          `protobuf:"varint,1,req,name=defnID" json:"defnID,omitempty"`
	Bucket           *string          `protobuf:"bytes,2,req,name=bucket" json:"bucket,omitempty"`
	IsPrimary        *bool            `protobuf:"varint,3,req,name=isPrimary" json:"isPrimary,omitempty"`
	Name             *string          `protobuf:"bytes,4,req,name=name" json:"name,omitempty"`
	Using            *StorageType     `protobuf:"varint,5,req,name=using,enum=protobuf.StorageType" json:"using,omitempty"`
	ExprType         *ExprType        `protobuf:"varint,6,req,name=exprType,enum=protobuf.ExprType" json:"exprType,omitempty"`
	SecExpressions   []string         `protobuf:"bytes,7,rep,name=secExpressions" json:"secExpressions,omitempty"`
	PartitionScheme  *PartitionScheme `protobuf:"varint,8,opt,name=partitionScheme,enum=protobuf.PartitionScheme" json:"partitionScheme,omitempty"`
	PartnExpression  *string          `protobuf:"bytes,9,opt,name=partnExpression" json:"partnExpression,omitempty"`
	WhereExpression  *string          `protobuf:"bytes,10,opt,name=whereExpression" json:"whereExpression,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

Index DDL from create index statement.

func (*IndexDefn) GetBucket

func (m *IndexDefn) GetBucket() string

func (*IndexDefn) GetDefnID

func (m *IndexDefn) GetDefnID() uint64

func (*IndexDefn) GetExprType

func (m *IndexDefn) GetExprType() ExprType

func (*IndexDefn) GetIsPrimary

func (m *IndexDefn) GetIsPrimary() bool

func (*IndexDefn) GetName

func (m *IndexDefn) GetName() string

func (*IndexDefn) GetPartitionScheme

func (m *IndexDefn) GetPartitionScheme() PartitionScheme

func (*IndexDefn) GetPartnExpression

func (m *IndexDefn) GetPartnExpression() string

func (*IndexDefn) GetSecExpressions

func (m *IndexDefn) GetSecExpressions() []string

func (*IndexDefn) GetUsing

func (m *IndexDefn) GetUsing() StorageType

func (*IndexDefn) GetWhereExpression

func (m *IndexDefn) GetWhereExpression() string

func (*IndexDefn) ProtoMessage

func (*IndexDefn) ProtoMessage()

func (*IndexDefn) Reset

func (m *IndexDefn) Reset()

func (*IndexDefn) String

func (m *IndexDefn) String() string

type IndexEvaluator

type IndexEvaluator struct {
	// contains filtered or unexported fields
}

IndexEvaluator implements `Evaluator` interface for protobuf definition of an index instance.

func NewIndexEvaluator

func NewIndexEvaluator(instance *IndexInst,
	version FeedVersion) (*IndexEvaluator, error)

NewIndexEvaluator returns a reference to a new instance of IndexEvaluator.

func (*IndexEvaluator) Bucket

func (ie *IndexEvaluator) Bucket() string

Bucket implements Evaluator{} interface.

func (*IndexEvaluator) SnapshotData

func (ie *IndexEvaluator) SnapshotData(
	m *mc.DcpEvent, vbno uint16, vbuuid, seqno uint64) (data interface{})

SnapshotData implement Evaluator{} interface.

func (*IndexEvaluator) StreamBeginData

func (ie *IndexEvaluator) StreamBeginData(
	vbno uint16, vbuuid, seqno uint64) (data interface{})

StreamBeginData implement Evaluator{} interface.

func (*IndexEvaluator) StreamEndData

func (ie *IndexEvaluator) StreamEndData(
	vbno uint16, vbuuid, seqno uint64) (data interface{})

StreamEndData implement Evaluator{} interface.

func (*IndexEvaluator) SyncData

func (ie *IndexEvaluator) SyncData(
	vbno uint16, vbuuid, seqno uint64) (data interface{})

SyncData implement Evaluator{} interface.

func (*IndexEvaluator) TransformRoute

func (ie *IndexEvaluator) TransformRoute(
	vbuuid uint64, m *mc.DcpEvent, data map[string]interface{},
	encodeBuf []byte) ([]byte, error)

TransformRoute implement Evaluator{} interface.

type IndexInst

type IndexInst struct {
	InstId           *uint64          `protobuf:"varint,1,req,name=instId" json:"instId,omitempty"`
	State            *IndexState      `protobuf:"varint,2,req,name=state,enum=protobuf.IndexState" json:"state,omitempty"`
	Definition       *IndexDefn       `protobuf:"bytes,3,req,name=definition" json:"definition,omitempty"`
	Tp               *TestPartition   `protobuf:"bytes,4,opt,name=tp" json:"tp,omitempty"`
	SinglePartn      *SinglePartition `protobuf:"bytes,5,opt,name=singlePartn" json:"singlePartn,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

IndexInst message as payload between co-ordinator, projector, indexer.

func (*IndexInst) Bucket

func (instance *IndexInst) Bucket() string

Bucket implements Router{} interface.

func (*IndexInst) DeletionEndpoints

func (instance *IndexInst) DeletionEndpoints(
	m *mc.DcpEvent, partKey, oldKey []byte) []string

DeletionEndpoints implements Router{} interface.

func (*IndexInst) Endpoints

func (instance *IndexInst) Endpoints() []string

Endpoints implements Router{} interface.

func (*IndexInst) GetDefinition

func (m *IndexInst) GetDefinition() *IndexDefn

func (*IndexInst) GetInstId

func (m *IndexInst) GetInstId() uint64

func (*IndexInst) GetPartitionObject

func (instance *IndexInst) GetPartitionObject() Partition

func (*IndexInst) GetSinglePartn

func (m *IndexInst) GetSinglePartn() *SinglePartition

func (*IndexInst) GetState

func (m *IndexInst) GetState() IndexState

func (*IndexInst) GetTp

func (m *IndexInst) GetTp() *TestPartition

func (*IndexInst) ProtoMessage

func (*IndexInst) ProtoMessage()

func (*IndexInst) Reset

func (m *IndexInst) Reset()

func (*IndexInst) String

func (m *IndexInst) String() string

func (*IndexInst) UpsertDeletionEndpoints

func (instance *IndexInst) UpsertDeletionEndpoints(
	m *mc.DcpEvent, partKey, key, oldKey []byte) []string

UpsertDeletionEndpoints implements Router{} interface.

func (*IndexInst) UpsertEndpoints

func (instance *IndexInst) UpsertEndpoints(
	m *mc.DcpEvent, partKey, key, oldKey []byte) []string

UpsertEndpoints implements Router{} interface.

type IndexState

type IndexState int32

IndexDefn will be in one of the following state

const (
	// Create index accepted, replicated and response sent back to admin
	// console.
	IndexState_IndexInitial IndexState = 1
	// Index DDL replicated, and then communicated to participating indexers.
	IndexState_IndexPending IndexState = 2
	// Initial-load request received from admin console, DDL replicated,
	// loading status communicated with participating indexer and
	// initial-load request is posted to projector.
	IndexState_IndexLoading IndexState = 3
	// Initial-loading is completed for this index from all partiticipating
	// indexers, DDL replicated, and finaly initial-load stream is shutdown.
	IndexState_IndexActive IndexState = 4
	// Delete index request is received, replicated and then communicated with
	// each participating indexer nodes.
	IndexState_IndexDeleted IndexState = 5
)

func (IndexState) Enum

func (x IndexState) Enum() *IndexState

func (IndexState) String

func (x IndexState) String() string

func (*IndexState) UnmarshalJSON

func (x *IndexState) UnmarshalJSON(data []byte) error

type Instance

type Instance struct {
	IndexInstance    *IndexInst `protobuf:"bytes,1,opt,name=indexInstance" json:"indexInstance,omitempty"`
	XXX_unrecognized []byte     `json:"-"`
}

Generic instance, can be an index instance, xdcr, search etc ...

func ScaleDefault4i

func ScaleDefault4i(
	buckets, endpoints []string, coordEndpoint string) []*Instance

ScaleDefault4i on buckets and documents created by tools/loadgen.

func (*Instance) GetBucket

func (instance *Instance) GetBucket() (bucket string)

GetBucket will get bucket-name in which instance is defined.

func (*Instance) GetIndexInstance

func (m *Instance) GetIndexInstance() *IndexInst

func (*Instance) GetUuid

func (instance *Instance) GetUuid() (uuid uint64)

GetUuid will get unique-id for this instance.

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) Reset

func (m *Instance) Reset()

func (*Instance) String

func (m *Instance) String() string

type Instances

type Instances struct {
	Instances        []*Instance `protobuf:"bytes,1,rep,name=instances" json:"instances,omitempty"`
	XXX_unrecognized []byte      `json:"-"`
}

List of instances

func (*Instances) GetInstances

func (m *Instances) GetInstances() []*Instance

func (*Instances) ProtoMessage

func (*Instances) ProtoMessage()

func (*Instances) Reset

func (m *Instances) Reset()

func (*Instances) String

func (m *Instances) String() string

type MutationTopicRequest

type MutationTopicRequest struct {
	Topic         *string     `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	EndpointType  *string     `protobuf:"bytes,2,req,name=endpointType" json:"endpointType,omitempty"`
	ReqTimestamps []*TsVbuuid `protobuf:"bytes,3,rep,name=reqTimestamps" json:"reqTimestamps,omitempty"`
	// initial list of instances applicable for this topic
	Instances        []*Instance  `protobuf:"bytes,4,rep,name=instances" json:"instances,omitempty"`
	Version          *FeedVersion `protobuf:"varint,5,opt,name=version,enum=protobuf.FeedVersion,def=1" json:"version,omitempty"`
	XXX_unrecognized []byte       `json:"-"`
}

Requested by Coordinator or indexer to start a new mutation topic. Respond back with TopicResponse.

func NewMutationTopicRequest

func NewMutationTopicRequest(
	topic, endpointType string, instances []*Instance) *MutationTopicRequest

NewMutationTopicRequest creates a new MutationTopicRequest for `topic`.

func (*MutationTopicRequest) AddStreams

func (req *MutationTopicRequest) AddStreams(
	pool, bucket string, ts *c.TsVbuuid) *MutationTopicRequest

AddStreams will add a subset of vbuckets to for a bucket to the new topic.

func (*MutationTopicRequest) Append

func (req *MutationTopicRequest) Append(reqTs *TsVbuuid) *MutationTopicRequest

Append add a request-timestamp for {pool,bucket} to this topic request.

func (*MutationTopicRequest) ContentType

func (req *MutationTopicRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*MutationTopicRequest) Decode

func (req *MutationTopicRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*MutationTopicRequest) Encode

func (req *MutationTopicRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*MutationTopicRequest) GetEndpointType

func (m *MutationTopicRequest) GetEndpointType() string

func (*MutationTopicRequest) GetEvaluators

func (req *MutationTopicRequest) GetEvaluators() (map[uint64]c.Evaluator, error)

GetEvaluators impelement Subscriber{} interface

func (*MutationTopicRequest) GetInstances

func (m *MutationTopicRequest) GetInstances() []*Instance

func (*MutationTopicRequest) GetReqTimestamps

func (m *MutationTopicRequest) GetReqTimestamps() []*TsVbuuid

func (*MutationTopicRequest) GetRouters

func (req *MutationTopicRequest) GetRouters() (map[uint64]c.Router, error)

GetRouters impelement Subscriber{} interface

func (*MutationTopicRequest) GetTopic

func (m *MutationTopicRequest) GetTopic() string

func (*MutationTopicRequest) GetVersion

func (m *MutationTopicRequest) GetVersion() FeedVersion

func (*MutationTopicRequest) Name

func (req *MutationTopicRequest) Name() string

Name implement MessageMarshaller{} interface

func (*MutationTopicRequest) ProtoMessage

func (*MutationTopicRequest) ProtoMessage()

func (*MutationTopicRequest) Reset

func (m *MutationTopicRequest) Reset()

func (*MutationTopicRequest) String

func (m *MutationTopicRequest) String() string

type Partition

type Partition interface {
	// Hosts return full list of endpoints <host:port>
	// that are listening for this instance.
	Hosts(*IndexInst) []string

	// UpsertEndpoints return a list of endpoints <host:port>
	// to which Upsert message will be published.
	UpsertEndpoints(i *IndexInst, m *mc.DcpEvent, partKey, key, oldKey []byte) []string

	// UpsertDeletionEndpoints return a list of endpoints
	// <host:port> to which UpsertDeletion message will be
	// published.
	UpsertDeletionEndpoints(i *IndexInst, m *mc.DcpEvent, partKey, key, oldKey []byte) []string

	// DeletionEndpoints return a list of endpoints
	// <host:port> to which Deletion message will be published.
	DeletionEndpoints(i *IndexInst, m *mc.DcpEvent, partKey, oldKey []byte) []string
}

type PartitionScheme

type PartitionScheme int32

Type of topology, including paritition type to be used for the index.

const (
	PartitionScheme_TEST   PartitionScheme = 1
	PartitionScheme_SINGLE PartitionScheme = 2
	PartitionScheme_KEY    PartitionScheme = 3
	PartitionScheme_HASH   PartitionScheme = 4
	PartitionScheme_RANGE  PartitionScheme = 5
)

func (PartitionScheme) Enum

func (x PartitionScheme) Enum() *PartitionScheme

func (PartitionScheme) String

func (x PartitionScheme) String() string

func (*PartitionScheme) UnmarshalJSON

func (x *PartitionScheme) UnmarshalJSON(data []byte) error

type RepairEndpointsRequest

type RepairEndpointsRequest struct {
	Topic            *string  `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	Endpoints        []string `protobuf:"bytes,2,rep,name=endpoints" json:"endpoints,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

Requested by indexer / coordinator to inform router to re-connect with downstream endpoint. Error message will be sent as response.

func NewRepairEndpointsRequest

func NewRepairEndpointsRequest(
	topic string, endpoints []string) *RepairEndpointsRequest

NewRepairEndpoints creates a RepairEndpointsRequest for a topic's one or more endpoints.

func (*RepairEndpointsRequest) ContentType

func (req *RepairEndpointsRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*RepairEndpointsRequest) Decode

func (req *RepairEndpointsRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*RepairEndpointsRequest) Encode

func (req *RepairEndpointsRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*RepairEndpointsRequest) GetEndpoints

func (m *RepairEndpointsRequest) GetEndpoints() []string

func (*RepairEndpointsRequest) GetTopic

func (m *RepairEndpointsRequest) GetTopic() string

func (*RepairEndpointsRequest) Name

func (req *RepairEndpointsRequest) Name() string

Name implement MessageMarshaller{} interface

func (*RepairEndpointsRequest) ProtoMessage

func (*RepairEndpointsRequest) ProtoMessage()

func (*RepairEndpointsRequest) Reset

func (m *RepairEndpointsRequest) Reset()

func (*RepairEndpointsRequest) String

func (m *RepairEndpointsRequest) String() string

type RestartVbucketsRequest

type RestartVbucketsRequest struct {
	Topic             *string     `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	RestartTimestamps []*TsVbuuid `protobuf:"bytes,2,rep,name=restartTimestamps" json:"restartTimestamps,omitempty"`
	XXX_unrecognized  []byte      `json:"-"`
}

RestartVbucketsRequest will restart a subset of vbuckets for each specified buckets. Respond back with TopicResponse

func NewRestartVbucketsRequest

func NewRestartVbucketsRequest(topic string) *RestartVbucketsRequest

NewRestartVbucketsRequest creates a RestartVbucketsRequest for topic, later a list of {pool,bucket,timestamp} need to be added before posting the request.

func (*RestartVbucketsRequest) AddStreams

func (req *RestartVbucketsRequest) AddStreams(
	pool, bucket string, ts *c.TsVbuuid) *RestartVbucketsRequest

AddStreams will add a subset of vbuckets to be restarted for a bucket.

func (*RestartVbucketsRequest) Append

func (req *RestartVbucketsRequest) Append(
	restartTs *TsVbuuid) *RestartVbucketsRequest

Append add a restart-timestamp for {pool,bucket,[]vbuckets} to this topic request.

func (*RestartVbucketsRequest) ContentType

func (resp *RestartVbucketsRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*RestartVbucketsRequest) Decode

func (resp *RestartVbucketsRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*RestartVbucketsRequest) Encode

func (resp *RestartVbucketsRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*RestartVbucketsRequest) GetRestartTimestamps

func (m *RestartVbucketsRequest) GetRestartTimestamps() []*TsVbuuid

func (*RestartVbucketsRequest) GetTopic

func (m *RestartVbucketsRequest) GetTopic() string

func (*RestartVbucketsRequest) Name

func (resp *RestartVbucketsRequest) Name() string

Name implement MessageMarshaller{} interface

func (*RestartVbucketsRequest) ProtoMessage

func (*RestartVbucketsRequest) ProtoMessage()

func (*RestartVbucketsRequest) Reset

func (m *RestartVbucketsRequest) Reset()

func (*RestartVbucketsRequest) String

func (m *RestartVbucketsRequest) String() string

type ShutdownTopicRequest

type ShutdownTopicRequest struct {
	Topic            *string `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

Requested by coordinator to should down a mutation topic and all KV connections active for that topic. Error message will be sent as response.

func NewShutdownTopicRequest

func NewShutdownTopicRequest(topic string) *ShutdownTopicRequest

NewShutdownTopicRequest creates a ShutdownTopicRequest for a topic's one or more endpoints.

func (*ShutdownTopicRequest) ContentType

func (req *ShutdownTopicRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*ShutdownTopicRequest) Decode

func (req *ShutdownTopicRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*ShutdownTopicRequest) Encode

func (req *ShutdownTopicRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*ShutdownTopicRequest) GetTopic

func (m *ShutdownTopicRequest) GetTopic() string

func (*ShutdownTopicRequest) Name

func (req *ShutdownTopicRequest) Name() string

Name implement MessageMarshaller{} interface

func (*ShutdownTopicRequest) ProtoMessage

func (*ShutdownTopicRequest) ProtoMessage()

func (*ShutdownTopicRequest) Reset

func (m *ShutdownTopicRequest) Reset()

func (*ShutdownTopicRequest) String

func (m *ShutdownTopicRequest) String() string

type ShutdownVbucketsRequest

type ShutdownVbucketsRequest struct {
	Topic              *string     `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	ShutdownTimestamps []*TsVbuuid `protobuf:"bytes,2,rep,name=shutdownTimestamps" json:"shutdownTimestamps,omitempty"`
	XXX_unrecognized   []byte      `json:"-"`
}

ShutdownVbucketsRequest will shutdown a subset of vbuckets for each specified buckets. Respond back with TopicResponse

func NewShutdownVbucketsRequest

func NewShutdownVbucketsRequest(topic string) *ShutdownVbucketsRequest

NewShutdownVbucketsRequest creates a ShutdownVbucketsRequest for topic, later a list of {pool,bucket,timestamp} need to be added before posting the request.

func (*ShutdownVbucketsRequest) AddStreams

func (req *ShutdownVbucketsRequest) AddStreams(
	pool, bucket string, ts *c.TsVbuuid) *ShutdownVbucketsRequest

AddStreams will add a subset of vbuckets to be restarted for a bucket.

func (*ShutdownVbucketsRequest) Append

func (req *ShutdownVbucketsRequest) Append(
	shutdownTs *TsVbuuid) *ShutdownVbucketsRequest

Append add a shutdown-timestamp for {pool,bucket,[]vbuckets} to this topic.

func (*ShutdownVbucketsRequest) ContentType

func (resp *ShutdownVbucketsRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*ShutdownVbucketsRequest) Decode

func (resp *ShutdownVbucketsRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*ShutdownVbucketsRequest) Encode

func (resp *ShutdownVbucketsRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*ShutdownVbucketsRequest) GetShutdownTimestamps

func (m *ShutdownVbucketsRequest) GetShutdownTimestamps() []*TsVbuuid

func (*ShutdownVbucketsRequest) GetTopic

func (m *ShutdownVbucketsRequest) GetTopic() string

func (*ShutdownVbucketsRequest) Name

func (resp *ShutdownVbucketsRequest) Name() string

Name implement MessageMarshaller{} interface

func (*ShutdownVbucketsRequest) ProtoMessage

func (*ShutdownVbucketsRequest) ProtoMessage()

func (*ShutdownVbucketsRequest) Reset

func (m *ShutdownVbucketsRequest) Reset()

func (*ShutdownVbucketsRequest) String

func (m *ShutdownVbucketsRequest) String() string

type SinglePartition

type SinglePartition struct {
	Endpoints        []string `protobuf:"bytes,1,rep,name=endpoints" json:"endpoints,omitempty"`
	CoordEndpoint    *string  `protobuf:"bytes,2,opt,name=coordEndpoint" json:"coordEndpoint,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

SinglePartition is an oxymoron - the purpose of partition is to scale-out, but using this partition-scheme for an index means the full data set is kept on the same node.

func NewSinglePartition

func NewSinglePartition(endpoints []string) *SinglePartition

NewSinglePartition return a new partition instance, initialized with a list of endpoint hosts.

func (*SinglePartition) AddEndpoint

func (p *SinglePartition) AddEndpoint(endpoint string) *SinglePartition

AddEndpoint add a host to list of endpoints.

func (*SinglePartition) AddEndpoints

func (p *SinglePartition) AddEndpoints(endpoints []string) *SinglePartition

AddEndpoints add a list of hosts to endpoints.

func (*SinglePartition) DeletionEndpoints

func (p *SinglePartition) DeletionEndpoints(
	inst *IndexInst, m *mc.DcpEvent, oldPartKey, oldKey []byte) []string

DeletionEndpoints implements Partition{} interface. - not sent to coordinator-endpoint - `oldPartKey` is ignored. - for now, `oldKey` is ignored.

func (*SinglePartition) GetCoordEndpoint

func (m *SinglePartition) GetCoordEndpoint() string

func (*SinglePartition) GetEndpoints

func (m *SinglePartition) GetEndpoints() []string

func (*SinglePartition) Hosts

func (p *SinglePartition) Hosts(inst *IndexInst) []string

Hosts implements Partition{} interface.

func (*SinglePartition) ProtoMessage

func (*SinglePartition) ProtoMessage()

func (*SinglePartition) Reset

func (m *SinglePartition) Reset()

func (*SinglePartition) SetCoordinatorEndpoint

func (p *SinglePartition) SetCoordinatorEndpoint(endpoint string) *SinglePartition

SetCoordinatorEndpoint will set coordinator endpoint, that is different from other endpoints.

func (*SinglePartition) String

func (m *SinglePartition) String() string

func (*SinglePartition) UpsertDeletionEndpoints

func (p *SinglePartition) UpsertDeletionEndpoints(
	inst *IndexInst, m *mc.DcpEvent, oldPartKey, key, oldKey []byte) []string

UpsertDeletionEndpoints implements Partition{} interface. - sent only if where clause is false. - downstream can use immutable flag to opimtimize back-index lookup. - `key` is always nil - `partnKey` is ignored. - for now, `oldKey` is ignored.

func (*SinglePartition) UpsertEndpoints

func (p *SinglePartition) UpsertEndpoints(
	inst *IndexInst, m *mc.DcpEvent, partKey, key, oldKey []byte) []string

UpsertEndpoints implements Partition{} interface.

  • sent only if where clause is true.
  • UpsertDeletion is implied for every UpsertEndpoint.
  • if `key` is empty downstream shall consider Upsert as NOOP and only apply UpsertDeletion.
  • `partnKey` is ignored.
  • for now, `oldKey` is ignored.

type Snapshot

type Snapshot struct {
	Start            *uint64 `protobuf:"varint,1,req,name=start" json:"start,omitempty"`
	End              *uint64 `protobuf:"varint,2,req,name=end" json:"end,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

Start and end of DCP snapshot

func NewSnapshot

func NewSnapshot(start, end uint64) *Snapshot

func (*Snapshot) GetEnd

func (m *Snapshot) GetEnd() uint64

func (*Snapshot) GetStart

func (m *Snapshot) GetStart() uint64

func (*Snapshot) ProtoMessage

func (*Snapshot) ProtoMessage()

func (*Snapshot) Reset

func (m *Snapshot) Reset()

func (*Snapshot) String

func (m *Snapshot) String() string

type StorageType

type StorageType int32

List of possible index storage algorithms.

const (
	StorageType_forestdb         StorageType = 1
	StorageType_memdb            StorageType = 2
	StorageType_memory_optimized StorageType = 3
)

func (StorageType) Enum

func (x StorageType) Enum() *StorageType

func (StorageType) String

func (x StorageType) String() string

func (*StorageType) UnmarshalJSON

func (x *StorageType) UnmarshalJSON(data []byte) error

type TestPartition

type TestPartition struct {
	Endpoints        []string `protobuf:"bytes,1,rep,name=endpoints" json:"endpoints,omitempty"`
	CoordEndpoint    *string  `protobuf:"bytes,2,opt,name=coordEndpoint" json:"coordEndpoint,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

Example TestPartition, can be used during development.

func NewTestParitition

func NewTestParitition(endpoints []string) *TestPartition

NewTestParitition return a new partition instance, initialized with a list of endpoint nodes excluding coordinator.

func (*TestPartition) AddEndpoint

func (p *TestPartition) AddEndpoint(endpoint string) *TestPartition

AddEndpoint add a host to list of endpoints.

func (*TestPartition) AddEndpoints

func (p *TestPartition) AddEndpoints(endpoints []string) *TestPartition

AddEndpoints add a list of hosts to endpoints.

func (*TestPartition) DeletionEndpoints

func (p *TestPartition) DeletionEndpoints(
	inst *IndexInst, m *mc.DcpEvent, oldPartKey, oldKey []byte) []string

DeletionEndpoints implements Partition{} interface. Full broadcast.

func (*TestPartition) GetCoordEndpoint

func (m *TestPartition) GetCoordEndpoint() string

func (*TestPartition) GetEndpoints

func (m *TestPartition) GetEndpoints() []string

func (*TestPartition) Hosts

func (p *TestPartition) Hosts(inst *IndexInst) []string

Hosts implements Partition{} interface.

func (*TestPartition) ProtoMessage

func (*TestPartition) ProtoMessage()

func (*TestPartition) Reset

func (m *TestPartition) Reset()

func (*TestPartition) SetCoordinatorEndpoint

func (p *TestPartition) SetCoordinatorEndpoint(endpoint string) *TestPartition

SetCoordinatorEndpoint will set coordinator endpoint, that is different from other endpoints.

func (*TestPartition) String

func (m *TestPartition) String() string

func (*TestPartition) UpsertDeletionEndpoints

func (p *TestPartition) UpsertDeletionEndpoints(
	inst *IndexInst, m *mc.DcpEvent, oldPartKey, key, oldKey []byte) []string

UpsertDeletionEndpoints implements Partition{} interface. Full broadcast.

func (*TestPartition) UpsertEndpoints

func (p *TestPartition) UpsertEndpoints(
	inst *IndexInst, m *mc.DcpEvent, partKey, key, oldKey []byte) []string

UpsertEndpoints implements Partition{} interface. Full broadcast.

type TimestampResponse

type TimestampResponse struct {
	Topic             *string     `protobuf:"bytes,1,req,name=topic" json:"topic,omitempty"`
	CurrentTimestamps []*TsVbuuid `protobuf:"bytes,2,rep,name=currentTimestamps" json:"currentTimestamps,omitempty"`
	Err               *Error      `protobuf:"bytes,3,opt,name=err" json:"err,omitempty"`
	XXX_unrecognized  []byte      `json:"-"`
}

Response back for AddInstancesRequest

func (*TimestampResponse) AddCurrentTimestamp

func (tsResp *TimestampResponse) AddCurrentTimestamp(
	pooln, bucketn string, curSeqnos map[uint16]uint64) *TimestampResponse

AddCurrentTimestamp will add a subset of vbucket's rollback-timestamp for a `bucket`.

func (*TimestampResponse) ContentType

func (tsResp *TimestampResponse) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*TimestampResponse) Decode

func (tsResp *TimestampResponse) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*TimestampResponse) Encode

func (tsResp *TimestampResponse) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*TimestampResponse) GetCurrentTimestamps

func (m *TimestampResponse) GetCurrentTimestamps() []*TsVbuuid

func (*TimestampResponse) GetErr

func (m *TimestampResponse) GetErr() *Error

func (*TimestampResponse) GetTopic

func (m *TimestampResponse) GetTopic() string

func (*TimestampResponse) Name

func (tsResp *TimestampResponse) Name() string

Name implement MessageMarshaller{} interface

func (*TimestampResponse) ProtoMessage

func (*TimestampResponse) ProtoMessage()

func (*TimestampResponse) Reset

func (m *TimestampResponse) Reset()

func (*TimestampResponse) SetErr

func (tsResp *TimestampResponse) SetErr(err error) *TimestampResponse

SetErr update error value in response's.

func (*TimestampResponse) String

func (m *TimestampResponse) String() string

type TopicResponse

type TopicResponse struct {
	Topic              *string     `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"`
	InstanceIds        []uint64    `protobuf:"varint,2,rep,name=instanceIds" json:"instanceIds,omitempty"`
	ActiveTimestamps   []*TsVbuuid `protobuf:"bytes,3,rep,name=activeTimestamps" json:"activeTimestamps,omitempty"`
	RollbackTimestamps []*TsVbuuid `protobuf:"bytes,4,rep,name=rollbackTimestamps" json:"rollbackTimestamps,omitempty"`
	Err                *Error      `protobuf:"bytes,5,opt,name=err" json:"err,omitempty"`
	XXX_unrecognized   []byte      `json:"-"`
}

Response back for MutationTopicRequest, RestartVbucketsRequest, AddBucketsRequest

func (*TopicResponse) AddRollbackTimestamp

func (resp *TopicResponse) AddRollbackTimestamp(
	pool, bucket string, rollbTs *c.TsVbuuid) *TopicResponse

AddRollbackTimestamp will add a subset of vbucket's rollback-timestamp for a `bucket`.

func (*TopicResponse) ContentType

func (resp *TopicResponse) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*TopicResponse) Decode

func (resp *TopicResponse) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*TopicResponse) Encode

func (resp *TopicResponse) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*TopicResponse) GetActiveTimestamps

func (m *TopicResponse) GetActiveTimestamps() []*TsVbuuid

func (*TopicResponse) GetErr

func (m *TopicResponse) GetErr() *Error

func (*TopicResponse) GetInstanceIds

func (m *TopicResponse) GetInstanceIds() []uint64

func (*TopicResponse) GetRollbackTimestamps

func (m *TopicResponse) GetRollbackTimestamps() []*TsVbuuid

func (*TopicResponse) GetTopic

func (m *TopicResponse) GetTopic() string

func (*TopicResponse) Name

func (resp *TopicResponse) Name() string

Name implement MessageMarshaller{} interface

func (*TopicResponse) ProtoMessage

func (*TopicResponse) ProtoMessage()

func (*TopicResponse) Reset

func (m *TopicResponse) Reset()

func (*TopicResponse) SetErr

func (resp *TopicResponse) SetErr(err error) *TopicResponse

SetErr update error value in response's.

func (*TopicResponse) String

func (m *TopicResponse) String() string

type TsVb

type TsVb struct {
	Pool             *string  `protobuf:"bytes,1,req,name=pool" json:"pool,omitempty"`
	Bucket           *string  `protobuf:"bytes,2,req,name=bucket" json:"bucket,omitempty"`
	Vbnos            []uint32 `protobuf:"varint,3,rep,name=vbnos" json:"vbnos,omitempty"`
	Seqnos           []uint64 `protobuf:"varint,4,rep,name=seqnos" json:"seqnos,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

logical clock for a subset of vbuckets

func NewTsVb

func NewTsVb(pool, bucket string) *TsVb

func (*TsVb) Append

func (ts *TsVb) Append(vbno uint16, seqno uint64) *TsVb

Append a vbucket detail to TsVb

func (*TsVb) GetBucket

func (m *TsVb) GetBucket() string

func (*TsVb) GetPool

func (m *TsVb) GetPool() string

func (*TsVb) GetSeqnos

func (m *TsVb) GetSeqnos() []uint64

func (*TsVb) GetVbnos

func (m *TsVb) GetVbnos() []uint32

func (*TsVb) ProtoMessage

func (*TsVb) ProtoMessage()

func (*TsVb) Reset

func (m *TsVb) Reset()

func (*TsVb) String

func (m *TsVb) String() string

type TsVbFull

type TsVbFull struct {
	Pool             *string  `protobuf:"bytes,1,req,name=pool" json:"pool,omitempty"`
	Bucket           *string  `protobuf:"bytes,2,req,name=bucket" json:"bucket,omitempty"`
	Seqnos           []uint64 `protobuf:"varint,3,rep,name=seqnos" json:"seqnos,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

logical clock for full set of vbuckets, starting from 0 to MaxVbucket.

func NewTsVbFull

func NewTsVbFull(pool, bucket string, seqnos []uint64) *TsVbFull

func (*TsVbFull) GetBucket

func (m *TsVbFull) GetBucket() string

func (*TsVbFull) GetPool

func (m *TsVbFull) GetPool() string

func (*TsVbFull) GetSeqnos

func (m *TsVbFull) GetSeqnos() []uint64

func (*TsVbFull) ProtoMessage

func (*TsVbFull) ProtoMessage()

func (*TsVbFull) Reset

func (m *TsVbFull) Reset()

func (*TsVbFull) String

func (m *TsVbFull) String() string

type TsVbuuid

type TsVbuuid struct {
	Pool             *string     `protobuf:"bytes,1,req,name=pool" json:"pool,omitempty"`
	Bucket           *string     `protobuf:"bytes,2,req,name=bucket" json:"bucket,omitempty"`
	Vbnos            []uint32    `protobuf:"varint,3,rep,name=vbnos" json:"vbnos,omitempty"`
	Seqnos           []uint64    `protobuf:"varint,4,rep,name=seqnos" json:"seqnos,omitempty"`
	Vbuuids          []uint64    `protobuf:"varint,5,rep,name=vbuuids" json:"vbuuids,omitempty"`
	Snapshots        []*Snapshot `protobuf:"bytes,6,rep,name=snapshots" json:"snapshots,omitempty"`
	XXX_unrecognized []byte      `json:"-"`
}

logical clock for a subset of vbuckets along with branch-id and snapshot information.

func NewTsVbuuid

func NewTsVbuuid(pool, bucket string, maxvb int) *TsVbuuid

func (*TsVbuuid) Append

func (ts *TsVbuuid) Append(
	vbno uint16, seqno, vbuuid, start, end uint64) *TsVbuuid

Append a vbucket detail to TsVbuuid.

func (*TsVbuuid) Clone

func (ts *TsVbuuid) Clone() *TsVbuuid

Clone creates new copy of timestamp.

func (*TsVbuuid) ComputeFailoverTs

func (ts *TsVbuuid) ComputeFailoverTs(flogs couchbase.FailoverLog) *TsVbuuid

ComputeFailoverTs computes TsVbuuid timestamp using failover logs obtained from ns_server.

func (*TsVbuuid) ComputeRestartTs

func (ts *TsVbuuid) ComputeRestartTs(flogs couchbase.FailoverLog) *TsVbuuid

TODO: Once we confirm to use seqno as snapshot-start and snapshot-end we can let go of this function.

func (*TsVbuuid) Contains

func (ts *TsVbuuid) Contains(vbno uint16) bool

Contains with check whether `vbno` has an entry in the timestamp.

func (*TsVbuuid) FilterByVbuckets

func (ts *TsVbuuid) FilterByVbuckets(vbuckets []uint16) *TsVbuuid

FilterByVbuckets will exclude `vbuckets` from `ts`, both `ts` and `vbuckets` are expected to be pre-sorted.

func (*TsVbuuid) FromTsVbuuid

func (ts *TsVbuuid) FromTsVbuuid(nativeTs *c.TsVbuuid) *TsVbuuid

FromTsVbuuid converts timestamp from common.TsVbuuid to protobuf format.

func (*TsVbuuid) Get

func (ts *TsVbuuid) Get(
	vbno uint16) (seqno, vbuuid, sStart, sEnd uint64, err error)

Get entry details like seqno, vbuuid, snapshot for `vbno`.

func (*TsVbuuid) GetBucket

func (m *TsVbuuid) GetBucket() string

func (*TsVbuuid) GetPool

func (m *TsVbuuid) GetPool() string

func (*TsVbuuid) GetSeqnos

func (m *TsVbuuid) GetSeqnos() []uint64

func (*TsVbuuid) GetSnapshots

func (m *TsVbuuid) GetSnapshots() []*Snapshot

func (*TsVbuuid) GetVbnos

func (m *TsVbuuid) GetVbnos() []uint32

func (*TsVbuuid) GetVbuuids

func (m *TsVbuuid) GetVbuuids() []uint64

func (*TsVbuuid) InitialRestartTs

func (ts *TsVbuuid) InitialRestartTs(flogs couchbase.FailoverLog) *TsVbuuid

InitialRestartTs for a subset of vbuckets.

func (*TsVbuuid) IsEmpty

func (ts *TsVbuuid) IsEmpty() bool

IsEmpty returns true if the timestamp does not contain any vbucket entries.

func (*TsVbuuid) Len

func (ts *TsVbuuid) Len() int

func (*TsVbuuid) Less

func (ts *TsVbuuid) Less(i, j int) bool

func (*TsVbuuid) ProtoMessage

func (*TsVbuuid) ProtoMessage()

func (*TsVbuuid) Repr

func (ts *TsVbuuid) Repr() string

func (*TsVbuuid) Reset

func (m *TsVbuuid) Reset()

func (*TsVbuuid) SelectByVbuckets

func (ts *TsVbuuid) SelectByVbuckets(vbuckets []uint16) *TsVbuuid

SelectByVbuckets will select vbuckets from `ts` for a subset of `vbuckets`, both `ts` and `vbuckets` are expected to be pre-sorted.

func (*TsVbuuid) SeqnoFor

func (ts *TsVbuuid) SeqnoFor(vbno uint16) (uint64, error)

func (*TsVbuuid) Set

func (ts *TsVbuuid) Set(
	vbno uint16, seqno, vbuuid, sStart, sEnd uint64) (err error)

Set entry details like seqno, vbuuid, snapshot for `vbno`.

func (*TsVbuuid) String

func (m *TsVbuuid) String() string

func (*TsVbuuid) Swap

func (ts *TsVbuuid) Swap(i, j int)

func (*TsVbuuid) ToTsVbuuid

func (ts *TsVbuuid) ToTsVbuuid(maxVbuckets int) *c.TsVbuuid

ToTsVbuuid converts timestamp from protobuf format to common.TsVbuuid, later requires the full set of timestamp.

func (*TsVbuuid) Union

func (ts *TsVbuuid) Union(other *TsVbuuid) *TsVbuuid

Union will return a union set of timestamps based on Vbuckets. Duplicate vbucket entries in `other` timestamp will be skipped.

func (*TsVbuuid) VerifyBranch

func (ts *TsVbuuid) VerifyBranch(vbnos []uint16, vbuuids []uint64) bool

VerifyBranch shall verify whether the timestamp branch-id for each vbucket matches with input arguments.

type VbmapRequest

type VbmapRequest struct {
	Pool             *string  `protobuf:"bytes,1,req,name=pool" json:"pool,omitempty"`
	Bucket           *string  `protobuf:"bytes,2,req,name=bucket" json:"bucket,omitempty"`
	Kvaddrs          []string `protobuf:"bytes,3,rep,name=kvaddrs" json:"kvaddrs,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

Requested by Coordinator/indexer to learn vbuckets hosted by kvnodes.

func NewVbmapRequest

func NewVbmapRequest(pool, bucket string, kvaddrs []string) *VbmapRequest

NewVbmapRequest will compose a adminport request for fetching vbmap for specified list of kvnodes.

func (*VbmapRequest) ContentType

func (req *VbmapRequest) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*VbmapRequest) Decode

func (req *VbmapRequest) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*VbmapRequest) Encode

func (req *VbmapRequest) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*VbmapRequest) GetBucket

func (m *VbmapRequest) GetBucket() string

func (*VbmapRequest) GetKvaddrs

func (m *VbmapRequest) GetKvaddrs() []string

func (*VbmapRequest) GetPool

func (m *VbmapRequest) GetPool() string

func (*VbmapRequest) Name

func (req *VbmapRequest) Name() string

Name implement MessageMarshaller{} interface

func (*VbmapRequest) ProtoMessage

func (*VbmapRequest) ProtoMessage()

func (*VbmapRequest) Reset

func (m *VbmapRequest) Reset()

func (*VbmapRequest) String

func (m *VbmapRequest) String() string

type VbmapResponse

type VbmapResponse struct {
	Kvaddrs          []string    `protobuf:"bytes,1,rep,name=kvaddrs" json:"kvaddrs,omitempty"`
	Kvvbnos          []*Vbuckets `protobuf:"bytes,2,rep,name=kvvbnos" json:"kvvbnos,omitempty"`
	Err              *Error      `protobuf:"bytes,3,opt,name=err" json:"err,omitempty"`
	XXX_unrecognized []byte      `json:"-"`
}

func NewVbmapResponse

func NewVbmapResponse() *VbmapResponse

NewVbmapResponse will compose result message for VbmapRequest

func (*VbmapResponse) AllVbuckets16

func (resp *VbmapResponse) AllVbuckets16() []uint16

AllVbuckets16 return all vbuckets hosted by all kvnodes in sort order. vbuckets are returned as 16-bit values.

func (*VbmapResponse) AllVbuckets32

func (resp *VbmapResponse) AllVbuckets32() []uint32

AllVbuckets32 return all vbuckets hosted by all kvnodes in sort order. vbuckets are returned as 32-bit values.

func (*VbmapResponse) AppendVbmap

func (resp *VbmapResponse) AppendVbmap(kvaddr string, vbnos []uint16) *VbmapResponse

AppendVbmap for `kvaddr` to vbmap-response.

func (*VbmapResponse) AppendVbmaps

func (resp *VbmapResponse) AppendVbmaps(kvaddrs []string, vbnos [][]uint16) *VbmapResponse

AppendVbmaps for a list of `kvaddrs` to vbmap-response.

func (*VbmapResponse) ContentType

func (resp *VbmapResponse) ContentType() string

ContentType implement MessageMarshaller{} interface

func (*VbmapResponse) Decode

func (resp *VbmapResponse) Decode(data []byte) (err error)

Decode implement MessageMarshaller{} interface

func (*VbmapResponse) Encode

func (resp *VbmapResponse) Encode() (data []byte, err error)

Encode implement MessageMarshaller{} interface

func (*VbmapResponse) GetErr

func (m *VbmapResponse) GetErr() *Error

func (*VbmapResponse) GetKvaddrs

func (m *VbmapResponse) GetKvaddrs() []string

func (*VbmapResponse) GetKvvbnos

func (m *VbmapResponse) GetKvvbnos() []*Vbuckets

func (*VbmapResponse) GetVbmaps

func (resp *VbmapResponse) GetVbmaps() (map[string][]uint16, error)

GetVbmaps return a map of kvaddr -> list-of-vbuckets in node.

func (*VbmapResponse) LocateVbucket

func (resp *VbmapResponse) LocateVbucket(vbno uint32) string

LocateVbucket will identify the kvnode that is hosting the vbucket.

func (*VbmapResponse) Name

func (resp *VbmapResponse) Name() string

Name implement MessageMarshaller{} interface

func (*VbmapResponse) ProtoMessage

func (*VbmapResponse) ProtoMessage()

func (*VbmapResponse) Reset

func (m *VbmapResponse) Reset()

func (*VbmapResponse) SetErr

func (resp *VbmapResponse) SetErr(err error) *VbmapResponse

SetErr for vbmap-response.

func (*VbmapResponse) String

func (m *VbmapResponse) String() string

type Vbuckets

type Vbuckets struct {
	Vbnos            []uint32 `protobuf:"varint,1,rep,name=vbnos" json:"vbnos,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

list of vbucket numbers

func (*Vbuckets) GetVbnos

func (m *Vbuckets) GetVbnos() []uint32

func (*Vbuckets) ProtoMessage

func (*Vbuckets) ProtoMessage()

func (*Vbuckets) Reset

func (m *Vbuckets) Reset()

func (*Vbuckets) String

func (m *Vbuckets) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL