segment

package
v0.0.0-...-ad801e6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	// AddBatch adds a batch of documents to the segment.
	AddBatch(docs document.Documents)

	// Build returns a segment built from data accumulated in the builder.
	// The builder should not be used after `Build` is called.
	Build() MutableSegment
}

Builder builds a segment.

func NewBuilder

func NewBuilder(opts *BuilderOptions) Builder

NewBuilder creates a new segment builder.

type BuilderOptions

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

BuilderOptions provide a set of builder options.

func NewBuilderOptions

func NewBuilderOptions() *BuilderOptions

NewBuilderOptions create a new set of builder options.

func (*BuilderOptions) FieldBuilderOptions

func (o *BuilderOptions) FieldBuilderOptions() *indexfield.DocsFieldBuilderOptions

FieldBuilderOptions returns the field builder options.

func (*BuilderOptions) FieldHashFn

func (o *BuilderOptions) FieldHashFn() hash.StringArrayHashFn

FieldHashFn returns the function that computes the hash of a field path.

func (*BuilderOptions) RawDocSourceFieldPath

func (o *BuilderOptions) RawDocSourceFieldPath() []string

RawDocSourceFieldPath returns the raw doc source field path.

func (*BuilderOptions) SetFieldBuilderOptions

func (o *BuilderOptions) SetFieldBuilderOptions(v *indexfield.DocsFieldBuilderOptions) *BuilderOptions

SetFieldBuilderOptions sets the field builder options.

func (*BuilderOptions) SetFieldHashFn

func (o *BuilderOptions) SetFieldHashFn(v hash.StringArrayHashFn) *BuilderOptions

SetFieldHashFn sets the function that computes the hash of a field path.

func (*BuilderOptions) SetRawDocSourceFieldPath

func (o *BuilderOptions) SetRawDocSourceFieldPath(v []string) *BuilderOptions

SetRawDocSourceFieldPath sets the raw doc source field path.

func (*BuilderOptions) SetTimestampFieldPath

func (o *BuilderOptions) SetTimestampFieldPath(v []string) *BuilderOptions

SetTimestampFieldPath sets the timestamp field path.

func (*BuilderOptions) TimestampFieldPath

func (o *BuilderOptions) TimestampFieldPath() []string

TimestampFieldPath returns the timestamp field path.

type Field

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

Field contains a field along with its types and value metadatas.

func (*Field) DocsField

func (f *Field) DocsField() indexfield.DocsField

DocsField returns the raw document field. If the raw docs field is not nil, its refcount is incremented, and the returned docs field should be closed after use. Otherwise, nil is returned.

func (*Field) Insert

func (f *Field) Insert(df indexfield.DocsField)

Insert inserts the incoming docs field into the segment field object. The incoming docs field remains valid after the merge and should be closed where appropriate.

func (*Field) Types

func (f *Field) Types() []field.ValueType

Types contain the list of field types.

func (*Field) ValueMetas

func (f *Field) ValueMetas() []values.MetaUnion

ValueMetas contains the list of value metas.

type FieldFn

type FieldFn func(f *Field)

FieldFn applies a function against a segment field.

type FieldPathPredicate

type FieldPathPredicate func(fieldPath []string) bool

FieldPathPredicate is a predicate on the given field path.

type ImmutableSegment

type ImmutableSegment interface {

	// FieldAt returns the field at a given path.
	FieldAt(fieldPath []string) (*Field, bool)

	// ForEach performs an operation against each segment field.
	ForEach(fn FieldFn)
	// contains filtered or unexported methods
}

ImmutableSegment is an immutable segment.

type Metadata

type Metadata struct {
	ID           string
	NumDocs      int32
	NumFields    int
	MinTimeNanos int64
	MaxTimeNanos int64
}

Metadata stores the segment metadata.

type MutableSegment

type MutableSegment interface {
	ImmutableSegment

	// ClearAll clears all fields in the segment.
	ClearAll()
}

MutableSegment is a mutable segment.

Jump to

Keyboard shortcuts

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