Documentation ¶
Overview ¶
@author Couchbase <info@couchbase.com> @copyright 2015 Couchbase, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func BucketSeqnos(cluster, pooln, bucketn string) (l_seqnos []uint64, err error)
- func BucketSeqsTiming(bucket string) *stats.TimingStat
- func BucketTs(bucket *couchbase.Bucket, maxvb int) (seqnos, vbuuids []uint64, err error)
- func ClusterAuthUrl(cluster string) (string, error)
- func ClusterUrl(cluster string) string
- func CollectSeqnos(kvfeeds map[string]*kvConn) (l_seqnos []uint64, err error)
- func CommonStrings(xs []string, ys []string) []string
- func ComputeAvg(lastAvg, lastValue, currValue int64) int64
- func ComputePercent(a, b int64) int64
- func ConnectBucket(cluster, pooln, bucketn string) (*couchbase.Bucket, error)
- func Console(clusterAddr string, format string, v ...interface{}) error
- func CopyDir(dest, source string) error
- func CopyFile(dest, source string) (err error)
- func CrashOnError(err error)
- func DiskUsage(dir string) (int64, error)
- func EquivalentIP(raddr string, raddrs []string) (this string, other string, err error)
- func ExcludeStrings(strs []string, excludes []string) []string
- func ExcludeUint32(xs []uint32, from []uint32) []uint32
- func ExcludeUint64(xs []uint64, from []uint64) []uint64
- func ExitOnStdinClose()
- func FailsafeOp(reqch, respch chan []interface{}, cmd []interface{}, finch chan bool) ([]interface{}, error)
- func FailsafeOpAsync(reqch chan []interface{}, cmd []interface{}, finch chan bool) error
- func FailsafeOpNoblock(reqch chan []interface{}, cmd []interface{}, finch chan bool) error
- func FileSize(name string) (int64, error)
- func FormatIndexInstDisplayName(name string, replicaId int) string
- func GenNextBiggerKey(b []byte) []byte
- func GetBucketUUID(cluster, bucket string) (string, error)
- func GetColocatedHost(cluster string) (string, error)
- func GetKVAddrs(cluster, pooln, bucketn string) ([]string, error)
- func GetLocalIP() (net.IP, error)
- func HasString(str string, strs []string) bool
- func HasUint32(item uint32, xs []uint32) bool
- func HasUint64(item uint64, xs []uint64) bool
- func HashVbuuid(vbuuids []uint64) uint64
- func IndexStatement(def IndexDefn, printNodes bool) string
- func Intersection(this, other []uint16) []uint16
- func IsAllAllowed(creds cbauth.Creds, permissions []string, w http.ResponseWriter) bool
- func IsAllowed(creds cbauth.Creds, permissions []string, w http.ResponseWriter) bool
- func IsAuthValid(r *http.Request) (cbauth.Creds, bool, error)
- func IsEquivalentIndex(d1, d2 *IndexDefn) bool
- func IsIPLocal(ip string) bool
- func IsPathExist(path string) bool
- func IsValidIndexName(n string) error
- func IsValidIndexType(t string) bool
- func LogOs() string
- func LogRuntime() string
- func MarshallIndexDefn(defn *IndexDefn) ([]byte, error)
- func MaxVbuckets(bucket *couchbase.Bucket) (int, error)
- func MaybeSetEnv(key, value string) string
- func MemstatLogger(tick int64)
- func MetakvDel(path string) error
- func MetakvGet(path string, v interface{}) (bool, error)
- func MetakvRecurciveDel(dirpath string) error
- func MetakvSet(path string, v interface{}) error
- func OpError(err error, vals []interface{}, idx int) error
- func PrintMemstats(ms *runtime.MemStats, PauseNs []uint64, oldNumGC uint32)
- func RemoveString(item string, xs []string) []string
- func RemoveUint16(item uint16, xs []uint16) []uint16
- func RemoveUint32(item uint32, xs []uint32) []uint32
- func SeedProcess()
- func SetBuildMode(mode BuildMode)
- func SetClusterStorageMode(mode StorageMode)
- func SetClusterStorageModeStr(mode string) bool
- func SetNumCPUs(percent int) int
- func SetServicePorts(portMap map[string]string)
- func SetStorageMode(mode StorageMode)
- func SetStorageModeStr(mode string) bool
- func SetupSettingsNotifier(callb func(Config), cancelCh chan struct{})
- func StreamID(bucket string, vbno uint16) string
- func Union(this, other []uint16) []uint16
- func Vbno16to32(vbnos []uint16) []uint32
- func Vbno32to16(vbnos []uint32) []uint16
- type BuildMode
- type ByteSlices
- type BytesBufPool
- type CbAuthHandler
- type ClusterInfoCache
- func (c *ClusterInfoCache) Fetch() error
- func (c *ClusterInfoCache) GetActiveIndexerNodes() (nodes []couchbase.Node)
- func (c *ClusterInfoCache) GetBucketUUID(bucket string) (uuid string)
- func (c *ClusterInfoCache) GetClusterVersion() uint64
- func (c *ClusterInfoCache) GetCurrentNode() NodeId
- func (c *ClusterInfoCache) GetFailedIndexerNodes() (nodes []couchbase.Node)
- func (c *ClusterInfoCache) GetLocalHostAddress() (string, error)
- func (c *ClusterInfoCache) GetLocalHostname() (string, error)
- func (c *ClusterInfoCache) GetLocalServerGroup() (string, error)
- func (c *ClusterInfoCache) GetLocalServiceAddress(srvc string) (string, error)
- func (c *ClusterInfoCache) GetLocalServiceHost(srvc string) (string, error)
- func (c *ClusterInfoCache) GetLocalServicePort(srvc string) (string, error)
- func (c *ClusterInfoCache) GetNewIndexerNodes() (nodes []couchbase.Node)
- func (c *ClusterInfoCache) GetNodeStatus(nid NodeId) (string, error)
- func (c *ClusterInfoCache) GetNodesByBucket(bucket string) (nids []NodeId, err error)
- func (c *ClusterInfoCache) GetNodesByServiceType(srvc string) (nids []NodeId)
- func (c *ClusterInfoCache) GetServerGroup(nid NodeId) string
- func (c *ClusterInfoCache) GetServiceAddress(nid NodeId, srvc string) (addr string, err error)
- func (c *ClusterInfoCache) GetVBuckets(nid NodeId, bucket string) (vbs []uint32, err error)
- func (c *ClusterInfoCache) IsEphemeral(bucket string) (bool, error)
- func (c *ClusterInfoCache) IsNodeHealthy(nid NodeId) (bool, error)
- func (c *ClusterInfoCache) SetLogPrefix(p string)
- func (c *ClusterInfoCache) SetMaxRetries(r int)
- func (c *ClusterInfoCache) SetServicePorts(portMap map[string]string)
- type Config
- func (config Config) Clone() Config
- func (config Config) FilterConfig(subs string) Config
- func (config Config) Json() []byte
- func (config Config) LogConfig(prefix string)
- func (config Config) Override(others ...Config) Config
- func (config Config) OverrideForce(others ...Config) Config
- func (config Config) SectionConfig(prefix string, trim bool) Config
- func (config Config) Set(key string, cv ConfigValue) Config
- func (config Config) SetValue(key string, value interface{}) error
- func (config Config) Update(data interface{}) error
- type ConfigHolder
- type ConfigValue
- type Consistency
- type DDLRequestSource
- type DataportKeyVersions
- type Endpoint
- type Evaluator
- type ExprType
- type IndexDefn
- type IndexDefnId
- type IndexInst
- type IndexInstId
- type IndexInstMap
- type IndexKey
- type IndexSnapType
- type IndexState
- type IndexStatistics
- type IndexType
- type IndexerErrCode
- type IndexerError
- type IndexerId
- type IndexerState
- type KeyPartitionContainer
- func (pc *KeyPartitionContainer) AddPartition(id PartitionId, p PartitionDefn)
- func (pc *KeyPartitionContainer) GetAllPartitions() []PartitionDefn
- func (pc *KeyPartitionContainer) GetEndpointsByPartitionId(id PartitionId) []Endpoint
- func (pc *KeyPartitionContainer) GetEndpointsByPartitionKey(key PartitionKey) []Endpoint
- func (pc *KeyPartitionContainer) GetNumPartitions() int
- func (pc *KeyPartitionContainer) GetPartitionById(id PartitionId) PartitionDefn
- func (pc *KeyPartitionContainer) GetPartitionIdByPartitionKey(key PartitionKey) PartitionId
- func (pc *KeyPartitionContainer) RemovePartition(id PartitionId)
- func (pc *KeyPartitionContainer) UpdatePartition(id PartitionId, p PartitionDefn)
- type KeyPartitionDefn
- type KeyVersions
- func (kv *KeyVersions) AddDeletion(uuid uint64, oldkey []byte)
- func (kv *KeyVersions) AddDropData()
- func (kv *KeyVersions) AddSnapshot(typ uint32, start, end uint64)
- func (kv *KeyVersions) AddStreamBegin()
- func (kv *KeyVersions) AddStreamEnd()
- func (kv *KeyVersions) AddSync()
- func (kv *KeyVersions) AddUpsert(uuid uint64, key, oldkey []byte)
- func (kv *KeyVersions) AddUpsertDeletion(uuid uint64, oldkey []byte)
- func (kv *KeyVersions) Equal(other *KeyVersions) bool
- func (kv *KeyVersions) Free()
- func (kv *KeyVersions) Length() int
- func (kv *KeyVersions) String() string
- type MetadataRequestContext
- type NodeId
- type Notification
- type NotificationType
- type PartitionContainer
- type PartitionDefn
- type PartitionId
- type PartitionKey
- type PartitionScheme
- type Payload
- type RebalanceState
- type RetryHelper
- type Router
- type RouterEndpoint
- type RouterEndpointFactory
- type SecondaryKey
- type ServicesChangeNotifier
- type Statistics
- func (s Statistics) ContentType() string
- func (s Statistics) Decode(data []byte) (err error)
- func (s Statistics) Decr(path string, vals ...int)
- func (s Statistics) Encode() (data []byte, err error)
- func (s Statistics) Get(path string) interface{}
- func (s Statistics) Incr(path string, vals ...int)
- func (s Statistics) Lines() string
- func (s Statistics) Name() string
- func (s Statistics) Set(path string, val interface{})
- func (s Statistics) ToMap() map[string]interface{}
- type StorageMode
- type StreamId
- type TokenBuildSource
- type TokenState
- type TokenTransferMode
- type TransferToken
- type TsVb
- type TsVbFull
- type TsVbuuid
- func (ts *TsVbuuid) AsRecent(other *TsVbuuid) bool
- func (ts *TsVbuuid) AsRecentTs(other *TsVbuuid) bool
- func (ts *TsVbuuid) CheckCrc64(other *TsVbuuid) bool
- func (ts *TsVbuuid) CheckSnapAligned() bool
- func (ts *TsVbuuid) Clone() *TsVbuuid
- func (ts *TsVbuuid) CompareVbuuids(other *TsVbuuid) bool
- func (ts *TsVbuuid) Copy() *TsVbuuid
- func (ts *TsVbuuid) CopyFrom(src *TsVbuuid)
- func (ts *TsVbuuid) Diff(other *TsVbuuid) string
- func (ts *TsVbuuid) Equal(other *TsVbuuid) bool
- func (ts *TsVbuuid) Free()
- func (ts *TsVbuuid) GetCrc64() uint64
- func (ts *TsVbuuid) GetSnapType() IndexSnapType
- func (ts *TsVbuuid) GetVbnos() []uint16
- func (ts *TsVbuuid) HasDisableAlign() bool
- func (ts *TsVbuuid) HasLargeSnapshot() bool
- func (ts *TsVbuuid) IsEpoch() bool
- func (ts *TsVbuuid) IsSnapAligned() bool
- func (ts *TsVbuuid) Len() int
- func (ts *TsVbuuid) SetDisableAlign(disable bool)
- func (ts *TsVbuuid) SetLargeSnapshot(largeSnap bool)
- func (ts *TsVbuuid) SetSnapAligned(snapAligned bool)
- func (ts *TsVbuuid) SetSnapType(typ IndexSnapType)
- func (ts *TsVbuuid) String() string
- type UUID
- type Unbounded
- type VbConnectionMap
- type VbKeyVersions
- type Vbuckets
Constants ¶
const ( COMMUNITY = iota ENTERPRISE )
const ( INDEX_ADMIN_SERVICE = "indexAdmin" INDEX_SCAN_SERVICE = "indexScan" INDEX_HTTP_SERVICE = "indexHttp" )
const ( KEY PartitionScheme = "KEY" HASH = "HASH" RANGE = "RANGE" TEST = "TEST" SINGLE = "SINGLE" )
const ( ForestDB = "forestdb" MemDB = "memdb" MemoryOptimized = "memory_optimized" PlasmaDB = "plasma" )
const ( PayloadKeyVersions byte = iota + 1 PayloadVbmap )
types of payload
const ( Upsert byte = iota + 1 // data command Deletion // data command UpsertDeletion // data command Sync // control command DropData // control command StreamBegin // control command StreamEnd // control command Snapshot // control command )
List of possible mutation commands. Mutation messages are broadly divided into data and control messages. The division is based on the command field.
const ( IndexingMetaDir = "/indexing/" IndexingSettingsMetaDir = IndexingMetaDir + "settings/" IndexingSettingsMetaPath = IndexingSettingsMetaDir + "config" )
const ( NOT_SET = iota MOI PLASMA FORESTDB MIXED )
const BUCKET_UUID_NIL = ""
const CLUSTER_INFO_INIT_RETRIES = 5
const CLUSTER_INFO_VALIDATION_RETRIES = 10
const DEFAULT_POOL = "default"
const INDEXER_45_VERSION = 1
const INDEXER_50_VERSION = 2
const INDEXER_CUR_VERSION = INDEXER_50_VERSION
const INDEXER_ID_NIL = IndexerId("")
const IndexNamePattern = "^[A-Za-z0-9#_-]+$"
const (
MAX_AUTH_RETRIES = 10
)
const MAX_METAKV_RETRIES = 100
Variables ¶
var ( ErrInvalidNodeId = errors.New("Invalid NodeId") ErrInvalidService = errors.New("Invalid service") ErrNodeNotBucketMember = errors.New("Node is not a member of bucket") ErrValidationFailed = errors.New("ClusterInfo Validation Failed") )
var ( ErrNodeServicesConnect = errors.New("Internal services API connection closed") ErrNodeServicesCancel = errors.New("Cancelled services change notifier") ErrNotifierInvalid = errors.New("Notifier invalidated due to internal error") )
var ErrClientCancel = errors.New("Client requested cancel")
ErrClientCancel when query client cancels an ongoing scan request.
var ErrIndexNotFound = errors.New("Index not found")
Index not found
var ErrIndexNotReady = errors.New("Index not ready for serving queries")
Index not ready
var ErrIndexerInBootstrap = errors.New("Indexer In Warmup State. Please retry the request later.")
var ErrInvalidIndexName = fmt.Errorf("Invalid index name")
var ErrScanTimedOut = errors.New("Index scan timed out")
ErrScanTimedOut from indexer
var ErrorChannelFull = errors.New("secondary.channelFull")
ErrorChannelFull
var ErrorClosed = errors.New("genServer.closed")
ErrorClosed
var ErrorEmptyN1QLExpression = errors.New("secondary.emptyN1QLExpression")
ErrorEmptyN1QLExpression
var ErrorInvalidRequest = errors.New("secondary.invalidRequest")
ErrorInvalidRequest
var ErrorNotFound = errors.New("secondary.notFound")
ErrorNotFound
var ErrorNotMyVbucket = errors.New("secondary.notMyVbucket")
ErrorNotMyVbucket
var ErrorUnexpectedPayload = errors.New("secondary.unexpectedPayload")
ErrorUnexpectedPayload
var Memstatch = make(chan int64, 16)
var NUM_VBUCKETS int
var ProtobufDataPathMajorNum byte // = 0
ProtobufDataPathMajorNum major version number for mutation data path.
var ProtobufDataPathMinorNum byte = 1
ProtobufDataPathMinorNum minor version number for mutation data path.
var ServiceAddrMap map[string]string
var SystemConfig = Config{}/* 222 elements not displayed */
SystemConfig is default configuration for system and components. configuration parameters follow flat namespacing like,
"maxVbuckets" for system-level config parameter "projector.xxx" for projector component. "projector.adminport.xxx" for adminport under projector component.
etc...
Functions ¶
func BucketSeqnos ¶
BucketSeqnos return list of {{vbno,seqno}..} for all vbuckets. this call might fail due to,
- concurrent access that can preserve a deleted/failed bucket object.
- pollForDeletedBuckets() did not get a chance to cleanup a deleted bucket.
in both the cases if the call is retried it should get fixed, provided a valid bucket exists.
func BucketSeqsTiming ¶
func BucketSeqsTiming(bucket string) *stats.TimingStat
func ClusterAuthUrl ¶
func ClusterUrl ¶
func CollectSeqnos ¶
func CommonStrings ¶
CommonStrings returns intersection of two set of strings.
func ComputeAvg ¶
func ComputePercent ¶
func ConnectBucket ¶
ConnectBucket will instantiate a couchbase-bucket instance with cluster. caller's responsibility to close the bucket.
func CopyDir ¶
CopyDir compose destination path based on source and,
- if dest is file, and path is reachable, it is a no-op.
- if dest is file, and path is not reachable, create and copy.
- if dest is dir, and path is reachable, recurse into the dir.
- if dest is dir, and path is not reachable, create and recurse into the dir.
func CrashOnError ¶
func CrashOnError(err error)
func EquivalentIP ¶
func ExcludeStrings ¶
ExcludeStrings will exclude strings in `excludes` from `strs`. preserves the order of `strs` in the result.
func ExcludeUint32 ¶
ExcludeUint32 remove items from list.
func ExcludeUint64 ¶
ExcludeUint64 remove items from list.
func ExitOnStdinClose ¶
func ExitOnStdinClose()
ExitOnStdinClose is exit handler to be used with ns-server.
func FailsafeOp ¶
func FailsafeOp( reqch, respch chan []interface{}, cmd []interface{}, finch chan bool) ([]interface{}, error)
FailsafeOp can be used by gen-server implementors to avoid infinitely blocked API calls.
func FailsafeOpAsync ¶
FailsafeOpAsync is same as FailsafeOp that can be used for asynchronous operation, that is, caller does not wait for response.
func FailsafeOpNoblock ¶
FailsafeOpNoblock is same as FailsafeOpAsync that can be used for non-blocking operation, that is, if `reqch` is full caller does not block.
func GenNextBiggerKey ¶
func GetBucketUUID ¶
This method fetch the bucket UUID. If this method return an error, then it means that the node is not able to connect in order to fetch bucket UUID.
func GetColocatedHost ¶
GetColocatedHost find the server addr for localhost and return the same.
func GetKVAddrs ¶
GetKVAddrs gather the list of kvnode-address based on the latest vbmap.
func GetLocalIP ¶
GetLocalIP return the first external-IP4 configured for the first interface connected to this node.
func HashVbuuid ¶
HashVbuuid return crc64 value of list of 64-bit vbuuids.
func IndexStatement ¶
func Intersection ¶
Intersection operation on two sets of vbuckets, return a sorted list of vbuckets present in both set.
func IsAllAllowed ¶
func IsEquivalentIndex ¶
func IsIPLocal ¶
IsIPLocal return whether `ip` address is loopback address or compares equal with local-IP-address.
func IsPathExist ¶
func IsValidIndexName ¶
func IsValidIndexType ¶
func LogRuntime ¶
func LogRuntime() string
func MarshallIndexDefn ¶
func MaxVbuckets ¶
MaxVbuckets return the number of vbuckets in bucket.
func MaybeSetEnv ¶
func MemstatLogger ¶
func MemstatLogger(tick int64)
func MetakvRecurciveDel ¶
func RemoveString ¶
RemoveString delete `item` from list `xs`.
func RemoveUint16 ¶
RemoveUint16 delete `item` from list `xs`.
func RemoveUint32 ¶
RemoveUint32 delete `item` from list `xs`.
func SeedProcess ¶
func SeedProcess()
func SetBuildMode ¶
func SetBuildMode(mode BuildMode)
func SetClusterStorageMode ¶
func SetClusterStorageMode(mode StorageMode)
func SetNumCPUs ¶
func SetServicePorts ¶
func SetStorageMode ¶
func SetStorageMode(mode StorageMode)
func SetStorageModeStr ¶
func SetupSettingsNotifier ¶
func SetupSettingsNotifier(callb func(Config), cancelCh chan struct{})
func Union ¶
Union set operation on two sets of vbuckets, return a sorted list of vbuckets present in atleast one set.
func Vbno16to32 ¶
Vbno16to32 converts vbucket type from uint16 to uint32
func Vbno32to16 ¶
Vbno32to16 converts vbucket type from uint32 to uint16
Types ¶
type ByteSlices ¶
type ByteSlices [][]byte
ByteSlices to implement Sort interface.
func (ByteSlices) Len ¶
func (b ByteSlices) Len() int
func (ByteSlices) Less ¶
func (b ByteSlices) Less(i, j int) bool
func (ByteSlices) Swap ¶
func (b ByteSlices) Swap(i, j int)
type BytesBufPool ¶
type BytesBufPool struct {
// contains filtered or unexported fields
}
Thread safe byte buffer pool A buffer pointer received by Get() method should be put back using Put() method. This ensures that we not need to create a new buf slice with len == 0
func NewByteBufferPool ¶
func NewByteBufferPool(size int) *BytesBufPool
func (*BytesBufPool) Get ¶
func (p *BytesBufPool) Get() *[]byte
func (*BytesBufPool) Put ¶
func (p *BytesBufPool) Put(buf *[]byte)
type CbAuthHandler ¶
cbauth admin authentication helper Uses default cbauth env variables internally to provide auth creds
func (*CbAuthHandler) AuthenticateMemcachedConn ¶
func (ah *CbAuthHandler) AuthenticateMemcachedConn(host string, conn *memcached.Client) error
func (*CbAuthHandler) GetCredentials ¶
func (ah *CbAuthHandler) GetCredentials() (string, string)
type ClusterInfoCache ¶
Helper object for fetching cluster information Can be used by services running on a cluster node to connect with local management service for obtaining cluster information. Info cache can be updated by using Refresh() method.
func FetchNewClusterInfoCache ¶
func FetchNewClusterInfoCache(clusterUrl string, pool string) (*ClusterInfoCache, error)
func NewClusterInfoCache ¶
func NewClusterInfoCache(clusterUrl string, pool string) (*ClusterInfoCache, error)
func (*ClusterInfoCache) Fetch ¶
func (c *ClusterInfoCache) Fetch() error
func (*ClusterInfoCache) GetActiveIndexerNodes ¶
func (c *ClusterInfoCache) GetActiveIndexerNodes() (nodes []couchbase.Node)
func (*ClusterInfoCache) GetBucketUUID ¶
func (c *ClusterInfoCache) GetBucketUUID(bucket string) (uuid string)
Return UUID of a given bucket.
func (*ClusterInfoCache) GetClusterVersion ¶
func (c *ClusterInfoCache) GetClusterVersion() uint64
func (*ClusterInfoCache) GetCurrentNode ¶
func (c *ClusterInfoCache) GetCurrentNode() NodeId
func (*ClusterInfoCache) GetFailedIndexerNodes ¶
func (c *ClusterInfoCache) GetFailedIndexerNodes() (nodes []couchbase.Node)
func (*ClusterInfoCache) GetLocalHostAddress ¶
func (c *ClusterInfoCache) GetLocalHostAddress() (string, error)
func (*ClusterInfoCache) GetLocalHostname ¶
func (c *ClusterInfoCache) GetLocalHostname() (string, error)
func (*ClusterInfoCache) GetLocalServerGroup ¶
func (c *ClusterInfoCache) GetLocalServerGroup() (string, error)
func (*ClusterInfoCache) GetLocalServiceAddress ¶
func (c *ClusterInfoCache) GetLocalServiceAddress(srvc string) (string, error)
func (*ClusterInfoCache) GetLocalServiceHost ¶
func (c *ClusterInfoCache) GetLocalServiceHost(srvc string) (string, error)
func (*ClusterInfoCache) GetLocalServicePort ¶
func (c *ClusterInfoCache) GetLocalServicePort(srvc string) (string, error)
func (*ClusterInfoCache) GetNewIndexerNodes ¶
func (c *ClusterInfoCache) GetNewIndexerNodes() (nodes []couchbase.Node)
func (*ClusterInfoCache) GetNodeStatus ¶
func (c *ClusterInfoCache) GetNodeStatus(nid NodeId) (string, error)
func (*ClusterInfoCache) GetNodesByBucket ¶
func (c *ClusterInfoCache) GetNodesByBucket(bucket string) (nids []NodeId, err error)
func (*ClusterInfoCache) GetNodesByServiceType ¶
func (c *ClusterInfoCache) GetNodesByServiceType(srvc string) (nids []NodeId)
func (*ClusterInfoCache) GetServerGroup ¶
func (c *ClusterInfoCache) GetServerGroup(nid NodeId) string
func (*ClusterInfoCache) GetServiceAddress ¶
func (c *ClusterInfoCache) GetServiceAddress(nid NodeId, srvc string) (addr string, err error)
func (*ClusterInfoCache) GetVBuckets ¶
func (c *ClusterInfoCache) GetVBuckets(nid NodeId, bucket string) (vbs []uint32, err error)
func (*ClusterInfoCache) IsEphemeral ¶
func (c *ClusterInfoCache) IsEphemeral(bucket string) (bool, error)
func (*ClusterInfoCache) IsNodeHealthy ¶
func (c *ClusterInfoCache) IsNodeHealthy(nid NodeId) (bool, error)
func (*ClusterInfoCache) SetLogPrefix ¶
func (c *ClusterInfoCache) SetLogPrefix(p string)
func (*ClusterInfoCache) SetMaxRetries ¶
func (c *ClusterInfoCache) SetMaxRetries(r int)
func (*ClusterInfoCache) SetServicePorts ¶
func (c *ClusterInfoCache) SetServicePorts(portMap map[string]string)
type Config ¶
type Config map[string]ConfigValue
Config is a key, value map with key always being a string represents a config-parameter.
func GetSettingsConfig ¶
func NewConfig ¶
NewConfig from another Config object or from map[string]interface{} object or from []byte slice, a byte-slice of JSON string.
func (Config) FilterConfig ¶
func (Config) LogConfig ¶
LogConfig will check wether a configuration parameter is mutable and log that information.
func (Config) Override ¶
Override will clone `config` object and update parameters with values from `others` instance. Will skip immutable fields.
func (Config) OverrideForce ¶
OverrideForce will clone `config` object and update parameters with values from `others` instance. Will force override immutable fields as well.
func (Config) SectionConfig ¶
SectionConfig will create a new config object with parameters starting with `prefix`. If `trim` is true, then config parameter will be trimmed with the prefix string.
func (Config) Set ¶
func (config Config) Set(key string, cv ConfigValue) Config
Set ConfigValue for parameter. Mutates the config object.
type ConfigHolder ¶
type ConfigHolder struct {
// contains filtered or unexported fields
}
Threadsafe config holder object
func (*ConfigHolder) Load ¶
func (h *ConfigHolder) Load() Config
func (*ConfigHolder) Store ¶
func (h *ConfigHolder) Store(conf Config)
type ConfigValue ¶
type ConfigValue struct { Value interface{} Help string DefaultVal interface{} Immutable bool Casesensitive bool }
ConfigValue for each parameter.
func (ConfigValue) Bool ¶
func (cv ConfigValue) Bool() bool
Bool assumes config value is a Bool and returns the same.
func (ConfigValue) Float64 ¶
func (cv ConfigValue) Float64() float64
Float64 assumes config value integer or float64.
func (ConfigValue) Int ¶
func (cv ConfigValue) Int() int
Int assumes config value is an integer and returns the same.
func (ConfigValue) String ¶
func (cv ConfigValue) String() string
String assumes config value is a string and returns the same.
func (ConfigValue) Strings ¶
func (cv ConfigValue) Strings() []string
Strings assumes config value is comma separated string items.
func (ConfigValue) Uint64 ¶
func (cv ConfigValue) Uint64() uint64
Uint64 assumes config value is 64-bit integer and returns the same.
type Consistency ¶
type Consistency byte
Consistency definition for index-scan queries.
const ( // AnyConsistency indexer would return the most current // data available at the moment. AnyConsistency Consistency = iota + 1 // SessionConsistency indexer would query the latest timestamp // from each KV node. It will ensure that the scan result is at // least as recent as the KV timestamp. In other words, this // option ensures the query result is at least as recent as what // the user session has observed so far. SessionConsistency // QueryConsistency indexer would accept a timestamp vector, // and make sure to return a stable data-set that is atleast as // recent as the timestamp-vector. QueryConsistency )
func (Consistency) String ¶
func (cons Consistency) String() string
type DDLRequestSource ¶
type DDLRequestSource byte
const ( DDLRequestSourceUser DDLRequestSource = iota DDLRequestSourceRebalance )
type DataportKeyVersions ¶
type DataportKeyVersions struct { Bucket string Vbno uint16 Vbuuid uint64 Kv *KeyVersions }
DataportKeyVersions accepted by this endpoint.
type Endpoint ¶
type Endpoint string //host:port
Endpoint provides an Indexer address(host:port) which is hosting a partition
type Evaluator ¶
type Evaluator interface { // Return the bucket name for which this evaluator is applicable. Bucket() string // StreamBeginData is generated for downstream. StreamBeginData(vbno uint16, vbuuid, seqno uint64) (data interface{}) // Sync is generated for downstream. SyncData(vbno uint16, vbuuid, seqno uint64) (data interface{}) // SnapshotData is generated for downstream. SnapshotData(m *mc.DcpEvent, vbno uint16, vbuuid, seqno uint64) interface{} // StreamEnd is generated for downstream. StreamEndData(vbno uint16, vbuuid, seqno uint64) (data interface{}) // TransformRoute will transform document consumable by // downstream, returns data to be published to endpoints. TransformRoute(vbuuid uint64, m *mc.DcpEvent, data map[string]interface{}, encodeBuf []byte) ([]byte, error) }
Evaluator interface for projector, to be implemented by secondary-index or other entities.
type IndexDefn ¶
type IndexDefn struct { DefnId IndexDefnId `json:"defnId,omitempty"` Name string `json:"name,omitempty"` Using IndexType `json:"using,omitempty"` Bucket string `json:"bucket,omitempty"` BucketUUID string `json:"bucketUUID,omitempty"` IsPrimary bool `json:"isPrimary,omitempty"` SecExprs []string `json:"secExprs,omitempty"` ExprType ExprType `json:"exprType,omitempty"` PartitionScheme PartitionScheme `json:"partitionScheme,omitempty"` PartitionKey string `json:"partitionKey,omitempty"` WhereExpr string `json:"where,omitempty"` Desc []bool `json:"desc,omitempty"` Deferred bool `json:"deferred,omitempty"` Immutable bool `json:"immutable,omitempty"` Nodes []string `json:"nodes,omitempty"` IsArrayIndex bool `json:"isArrayIndex,omitempty"` NumReplica uint32 `json:"numReplica,omitempty"` // transient field (not part of index metadata) InstVersion int `json:"instanceVersion,omitempty"` ReplicaId int `json:"replicaId,omitempty"` InstId IndexInstId `json:"instanceId,omitempty"` }
IndexDefn represents the index definition as specified during CREATE INDEX
func UnmarshallIndexDefn ¶
func (IndexDefn) Clone ¶
This function makes a copy of index definition, excluding any transient field. It is a shallow copy (e.g. does not clone field 'Nodes').
func (*IndexDefn) HasDescending ¶
type IndexDefnId ¶
type IndexDefnId uint64
func NewIndexDefnId ¶
func NewIndexDefnId() (IndexDefnId, error)
type IndexInst ¶
type IndexInst struct { InstId IndexInstId Defn IndexDefn State IndexState RState RebalanceState Stream StreamId Pc PartitionContainer Error string BuildTs []uint64 Version int ReplicaId int Scheduled bool StorageMode string OldStorageMode string }
IndexInst is an instance of an Index(aka replica)
func (IndexInst) DisplayName ¶
type IndexInstId ¶
type IndexInstId uint64
func NewIndexInstId ¶
func NewIndexInstId() (IndexInstId, error)
type IndexInstMap ¶
type IndexInstMap map[IndexInstId]IndexInst
IndexInstMap is a map from IndexInstanceId to IndexInstance
func CopyIndexInstMap ¶
func CopyIndexInstMap(inMap IndexInstMap) IndexInstMap
func (IndexInstMap) String ¶
func (idx IndexInstMap) String() string
type IndexSnapType ¶
type IndexSnapType uint16
IndexSnapType represents the snapshot type created in indexer storage
const ( NO_SNAP IndexSnapType = iota DISK_SNAP INMEM_SNAP FORCE_COMMIT )
func (IndexSnapType) String ¶
func (s IndexSnapType) String() string
type IndexState ¶
type IndexState int
const ( //Create Index Processed INDEX_STATE_CREATED IndexState = iota // Index is stream is ready INDEX_STATE_READY //Initial Build In Progress INDEX_STATE_INITIAL //Catchup In Progress INDEX_STATE_CATCHUP //Maitenance Stream INDEX_STATE_ACTIVE //Drop Index Processed INDEX_STATE_DELETED //Error State: not a persistent state -- but used in function return value INDEX_STATE_ERROR // Nil State (used for no-op / invalid) -- not a persistent state INDEX_STATE_NIL )
func (IndexState) String ¶
func (s IndexState) String() string
type IndexStatistics ¶
type IndexStatistics interface { Count() (int64, error) MinKey() (SecondaryKey, error) MaxKey() (SecondaryKey, error) DistinctCount() (int64, error) Bins() ([]IndexStatistics, error) }
IndexStatistics captures statistics for a range or a single key.
type IndexType ¶
type IndexType string
NOTE: This type needs to be in sync with smStrMap
func StorageModeToIndexType ¶
func StorageModeToIndexType(m StorageMode) IndexType
type IndexerErrCode ¶
type IndexerErrCode int
IndexerError - Runtime Error between indexer and other modules
const ( TransientError IndexerErrCode = iota IndexNotExist InvalidBucket IndexerInRecovery IndexBuildInProgress IndexerNotActive RebalanceInProgress IndexAlreadyExist DropIndexInProgress IndexInvalidState )
type IndexerError ¶
type IndexerError struct { Reason string Code IndexerErrCode }
func (*IndexerError) ErrCode ¶
func (e *IndexerError) ErrCode() IndexerErrCode
func (*IndexerError) Error ¶
func (e *IndexerError) Error() string
type IndexerState ¶
type IndexerState int
const ( //Active(processing mutation and scan) INDEXER_ACTIVE IndexerState = iota //Paused(not processing mutation/scan) INDEXER_PAUSED INDEXER_PREPARE_UNPAUSE //Initial Bootstrap INDEXER_BOOTSTRAP )
func (IndexerState) String ¶
func (s IndexerState) String() string
type KeyPartitionContainer ¶
type KeyPartitionContainer struct { PartitionMap map[PartitionId]KeyPartitionDefn NumPartitions int }
KeyPartitionContainer implements PartitionContainer interface for key based partitioning
func (*KeyPartitionContainer) AddPartition ¶
func (pc *KeyPartitionContainer) AddPartition(id PartitionId, p PartitionDefn)
AddPartition adds a partition to the container
func (*KeyPartitionContainer) GetAllPartitions ¶
func (pc *KeyPartitionContainer) GetAllPartitions() []PartitionDefn
GetAllPartitions returns all the partitions in this partitionContainer
func (*KeyPartitionContainer) GetEndpointsByPartitionId ¶
func (pc *KeyPartitionContainer) GetEndpointsByPartitionId(id PartitionId) []Endpoint
GetEndpointsByPartitionId returns the list of Endpoints hosting the give partitionId or nil if partitionId is not found
func (*KeyPartitionContainer) GetEndpointsByPartitionKey ¶
func (pc *KeyPartitionContainer) GetEndpointsByPartitionKey(key PartitionKey) []Endpoint
GetEndpointsByPartitionKey is a convenience method which calls other interface methods to first determine the partitionId from PartitionKey and then the endpoints from partitionId
func (*KeyPartitionContainer) GetNumPartitions ¶
func (pc *KeyPartitionContainer) GetNumPartitions() int
GetNumPartitions returns the number of partitions in this container
func (*KeyPartitionContainer) GetPartitionById ¶
func (pc *KeyPartitionContainer) GetPartitionById(id PartitionId) PartitionDefn
GetPartitionById returns the partition for the given partitionId or nil if partitionId is not found
func (*KeyPartitionContainer) GetPartitionIdByPartitionKey ¶
func (pc *KeyPartitionContainer) GetPartitionIdByPartitionKey(key PartitionKey) PartitionId
GetPartitionIdByPartitionKey returns the partitionId for the partition to which the partitionKey belongs.
func (*KeyPartitionContainer) RemovePartition ¶
func (pc *KeyPartitionContainer) RemovePartition(id PartitionId)
RemovePartition removes a partition from the container
func (*KeyPartitionContainer) UpdatePartition ¶
func (pc *KeyPartitionContainer) UpdatePartition(id PartitionId, p PartitionDefn)
UpdatePartition updates an existing partition to the container
type KeyPartitionDefn ¶
type KeyPartitionDefn struct { Id PartitionId Endpts []Endpoint }
KeyPartitionDefn defines a key based partition in terms of topology ie its Id and Indexer Endpoints hosting the partition
func (KeyPartitionDefn) Endpoints ¶
func (kp KeyPartitionDefn) Endpoints() []Endpoint
func (KeyPartitionDefn) GetPartitionId ¶
func (kp KeyPartitionDefn) GetPartitionId() PartitionId
type KeyVersions ¶
type KeyVersions struct { Seqno uint64 // vbucket sequence number for this mutation Docid []byte // primary document id Uuids []uint64 // list of unique ids, like index-ids Commands []byte // list of commands for each index Keys [][]byte // list of key-versions for each index Oldkeys [][]byte // previous key-versions, if available Partnkeys [][]byte // partition key for each key-version Ctime int64 }
KeyVersions for a single mutation from KV for a subset of index.
func NewKeyVersions ¶
func NewKeyVersions(seqno uint64, docid []byte, maxCount, ctime int64) *KeyVersions
NewKeyVersions return a reference KeyVersions for a single mutation.
func (*KeyVersions) AddDeletion ¶
func (kv *KeyVersions) AddDeletion(uuid uint64, oldkey []byte)
AddDeletion add a new keyversion for same OpDeletion.
func (*KeyVersions) AddDropData ¶
func (kv *KeyVersions) AddDropData()
AddDropData add DropData command for trigger downstream catchup.
func (*KeyVersions) AddSnapshot ¶
func (kv *KeyVersions) AddSnapshot(typ uint32, start, end uint64)
AddSnapshot add Snapshot command for a vbucket shutdown. * type is sent via uuid field * start and end values are big-ending encoded to as key and old-key
func (*KeyVersions) AddStreamBegin ¶
func (kv *KeyVersions) AddStreamBegin()
AddStreamBegin add StreamBegin command for a new vbucket.
func (*KeyVersions) AddStreamEnd ¶
func (kv *KeyVersions) AddStreamEnd()
AddStreamEnd add StreamEnd command for a vbucket shutdown.
func (*KeyVersions) AddSync ¶
func (kv *KeyVersions) AddSync()
AddSync add Sync command for vbucket heartbeat.
func (*KeyVersions) AddUpsert ¶
func (kv *KeyVersions) AddUpsert(uuid uint64, key, oldkey []byte)
AddUpsert add a new keyversion for same OpMutation.
func (*KeyVersions) AddUpsertDeletion ¶
func (kv *KeyVersions) AddUpsertDeletion(uuid uint64, oldkey []byte)
AddUpsertDeletion add a keyversion command to delete old entry.
func (*KeyVersions) Equal ¶
func (kv *KeyVersions) Equal(other *KeyVersions) bool
Equal compares for equality of two KeyVersions object.
func (*KeyVersions) Length ¶
func (kv *KeyVersions) Length() int
Length number of key-versions are stored.
func (*KeyVersions) String ¶
func (kv *KeyVersions) String() string
type MetadataRequestContext ¶
type MetadataRequestContext struct {
ReqSource DDLRequestSource
}
func NewRebalanceRequestContext ¶
func NewRebalanceRequestContext() *MetadataRequestContext
func NewUserRequestContext ¶
func NewUserRequestContext() *MetadataRequestContext
type Notification ¶
type Notification struct { Type NotificationType Msg interface{} }
func (Notification) String ¶
func (n Notification) String() string
type NotificationType ¶
type NotificationType int
const ( ServiceChangeNotification NotificationType = iota PoolChangeNotification )
type PartitionContainer ¶
type PartitionContainer interface { AddPartition(PartitionId, PartitionDefn) UpdatePartition(PartitionId, PartitionDefn) RemovePartition(PartitionId) GetEndpointsByPartitionKey(PartitionKey) []Endpoint GetPartitionIdByPartitionKey(PartitionKey) PartitionId GetEndpointsByPartitionId(PartitionId) []Endpoint GetAllPartitions() []PartitionDefn GetPartitionById(PartitionId) PartitionDefn GetNumPartitions() int }
PartitionContainer contains all the partitions for an index instance and provides methods to lookup topology information(i.e. endpoints) based on the PartitionKey
func NewKeyPartitionContainer ¶
func NewKeyPartitionContainer() PartitionContainer
NewKeyPartitionContainer initializes a new KeyPartitionContainer and returns
type PartitionDefn ¶
type PartitionDefn interface { GetPartitionId() PartitionId Endpoints() []Endpoint }
PartitionDefn is a generic interface which defines a partition
type PartitionId ¶
type PartitionId int
type PartitionKey ¶
type PartitionKey []byte
type PartitionScheme ¶
type PartitionScheme string
type Payload ¶
type Payload struct { Payltyp byte Vbmap *VbConnectionMap Vbs []*VbKeyVersions // for N number of vbuckets }
Payload either carries `vbmap` or `vbs`.
func NewStreamPayload ¶
NewStreamPayload returns a reference to payload, `nVb` provides the maximum number of vbuckets that can be carried by a payload.
func (*Payload) AddVbKeyVersions ¶
func (p *Payload) AddVbKeyVersions(vb *VbKeyVersions) (err error)
AddVbKeyVersions add a VbKeyVersions as payload, one or more VbKeyVersions can be added before transport.
type RebalanceState ¶
type RebalanceState int
const ( REBAL_ACTIVE RebalanceState = iota REBAL_PENDING )
func (RebalanceState) String ¶
func (s RebalanceState) String() string
type RetryHelper ¶
type RetryHelper struct {
// contains filtered or unexported fields
}
Helper object to execute a function with retries and exponential backoff
func NewRetryHelper ¶
func NewRetryHelper( maxRetries int, interval time.Duration, factor int, call retryFunc) *RetryHelper
func (*RetryHelper) Run ¶
func (r *RetryHelper) Run() error
type Router ¶
type Router interface { // Bucket will return the bucket name for which this // router instance is applicable. Bucket() string // Endpoints return full list of endpoints <host:port> // that are listening for this instance. Endpoints() []string // UpsertEndpoints return a list of endpoints <host:port> // to which Upsert message will be published. // * `key` == nil, implies missing secondary key // * `partKey` == nil, implies missing partition key // * m.VBucket, m.Seqno, m.Key - carry {vbno, seqno, docid} UpsertEndpoints(m *mc.DcpEvent, partKey, key, oldKey []byte) []string // UpsertDeletionEndpoints return a list of endpoints // <host:port> to which UpsertDeletion message will be // published. // * `oldPartKey` and `oldKey` will be computed based on m.OldValue // * `oldKey` == nil, implies old document is not available // * `oldPartKey` == nil, implies old document is not available // * m.VBucket, m.Seqno, m.Key - carry {vbno, seqno, docid} // TODO: differentiate between, missing old document and missing // secondary-key UpsertDeletionEndpoints(m *mc.DcpEvent, oldPartKey, key, oldKey []byte) []string // DeletionEndpoints return a list of endpoints // <host:port> to which Deletion message will be published. // * `oldPartKey` and `oldKey` will be computed based on m.OldValue // * `oldKey` == nil, implies old document is not available // * `oldPartKey` == nil, implies old document is not available // * m.VBucket, m.Seqno, m.Key - carry {vbno, seqno, docid} // TODO: differentiate between, missing old document and missing // secondary-key DeletionEndpoints(m *mc.DcpEvent, oldPartKey, oldKey []byte) []string }
Router definition for each instance (aka engine), where an instance might refer to an index or similar entities.
type RouterEndpoint ¶
type RouterEndpoint interface { // Ping will check whether endpoint is active, synchronous call. Ping() bool // ResetConfig will live update configuration parameters for endpoint, // synchronous call. ResetConfig(config Config) error // Send will post data to endpoint client, asynchronous call. Send(data interface{}) error // GetStatistics to gather statistics information from endpoint, // synchronous call. GetStatistics() map[string]interface{} // Close will shutdown this endpoint and release its resources, // synchronous call. Close() error // WaitForExit will block until endpoint exits WaitForExit() error }
RouterEndpoint abstracts downstream for feed.
type RouterEndpointFactory ¶
type RouterEndpointFactory func( topic, endpointType, raddr string, econfig Config) (RouterEndpoint, error)
RouterEndpointFactory will create a new endpoint instance for {topic, remote-address}
func (RouterEndpointFactory) MarshalJSON ¶
func (r RouterEndpointFactory) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding/json.Marshaler{} interface
type SecondaryKey ¶
type SecondaryKey []interface{}
SecondaryKey is secondary-key in the shape of - [ val1, val2, ..., valN ] where value can be any golang data-type that can be serialized into JSON. simple-key shall be shaped as [ val ]
type ServicesChangeNotifier ¶
type ServicesChangeNotifier struct {
// contains filtered or unexported fields
}
func NewServicesChangeNotifier ¶
func NewServicesChangeNotifier(clusterUrl, pool string) (*ServicesChangeNotifier, error)
Initialize change notifier object for a clusterUrl
func (*ServicesChangeNotifier) Close ¶
func (sn *ServicesChangeNotifier) Close()
Consumer can cancel and invalidate notifier object by calling Close()
func (*ServicesChangeNotifier) Get ¶
func (sn *ServicesChangeNotifier) Get() (n Notification, err error)
Call Get() method to block wait and obtain next services Config
func (*ServicesChangeNotifier) GetNotifyCh ¶
func (sn *ServicesChangeNotifier) GetNotifyCh() chan Notification
type Statistics ¶
type Statistics map[string]interface{}
Statistics provide a type and method receivers for marshalling and un-marshalling statistics, as JSON, for components across the network.
func NewStatistics ¶
func NewStatistics(data interface{}) (stat Statistics, err error)
NewStatistics return a new instance of stat structure initialized with data.
func (Statistics) ContentType ¶
func (s Statistics) ContentType() string
ContentType is part of MessageMarshaller interface.
func (Statistics) Decode ¶
func (s Statistics) Decode(data []byte) (err error)
Decode is part of MessageMarshaller interface.
func (Statistics) Decr ¶
func (s Statistics) Decr(path string, vals ...int)
Decr increments stat value(s) by `vals`.
func (Statistics) Encode ¶
func (s Statistics) Encode() (data []byte, err error)
Encode is part of MessageMarshaller interface.
func (Statistics) Incr ¶
func (s Statistics) Incr(path string, vals ...int)
Incr increments stat value(s) by `vals`.
func (Statistics) Lines ¶
func (s Statistics) Lines() string
Lines will convert JSON to human readable list of statistics.
func (Statistics) Name ¶
func (s Statistics) Name() string
Name is part of MessageMarshaller interface.
func (Statistics) ToMap ¶
func (s Statistics) ToMap() map[string]interface{}
ToMap converts Statistics to map.
type StorageMode ¶
type StorageMode byte
func GetClusterStorageMode ¶
func GetClusterStorageMode() StorageMode
func GetStorageMode ¶
func GetStorageMode() StorageMode
func IndexTypeToStorageMode ¶
func IndexTypeToStorageMode(t IndexType) StorageMode
func (StorageMode) String ¶
func (s StorageMode) String() string
type TokenBuildSource ¶
type TokenBuildSource byte
const ( TokenBuildSourceDcp TokenBuildSource = iota TokenBuildSourcePeer )
func (TokenBuildSource) String ¶
func (bs TokenBuildSource) String() string
type TokenState ¶
type TokenState byte
const ( TransferTokenCreated TokenState = iota TransferTokenAccepted TransferTokenRefused TransferTokenInitate TransferTokenInProgress TransferTokenReady TransferTokenCommit TransferTokenDeleted TransferTokenError )
func (TokenState) String ¶
func (ts TokenState) String() string
type TokenTransferMode ¶
type TokenTransferMode byte
const ( TokenTransferModeMove TokenTransferMode = iota TokenTransferModeCopy )
func (TokenTransferMode) String ¶
func (tm TokenTransferMode) String() string
type TransferToken ¶
type TransferToken struct { MasterId string SourceId string DestId string RebalId string State TokenState InstId IndexInstId IndexInst IndexInst Error string BuildSource TokenBuildSource TransferMode TokenTransferMode }
func (TransferToken) Clone ¶
func (tt TransferToken) Clone() TransferToken
func (TransferToken) String ¶
func (tt TransferToken) String() string
type TsVbuuid ¶
type TsVbuuid struct { Bucket string Seqnos []uint64 Vbuuids []uint64 Crc64 uint64 Snapshots [][2]uint64 SnapType IndexSnapType LargeSnap bool SnapAligned bool DisableAlign bool }
TsVbuuid is logical clock for full set of vbuckets along with branch value and last seen snapshot.
func NewTsVbuuid ¶
NewTsVbuuid returns reference to new instance of TsVbuuid. `numVbuckets` is same as `maxVbuckets`.
func NewTsVbuuidCached ¶
func (*TsVbuuid) AsRecent ¶
AsRecent will check whether timestamp `ts` is atleast as recent as timestamp `other`.
func (*TsVbuuid) AsRecentTs ¶
AsRecentTs will check whether timestamp `ts` is atleast as recent as timestamp `other`.
func (*TsVbuuid) CheckCrc64 ¶
CheckVbuuids will check whether vbuuids in timestamp `ts` is same as that of `other`.
func (*TsVbuuid) CheckSnapAligned ¶
check if seqnum of all vbuckets are aligned with the snapshot end
func (*TsVbuuid) CompareVbuuids ¶
CompareVbuuids will compare two timestamps for its bucket and vbuuids
func (*TsVbuuid) GetSnapType ¶
func (ts *TsVbuuid) GetSnapType() IndexSnapType
Persisted returns the value of persisted flag
func (*TsVbuuid) HasDisableAlign ¶
func (*TsVbuuid) HasLargeSnapshot ¶
HasLargeSnapshot returns the value of largeSnap flag
func (*TsVbuuid) IsSnapAligned ¶
IsSnapAligned returns the value of SnapAligned flag
func (*TsVbuuid) SetDisableAlign ¶
func (*TsVbuuid) SetLargeSnapshot ¶
SetLargeSnapshot sets the largeSnap flag
func (*TsVbuuid) SetSnapAligned ¶
SetSnapAligned sets the SnapAligned flag
func (*TsVbuuid) SetSnapType ¶
func (ts *TsVbuuid) SetSnapType(typ IndexSnapType)
Persisted sets the persisted flag
type VbConnectionMap ¶
VbConnectionMap specifies list of vbuckets and current vbuuids for each vbucket.
func (*VbConnectionMap) Equal ¶
func (vbmap *VbConnectionMap) Equal(other *VbConnectionMap) bool
Equal compares to VbConnectionMap objects.
type VbKeyVersions ¶
type VbKeyVersions struct { Bucket string Vbucket uint16 // vbucket number Vbuuid uint64 // unique id to detect branch history Kvs []*KeyVersions // N number of mutations Uuid string }
VbKeyVersions carries per vbucket key-versions for one or more mutations.
func NewVbKeyVersions ¶
func NewVbKeyVersions(bucket string, vbno uint16, vbuuid uint64, maxMutations int) *VbKeyVersions
NewVbKeyVersions return a reference to a single vbucket payload
func (*VbKeyVersions) AddKeyVersions ¶
func (vb *VbKeyVersions) AddKeyVersions(kv *KeyVersions) error
AddKeyVersions will add KeyVersions for a single mutation.
func (*VbKeyVersions) Equal ¶
func (vb *VbKeyVersions) Equal(other *VbKeyVersions) bool
Equal compare equality of two VbKeyVersions object.
func (*VbKeyVersions) FreeKeyVersions ¶
func (vb *VbKeyVersions) FreeKeyVersions()
FreeKeyVersions free mutations contained by this object.
Source Files ¶
- buffer_pool.go
- build_mode.go
- cluster_info.go
- config.go
- const.go
- dcp_seqno.go
- evaluator.go
- index.go
- key_partition_container.go
- memstat.go
- metakv.go
- mutation.go
- partition_container.go
- rebalance_defs.go
- retry_helper.go
- router.go
- services_notifier.go
- settings.go
- sort.go
- stats.go
- storage_mode.go
- timestamp.go
- util.go
- uuid.go
- vbuckets.go