protoProjector

package
v0.0.0-...-71d9aaf Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorInvalidVbmap = errors.New("protobuf.errorInvalidVbmap")

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 []byte, docval qvalue.AnnotatedValue, context qexpr.Context,
	cExprs []interface{},
	encodeBuf []byte, stats *IndexEvaluatorStats) ([]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.

Types

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) GetIndexName

func (ie *IndexEvaluator) GetIndexName() string

GetIndexName implements Evaluator{} interface.

func (*IndexEvaluator) SnapshotData

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

SnapshotData implement Evaluator{} interface.

func (*IndexEvaluator) Stats

func (ie *IndexEvaluator) Stats() interface{}

func (*IndexEvaluator) StreamBeginData

func (ie *IndexEvaluator) StreamBeginData(
	vbno uint16, vbuuid, seqno uint64, hostaddr string,
	status byte, code byte, opaque2 uint64) (data interface{})

StreamBeginData implement Evaluator{} interface.

func (*IndexEvaluator) StreamEndData

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

StreamEndData implement Evaluator{} interface.

func (*IndexEvaluator) SyncData

func (ie *IndexEvaluator) SyncData(
	vbno uint16, vbuuid, seqno uint64, opaque2 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,
	docval qvalue.AnnotatedValue, context qexpr.Context, meta map[string]interface{},
	numIndexes int, opaque2 uint64) ([]byte, error)

TransformRoute implement Evaluator{} interface.

type IndexEvaluatorStats

type IndexEvaluatorStats struct {
	Count     stats.Int64Val
	TotalDur  stats.Int64Val
	PrevCount stats.Int64Val
	PrevDur   stats.Int64Val
	SMA       stats.Int64Val // Simple moving average

	// ErrSkip represents number of mutations skipped since the
	// last call to GetAndResetErrorSkip
	ErrSkip stats.Int64Val

	// Total number of mutations skipped since this stat object was initialized.
	ErrSkipAll stats.Int64Val
}

func (*IndexEvaluatorStats) GetAndResetErrorSkip

func (ies *IndexEvaluatorStats) GetAndResetErrorSkip() int64

func (*IndexEvaluatorStats) GetErrorSkipAll

func (ies *IndexEvaluatorStats) GetErrorSkipAll() int64

func (*IndexEvaluatorStats) Init

func (ie *IndexEvaluatorStats) Init()

func (*IndexEvaluatorStats) MovingAvg

func (ies *IndexEvaluatorStats) MovingAvg() int64

Implements simple moving average. Returns the moving average value

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
}

Jump to

Keyboard shortcuts

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