protobuf

package
v0.0.0-...-b800c40 Latest Latest
Warning

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

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

Documentation

Overview

Package protobuf is a generated protocol buffer package.

It is generated from these files:

mutation.proto

It has these top-level messages:

Payload
VbConnectionMap
VbKeyVersions
KeyVersions

Index

Constants

This section is empty.

Variables

View Source
var Command_name = map[int32]string{
	1: "Upsert",
	2: "Deletion",
	3: "UpsertDeletion",
	4: "Sync",
	5: "DropData",
	6: "StreamBegin",
	7: "StreamEnd",
}
View Source
var Command_value = map[string]int32{
	"Upsert":         1,
	"Deletion":       2,
	"UpsertDeletion": 3,
	"Sync":           4,
	"DropData":       5,
	"StreamBegin":    6,
	"StreamEnd":      7,
}

Functions

This section is empty.

Types

type Command

type Command int32

List of possible mutation commands.

const (
	Command_Upsert         Command = 1
	Command_Deletion       Command = 2
	Command_UpsertDeletion Command = 3
	Command_Sync           Command = 4
	Command_DropData       Command = 5
	Command_StreamBegin    Command = 6
	Command_StreamEnd      Command = 7
)

func (Command) Enum

func (x Command) Enum() *Command

func (Command) String

func (x Command) String() string

func (*Command) UnmarshalJSON

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

type KeyVersions

type KeyVersions struct {
	Seqno            *uint64  `protobuf:"varint,1,req,name=seqno" json:"seqno,omitempty"`
	Docid            []byte   `protobuf:"bytes,2,opt,name=docid" json:"docid,omitempty"`
	Uuids            []uint64 `protobuf:"varint,3,rep,name=uuids" json:"uuids,omitempty"`
	Commands         []uint32 `protobuf:"varint,4,rep,name=commands" json:"commands,omitempty"`
	Keys             [][]byte `protobuf:"bytes,5,rep,name=keys" json:"keys,omitempty"`
	Oldkeys          [][]byte `protobuf:"bytes,6,rep,name=oldkeys" json:"oldkeys,omitempty"`
	Partnkeys        [][]byte `protobuf:"bytes,7,rep,name=partnkeys" json:"partnkeys,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

mutations are broadly divided into data and control messages. The division is based on the commands.

Interpreting seq.no:

  1. For Upsert, Deletion, UpsertDeletion messages, sequence number corresponds to kv mutation.
  2. For Sync message, it is the latest kv mutation sequence-no. received for a vbucket.
  3. For DropData message, it is the first kv mutation that was dropped due to buffer overflow.
  4. For StreamBegin, it is zero.
  5. For StreamEnd, it is the last kv mutation received before ending a vbucket stream with kv.

Interpreting Snapshot marker:

Key versions can contain snapshot-marker {start-seqno, end-seqno},
instead of using separate field for them, following fields are
mis-interpreted,
  uuid   - type  (8 byte)
  key    - start-seqno (8 byte)
  oldkey - end-seqno (8 byte)

fields `docid`, `uuids`, `keys`, `oldkeys` are valid only for Upsert, Deletion, UpsertDeletion messages.

func (*KeyVersions) GetCommands

func (m *KeyVersions) GetCommands() []uint32

func (*KeyVersions) GetDocid

func (m *KeyVersions) GetDocid() []byte

func (*KeyVersions) GetKeys

func (m *KeyVersions) GetKeys() [][]byte

func (*KeyVersions) GetOldkeys

func (m *KeyVersions) GetOldkeys() [][]byte

func (*KeyVersions) GetPartnkeys

func (m *KeyVersions) GetPartnkeys() [][]byte

func (*KeyVersions) GetSeqno

func (m *KeyVersions) GetSeqno() uint64

func (*KeyVersions) GetUuids

func (m *KeyVersions) GetUuids() []uint64

func (*KeyVersions) ProtoMessage

func (*KeyVersions) ProtoMessage()

func (*KeyVersions) Reset

func (m *KeyVersions) Reset()

func (*KeyVersions) Snapshot

func (kv *KeyVersions) Snapshot() (typ uint32, start, end uint64)

func (*KeyVersions) String

func (m *KeyVersions) String() string

type Payload

type Payload struct {
	Version *uint32 `protobuf:"varint,1,req,name=version" json:"version,omitempty"`
	// -- Following fields are mutually exclusive --
	Vbkeys           []*VbKeyVersions `protobuf:"bytes,2,rep,name=vbkeys" json:"vbkeys,omitempty"`
	Vbmap            *VbConnectionMap `protobuf:"bytes,3,opt,name=vbmap" json:"vbmap,omitempty"`
	XXX_unrecognized []byte           `json:"-"`
}

A single mutation message that will framed and transported by router. For efficiency mutations from mutiple vbuckets (bounded to same connection) can be packed into the same message.

func (*Payload) GetVbkeys

func (m *Payload) GetVbkeys() []*VbKeyVersions

func (*Payload) GetVbmap

func (m *Payload) GetVbmap() *VbConnectionMap

func (*Payload) GetVersion

func (m *Payload) GetVersion() uint32

func (*Payload) ProtoMessage

func (*Payload) ProtoMessage()

func (*Payload) Reset

func (m *Payload) Reset()

func (*Payload) String

func (m *Payload) String() string

func (*Payload) Value

func (pl *Payload) Value() interface{}

type VbConnectionMap

type VbConnectionMap struct {
	Bucket           *string  `protobuf:"bytes,1,req,name=bucket" json:"bucket,omitempty"`
	Vbuckets         []uint32 `protobuf:"varint,3,rep,name=vbuckets" json:"vbuckets,omitempty"`
	Vbuuids          []uint64 `protobuf:"varint,4,rep,name=vbuuids" json:"vbuuids,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

List of vbuckets that will be streamed via a newly opened connection.

func (*VbConnectionMap) GetBucket

func (m *VbConnectionMap) GetBucket() string

func (*VbConnectionMap) GetVbuckets

func (m *VbConnectionMap) GetVbuckets() []uint32

func (*VbConnectionMap) GetVbuuids

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

func (*VbConnectionMap) ProtoMessage

func (*VbConnectionMap) ProtoMessage()

func (*VbConnectionMap) Reset

func (m *VbConnectionMap) Reset()

func (*VbConnectionMap) String

func (m *VbConnectionMap) String() string

type VbKeyVersions

type VbKeyVersions struct {
	Vbucket          *uint32        `protobuf:"varint,2,req,name=vbucket" json:"vbucket,omitempty"`
	Vbuuid           *uint64        `protobuf:"varint,3,req,name=vbuuid" json:"vbuuid,omitempty"`
	Bucketname       *string        `protobuf:"bytes,4,req,name=bucketname" json:"bucketname,omitempty"`
	Kvs              []*KeyVersions `protobuf:"bytes,5,rep,name=kvs" json:"kvs,omitempty"`
	XXX_unrecognized []byte         `json:"-"`
}

func (*VbKeyVersions) GetBucketname

func (m *VbKeyVersions) GetBucketname() string

func (*VbKeyVersions) GetKvs

func (m *VbKeyVersions) GetKvs() []*KeyVersions

func (*VbKeyVersions) GetVbucket

func (m *VbKeyVersions) GetVbucket() uint32

func (*VbKeyVersions) GetVbuuid

func (m *VbKeyVersions) GetVbuuid() uint64

func (*VbKeyVersions) ProtoMessage

func (*VbKeyVersions) ProtoMessage()

func (*VbKeyVersions) Reset

func (m *VbKeyVersions) Reset()

func (*VbKeyVersions) String

func (m *VbKeyVersions) String() string

Jump to

Keyboard shortcuts

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