index

package
v0.0.0-...-9649366 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package index is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnableToQueryBlockClosed is returned when querying closed block.
	ErrUnableToQueryBlockClosed = errors.New("unable to query, index block is closed")
	// ErrUnableReportStatsBlockClosed is returned from Stats when the block is closed.
	ErrUnableReportStatsBlockClosed = errors.New("unable to report stats, block is closed")
)
View Source
var (
	// ReservedFieldNameID is the field name used to index the ID in the
	// m3ninx subsytem.
	ReservedFieldNameID = doc.IDReservedFieldName
)

Functions

func NewBootstrapResultMutableSegmentAllocator

func NewBootstrapResultMutableSegmentAllocator(
	opts Options,
) result.MutableSegmentAllocator

NewBootstrapResultMutableSegmentAllocator returns a default mutable segment allocator for a bootstrap result index block given index options.

func NewPostingsListCache

func NewPostingsListCache(size int, opts PostingsListCacheOptions) (*PostingsListCache, Closer, error)

NewPostingsListCache creates a new query cache.

func NewReadThroughSegment

func NewReadThroughSegment(
	seg segment.Segment,
	cache *PostingsListCache,
	opts ReadThroughSegmentOptions,
) segment.Segment

NewReadThroughSegment creates a new read through segment.

Types

type AggregateFieldFilter

type AggregateFieldFilter [][]byte

AggregateFieldFilter dictates which fields will appear in the aggregated result; if filter values exist, only those whose fields matches a value in the filter are returned.

func (AggregateFieldFilter) AddIfMissing

func (f AggregateFieldFilter) AddIfMissing(field []byte) AggregateFieldFilter

AddIfMissing adds the provided field if it's missing from the filter.

func (AggregateFieldFilter) Allow

func (f AggregateFieldFilter) Allow(term []byte) bool

Allow returns true if the given term satisfies the filter.

func (AggregateFieldFilter) SortAndDedupe

func (f AggregateFieldFilter) SortAndDedupe() AggregateFieldFilter

SortAndDedupe sorts and de-dupes the fields in the filter.

type AggregateQueryResult

type AggregateQueryResult struct {
	Results    AggregateResults
	Exhaustive bool
}

AggregateQueryResult is the collection of results for an aggregate query.

type AggregateResults

type AggregateResults interface {
	BaseResults

	// Reset resets the AggregateResults object to initial state.
	Reset(
		nsID ident.ID,
		aggregateQueryOpts AggregateResultsOptions,
	)

	// AggregateResultsOptions returns the options for this AggregateResult.
	AggregateResultsOptions() AggregateResultsOptions

	// AddFields adds the batch of fields to the results set, it will
	// assume ownership of the idents (and backing bytes) provided to it.
	// i.e. it is not safe to use/modify the idents once this function returns.
	AddFields(
		batch []AggregateResultsEntry,
	) (size int)

	// Map returns a map from tag name -> possible tag values,
	// comprising aggregate results.
	// Since a lock is not held when accessing the map after a call to this
	// method, it is unsafe to read or write to the map if any other caller
	// mutates the state of the results after obtaining a reference to the map
	// with this call.
	Map() *AggregateResultsMap
}

AggregateResults is a collection of results for an aggregation query, it is synchronized when access to the results set is used as documented by the methods.

func NewAggregateResults

func NewAggregateResults(
	namespaceID ident.ID,
	aggregateOpts AggregateResultsOptions,
	opts Options,
) AggregateResults

NewAggregateResults returns a new AggregateResults object.

type AggregateResultsAllocator

type AggregateResultsAllocator func() AggregateResults

AggregateResultsAllocator allocates AggregateResults types.

type AggregateResultsEntry

type AggregateResultsEntry struct {
	Field ident.ID
	Terms []ident.ID
}

AggregateResultsEntry is used during block.Aggregate() execution to collect entries.

type AggregateResultsEntryArr

type AggregateResultsEntryArr []AggregateResultsEntry

type AggregateResultsEntryArrPool

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

func (*AggregateResultsEntryArrPool) Get

func (*AggregateResultsEntryArrPool) Init

func (p *AggregateResultsEntryArrPool) Init()

func (*AggregateResultsEntryArrPool) Put

type AggregateResultsEntryArrayPool

type AggregateResultsEntryArrayPool interface {
	// Init initializes the array pool, it needs to be called
	// before Get/Put use.
	Init()

	// Get returns the a slice from the pool.
	Get() []AggregateResultsEntry

	// Put returns the provided slice to the pool.
	Put(elems []AggregateResultsEntry)
}

AggregateResultsEntryArrayPool provides a pool for aggregateResultsEntry slices.

type AggregateResultsEntryArrayPoolOpts

type AggregateResultsEntryArrayPoolOpts struct {
	Options     pool.ObjectPoolOptions
	Capacity    int
	MaxCapacity int
	FinalizeFn  AggregateResultsEntryFinalizeFn
}

type AggregateResultsEntryFinalizeFn

type AggregateResultsEntryFinalizeFn func([]AggregateResultsEntry) []AggregateResultsEntry

type AggregateResultsMap

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

AggregateResultsMap uses the genny package to provide a generic hash map that can be specialized by running the following command from this root of the repository: ``` make hashmap-gen pkg=outpkg key_type=Type value_type=Type out_dir=/tmp ``` Or if you would like to use bytes or ident.ID as keys you can use the partially specialized maps to generate your own maps as well: ``` make byteshashmap-gen pkg=outpkg value_type=Type out_dir=/tmp make idhashmap-gen pkg=outpkg value_type=Type out_dir=/tmp ``` This will output to stdout the generated source file to use for your map. It uses linear probing by incrementing the number of the hash created when hashing the identifier if there is a collision. AggregateResultsMap is a value type and not an interface to allow for less painful upgrades when adding/removing methods, it is not likely to need mocking so an interface would not be super useful either.

func (*AggregateResultsMap) Contains

func (m *AggregateResultsMap) Contains(k ident.ID) bool

Contains returns true if value exists for key, false otherwise, it is shorthand for a call to Get that doesn't return the value.

func (*AggregateResultsMap) Delete

func (m *AggregateResultsMap) Delete(k ident.ID)

Delete will remove a value set in the map for the specified key.

func (*AggregateResultsMap) Get

Get returns a value in the map for an identifier if found.

func (*AggregateResultsMap) Iter

Iter provides the underlying map to allow for using a native Go for loop to iterate the map, however callers should only ever read and not write the map.

func (*AggregateResultsMap) Len

func (m *AggregateResultsMap) Len() int

Len returns the number of map entries in the map.

func (*AggregateResultsMap) Reallocate

func (m *AggregateResultsMap) Reallocate()

Reallocate will avoid deleting all keys and reallocate a new map, this is useful if you believe you have a large map and will not need to grow back to a similar size.

func (*AggregateResultsMap) Reset

func (m *AggregateResultsMap) Reset()

Reset will reset the map by simply deleting all keys to avoid allocating a new map.

func (*AggregateResultsMap) Set

Set will set the value for an identifier.

func (*AggregateResultsMap) SetUnsafe

SetUnsafe will set the value for an identifier with unsafe options for how the map treats the key.

type AggregateResultsMapCopyFn

type AggregateResultsMapCopyFn func(ident.ID) ident.ID

AggregateResultsMapCopyFn is the copy key function to execute when copying the key.

type AggregateResultsMapEntry

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

AggregateResultsMapEntry is an entry in the map, this is public to support iterating over the map using a native Go for loop.

func (AggregateResultsMapEntry) Key

Key returns the map entry key.

func (AggregateResultsMapEntry) Value

Value returns the map entry value.

type AggregateResultsMapEqualsFn

type AggregateResultsMapEqualsFn func(ident.ID, ident.ID) bool

AggregateResultsMapEqualsFn is the equals key function to execute when detecting equality of a key.

type AggregateResultsMapFinalizeFn

type AggregateResultsMapFinalizeFn func(ident.ID)

AggregateResultsMapFinalizeFn is the finalize key function to execute when finished with a key.

type AggregateResultsMapHash

type AggregateResultsMapHash uint64

AggregateResultsMapHash is the hash for a given map entry, this is public to support iterating over the map using a native Go for loop.

type AggregateResultsMapHashFn

type AggregateResultsMapHashFn func(ident.ID) AggregateResultsMapHash

AggregateResultsMapHashFn is the hash function to execute when hashing a key.

type AggregateResultsMapSetUnsafeOptions

type AggregateResultsMapSetUnsafeOptions struct {
	NoCopyKey     bool
	NoFinalizeKey bool
}

AggregateResultsMapSetUnsafeOptions is a set of options to use when setting a value with the SetUnsafe method.

type AggregateResultsOptions

type AggregateResultsOptions struct {
	// SizeLimit will limit the total results set to a given limit and if
	// overflown will return early successfully.
	SizeLimit int

	// Type determines what result is required.
	Type AggregationType

	// FieldFilter is an optional param to filter aggregate values.
	FieldFilter AggregateFieldFilter
}

AggregateResultsOptions is a set of options to use for results.

type AggregateResultsPool

type AggregateResultsPool interface {
	// Init initializes the AggregateResults pool.
	Init(alloc AggregateResultsAllocator)

	// Get retrieves a AggregateResults object for use.
	Get() AggregateResults

	// Put returns the provided AggregateResults to the pool.
	Put(value AggregateResults)
}

AggregateResultsPool allows users to pool `AggregateResults` types.

func NewAggregateResultsPool

func NewAggregateResultsPool(
	opts pool.ObjectPoolOptions) AggregateResultsPool

NewAggregateResultsPool creates a new AggregateResultsPool.

type AggregateValues

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

AggregateValues is a collection of unique identity values backed by a pool. NB: there are no synchronization guarantees provided by default.

func MustNewAggregateValues

func MustNewAggregateValues(opts Options, ids ...ident.ID) AggregateValues

MustNewAggregateValues returns a new AggregateValues object with provided idents added in.

func NewAggregateValues

func NewAggregateValues(opts Options) AggregateValues

NewAggregateValues returns a new AggregateValues object.

func (*AggregateValues) Map

Map returns a map from an ID -> empty struct to signify existence of the ID in the set this structure represents.

func (*AggregateValues) Size

func (v *AggregateValues) Size() int

Size returns the number of IDs tracked.

type AggregateValuesAllocator

type AggregateValuesAllocator func() AggregateValues

AggregateValuesAllocator allocates AggregateValues types.

type AggregateValuesMap

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

AggregateValuesMap uses the genny package to provide a generic hash map that can be specialized by running the following command from this root of the repository: ``` make hashmap-gen pkg=outpkg key_type=Type value_type=Type out_dir=/tmp ``` Or if you would like to use bytes or ident.ID as keys you can use the partially specialized maps to generate your own maps as well: ``` make byteshashmap-gen pkg=outpkg value_type=Type out_dir=/tmp make idhashmap-gen pkg=outpkg value_type=Type out_dir=/tmp ``` This will output to stdout the generated source file to use for your map. It uses linear probing by incrementing the number of the hash created when hashing the identifier if there is a collision. AggregateValuesMap is a value type and not an interface to allow for less painful upgrades when adding/removing methods, it is not likely to need mocking so an interface would not be super useful either.

func NewAggregateValuesMap

func NewAggregateValuesMap(idPool ident.Pool) *AggregateValuesMap

NewAggregateValuesMap builds an AggregateValuesMap, which is primarily used for checking for existence of particular ident.IDs.

func (*AggregateValuesMap) Contains

func (m *AggregateValuesMap) Contains(k ident.ID) bool

Contains returns true if value exists for key, false otherwise, it is shorthand for a call to Get that doesn't return the value.

func (*AggregateValuesMap) Delete

func (m *AggregateValuesMap) Delete(k ident.ID)

Delete will remove a value set in the map for the specified key.

func (*AggregateValuesMap) Get

func (m *AggregateValuesMap) Get(k ident.ID) (struct{}, bool)

Get returns a value in the map for an identifier if found.

func (*AggregateValuesMap) Iter

Iter provides the underlying map to allow for using a native Go for loop to iterate the map, however callers should only ever read and not write the map.

func (*AggregateValuesMap) Len

func (m *AggregateValuesMap) Len() int

Len returns the number of map entries in the map.

func (*AggregateValuesMap) Reallocate

func (m *AggregateValuesMap) Reallocate()

Reallocate will avoid deleting all keys and reallocate a new map, this is useful if you believe you have a large map and will not need to grow back to a similar size.

func (*AggregateValuesMap) Reset

func (m *AggregateValuesMap) Reset()

Reset will reset the map by simply deleting all keys to avoid allocating a new map.

func (*AggregateValuesMap) Set

func (m *AggregateValuesMap) Set(k ident.ID, v struct{})

Set will set the value for an identifier.

func (*AggregateValuesMap) SetUnsafe

func (m *AggregateValuesMap) SetUnsafe(k ident.ID, v struct{}, opts AggregateValuesMapSetUnsafeOptions)

SetUnsafe will set the value for an identifier with unsafe options for how the map treats the key.

type AggregateValuesMapCopyFn

type AggregateValuesMapCopyFn func(ident.ID) ident.ID

AggregateValuesMapCopyFn is the copy key function to execute when copying the key.

type AggregateValuesMapEntry

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

AggregateValuesMapEntry is an entry in the map, this is public to support iterating over the map using a native Go for loop.

func (AggregateValuesMapEntry) Key

Key returns the map entry key.

func (AggregateValuesMapEntry) Value

func (e AggregateValuesMapEntry) Value() struct{}

Value returns the map entry value.

type AggregateValuesMapEqualsFn

type AggregateValuesMapEqualsFn func(ident.ID, ident.ID) bool

AggregateValuesMapEqualsFn is the equals key function to execute when detecting equality of a key.

type AggregateValuesMapFinalizeFn

type AggregateValuesMapFinalizeFn func(ident.ID)

AggregateValuesMapFinalizeFn is the finalize key function to execute when finished with a key.

type AggregateValuesMapHash

type AggregateValuesMapHash uint64

AggregateValuesMapHash is the hash for a given map entry, this is public to support iterating over the map using a native Go for loop.

type AggregateValuesMapHashFn

type AggregateValuesMapHashFn func(ident.ID) AggregateValuesMapHash

AggregateValuesMapHashFn is the hash function to execute when hashing a key.

type AggregateValuesMapSetUnsafeOptions

type AggregateValuesMapSetUnsafeOptions struct {
	NoCopyKey     bool
	NoFinalizeKey bool
}

AggregateValuesMapSetUnsafeOptions is a set of options to use when setting a value with the SetUnsafe method.

type AggregateValuesPool

type AggregateValuesPool interface {
	// Init initializes the AggregateValues pool.
	Init(alloc AggregateValuesAllocator)

	// Get retrieves a AggregateValues object for use.
	Get() AggregateValues

	// Put returns the provided AggregateValues to the pool.
	Put(value AggregateValues)
}

AggregateValuesPool allows users to pool `AggregateValues` types.

func NewAggregateValuesPool

func NewAggregateValuesPool(
	opts pool.ObjectPoolOptions) AggregateValuesPool

NewAggregateValuesPool creates a new AggregateValuesPool.

type AggregationOptions

type AggregationOptions struct {
	QueryOptions
	FieldFilter AggregateFieldFilter
	Type        AggregationType
}

AggregationOptions enables users to specify constraints on aggregations.

type AggregationType

type AggregationType uint8

AggregationType specifies what granularity to aggregate upto.

const (
	// AggregateTagNamesAndValues returns both the tag name and value.
	AggregateTagNamesAndValues AggregationType = iota
	// AggregateTagNames returns tag names only.
	AggregateTagNames
)

type BaseResults

type BaseResults interface {
	// Namespace returns the namespace associated with the result.
	Namespace() ident.ID

	// Size returns the number of IDs tracked.
	Size() int

	// AddDocuments adds the batch of documents to the results set, it will
	// take a copy of the bytes backing the documents so the original can be
	// modified after this function returns without affecting the results map.
	// TODO(r): We will need to change this behavior once index fields are
	// mutable and the most recent need to shadow older entries.
	AddDocuments(batch []doc.Document) (size int, err error)

	// Finalize releases any resources held by the Results object,
	// including returning it to a backing pool.
	Finalize()
}

BaseResults is a collection of basic results for a generic query, it is synchronized when access to the results set is used as documented by the methods.

type Block

type Block interface {
	// StartTime returns the start time of the period this Block indexes.
	StartTime() time.Time

	// EndTime returns the end time of the period this Block indexes.
	EndTime() time.Time

	// WriteBatch writes a batch of provided entries.
	WriteBatch(inserts *WriteBatch) (WriteBatchResult, error)

	// Query resolves the given query into known IDs.
	Query(
		ctx context.Context,
		cancellable *resource.CancellableLifetime,
		query Query,
		opts QueryOptions,
		results BaseResults,
		logFields []opentracinglog.Field,
	) (exhaustive bool, err error)

	// Aggregate aggregates known tag names/values.
	// NB(prateek): different from aggregating by means of Query, as we can
	// avoid going to documents, relying purely on the indexed FSTs.
	Aggregate(
		ctx context.Context,
		cancellable *resource.CancellableLifetime,
		opts QueryOptions,
		results AggregateResults,
		logFields []opentracinglog.Field,
	) (exhaustive bool, err error)

	// AddResults adds bootstrap results to the block.
	AddResults(results result.IndexBlock) error

	// Tick does internal house keeping operations.
	Tick(c context.Cancellable) (BlockTickResult, error)

	// Stats returns block stats.
	Stats(reporter BlockStatsReporter) error

	// Seal prevents the block from taking any more writes, but, it still permits
	// addition of segments via Bootstrap().
	Seal() error

	// IsSealed returns whether this block was sealed.
	IsSealed() bool

	// NeedsMutableSegmentsEvicted returns whether this block has any mutable segments
	// that are not-empty and sealed.
	// A sealed non-empty mutable segment needs to get evicted from memory as
	// soon as it can be to reduce memory footprint.
	NeedsMutableSegmentsEvicted() bool

	// EvictMutableSegments closes any mutable segments, this is only applicable
	// valid to be called once the block and hence mutable segments are sealed.
	// It is expected that results have been added to the block that covers any
	// data the mutable segments should have held at this time.
	EvictMutableSegments() error

	// Close will release any held resources and close the Block.
	Close() error
}

Block represents a collection of segments. Each `Block` is a complete reverse index for a period of time defined by [StartTime, EndTime).

func NewBlock

func NewBlock(
	blockStart time.Time,
	md namespace.Metadata,
	opts BlockOptions,
	indexOpts Options,
) (Block, error)

NewBlock returns a new Block, representing a complete reverse index for the duration of time specified. It is backed by one or more segments.

type BlockOptions

type BlockOptions struct {
	ForegroundCompactorMmapDocsData bool
	BackgroundCompactorMmapDocsData bool
}

BlockOptions is a set of options used when constructing an index block.

type BlockSegmentStats

type BlockSegmentStats struct {
	Type    BlockSegmentType
	Mutable bool
	Age     time.Duration
	Size    int64
}

BlockSegmentStats has segment stats.

type BlockSegmentType

type BlockSegmentType uint

BlockSegmentType is a block segment type

const (
	// ActiveForegroundSegment is an active foreground compacted segment.
	ActiveForegroundSegment BlockSegmentType = iota
	// ActiveBackgroundSegment is an active background compacted segment.
	ActiveBackgroundSegment
	// FlushedSegment is an immutable segment that can't change any longer.
	FlushedSegment
)

type BlockStatsReporter

type BlockStatsReporter interface {
	ReportSegmentStats(stats BlockSegmentStats)
}

BlockStatsReporter is a block stats reporter that collects block stats on a per block basis (without needing to query each block and get an immutable list of segments back).

type BlockStatsReporterFn

type BlockStatsReporterFn func(stats BlockSegmentStats)

BlockStatsReporterFn implements the block stats reporter using a callback function.

func (BlockStatsReporterFn) ReportSegmentStats

func (f BlockStatsReporterFn) ReportSegmentStats(stats BlockSegmentStats)

ReportSegmentStats implements the BlockStatsReporter interface.

type BlockTickResult

type BlockTickResult struct {
	NumSegments int64
	NumDocs     int64
}

BlockTickResult returns statistics about tick.

type Closer

type Closer func()

Closer represents a function that will close managed resources.

type EvictMutableSegmentResults

type EvictMutableSegmentResults struct {
	NumMutableSegments int64
	NumDocs            int64
}

EvictMutableSegmentResults returns statistics about the EvictMutableSegments execution.

func (*EvictMutableSegmentResults) Add

Add adds the provided results to the receiver.

type ForEachWriteBatchByBlockStartFn

type ForEachWriteBatchByBlockStartFn func(
	blockStart time.Time,
	batch *WriteBatch,
)

ForEachWriteBatchByBlockStartFn allows a caller to perform an operation with reference to a restricted set of the write batch for each unique block start.

type ForEachWriteBatchEntryFn

type ForEachWriteBatchEntryFn func(
	idx int,
	entry WriteBatchEntry,
	doc doc.Document,
	result WriteBatchEntryResult,
)

ForEachWriteBatchEntryFn allows a caller to perform an operation for each batch entry.

type InsertMode

type InsertMode byte

InsertMode specifies whether inserts are synchronous or asynchronous.

const (
	InsertSync InsertMode = iota
	InsertAsync
)

nolint

type MockAggregateResults

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

MockAggregateResults is a mock of AggregateResults interface

func NewMockAggregateResults

func NewMockAggregateResults(ctrl *gomock.Controller) *MockAggregateResults

NewMockAggregateResults creates a new mock instance

func (*MockAggregateResults) AddDocuments

func (m *MockAggregateResults) AddDocuments(batch []doc.Document) (int, error)

AddDocuments mocks base method

func (*MockAggregateResults) AddFields

func (m *MockAggregateResults) AddFields(batch []AggregateResultsEntry) int

AddFields mocks base method

func (*MockAggregateResults) AggregateResultsOptions

func (m *MockAggregateResults) AggregateResultsOptions() AggregateResultsOptions

AggregateResultsOptions mocks base method

func (*MockAggregateResults) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockAggregateResults) Finalize

func (m *MockAggregateResults) Finalize()

Finalize mocks base method

func (*MockAggregateResults) Map

Map mocks base method

func (*MockAggregateResults) Namespace

func (m *MockAggregateResults) Namespace() ident.ID

Namespace mocks base method

func (*MockAggregateResults) Reset

func (m *MockAggregateResults) Reset(nsID ident.ID, aggregateQueryOpts AggregateResultsOptions)

Reset mocks base method

func (*MockAggregateResults) Size

func (m *MockAggregateResults) Size() int

Size mocks base method

type MockAggregateResultsMockRecorder

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

MockAggregateResultsMockRecorder is the mock recorder for MockAggregateResults

func (*MockAggregateResultsMockRecorder) AddDocuments

func (mr *MockAggregateResultsMockRecorder) AddDocuments(batch interface{}) *gomock.Call

AddDocuments indicates an expected call of AddDocuments

func (*MockAggregateResultsMockRecorder) AddFields

func (mr *MockAggregateResultsMockRecorder) AddFields(batch interface{}) *gomock.Call

AddFields indicates an expected call of AddFields

func (*MockAggregateResultsMockRecorder) AggregateResultsOptions

func (mr *MockAggregateResultsMockRecorder) AggregateResultsOptions() *gomock.Call

AggregateResultsOptions indicates an expected call of AggregateResultsOptions

func (*MockAggregateResultsMockRecorder) Finalize

Finalize indicates an expected call of Finalize

func (*MockAggregateResultsMockRecorder) Map

Map indicates an expected call of Map

func (*MockAggregateResultsMockRecorder) Namespace

func (mr *MockAggregateResultsMockRecorder) Namespace() *gomock.Call

Namespace indicates an expected call of Namespace

func (*MockAggregateResultsMockRecorder) Reset

func (mr *MockAggregateResultsMockRecorder) Reset(nsID, aggregateQueryOpts interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockAggregateResultsMockRecorder) Size

Size indicates an expected call of Size

type MockAggregateResultsPool

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

MockAggregateResultsPool is a mock of AggregateResultsPool interface

func NewMockAggregateResultsPool

func NewMockAggregateResultsPool(ctrl *gomock.Controller) *MockAggregateResultsPool

NewMockAggregateResultsPool creates a new mock instance

func (*MockAggregateResultsPool) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockAggregateResultsPool) Get

Get mocks base method

func (*MockAggregateResultsPool) Init

Init mocks base method

func (*MockAggregateResultsPool) Put

Put mocks base method

type MockAggregateResultsPoolMockRecorder

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

MockAggregateResultsPoolMockRecorder is the mock recorder for MockAggregateResultsPool

func (*MockAggregateResultsPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockAggregateResultsPoolMockRecorder) Init

func (mr *MockAggregateResultsPoolMockRecorder) Init(alloc interface{}) *gomock.Call

Init indicates an expected call of Init

func (*MockAggregateResultsPoolMockRecorder) Put

func (mr *MockAggregateResultsPoolMockRecorder) Put(value interface{}) *gomock.Call

Put indicates an expected call of Put

type MockAggregateValuesPool

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

MockAggregateValuesPool is a mock of AggregateValuesPool interface

func NewMockAggregateValuesPool

func NewMockAggregateValuesPool(ctrl *gomock.Controller) *MockAggregateValuesPool

NewMockAggregateValuesPool creates a new mock instance

func (*MockAggregateValuesPool) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockAggregateValuesPool) Get

Get mocks base method

func (*MockAggregateValuesPool) Init

Init mocks base method

func (*MockAggregateValuesPool) Put

Put mocks base method

type MockAggregateValuesPoolMockRecorder

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

MockAggregateValuesPoolMockRecorder is the mock recorder for MockAggregateValuesPool

func (*MockAggregateValuesPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockAggregateValuesPoolMockRecorder) Init

func (mr *MockAggregateValuesPoolMockRecorder) Init(alloc interface{}) *gomock.Call

Init indicates an expected call of Init

func (*MockAggregateValuesPoolMockRecorder) Put

func (mr *MockAggregateValuesPoolMockRecorder) Put(value interface{}) *gomock.Call

Put indicates an expected call of Put

type MockBaseResults

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

MockBaseResults is a mock of BaseResults interface

func NewMockBaseResults

func NewMockBaseResults(ctrl *gomock.Controller) *MockBaseResults

NewMockBaseResults creates a new mock instance

func (*MockBaseResults) AddDocuments

func (m *MockBaseResults) AddDocuments(batch []doc.Document) (int, error)

AddDocuments mocks base method

func (*MockBaseResults) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBaseResults) Finalize

func (m *MockBaseResults) Finalize()

Finalize mocks base method

func (*MockBaseResults) Namespace

func (m *MockBaseResults) Namespace() ident.ID

Namespace mocks base method

func (*MockBaseResults) Size

func (m *MockBaseResults) Size() int

Size mocks base method

type MockBaseResultsMockRecorder

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

MockBaseResultsMockRecorder is the mock recorder for MockBaseResults

func (*MockBaseResultsMockRecorder) AddDocuments

func (mr *MockBaseResultsMockRecorder) AddDocuments(batch interface{}) *gomock.Call

AddDocuments indicates an expected call of AddDocuments

func (*MockBaseResultsMockRecorder) Finalize

func (mr *MockBaseResultsMockRecorder) Finalize() *gomock.Call

Finalize indicates an expected call of Finalize

func (*MockBaseResultsMockRecorder) Namespace

func (mr *MockBaseResultsMockRecorder) Namespace() *gomock.Call

Namespace indicates an expected call of Namespace

func (*MockBaseResultsMockRecorder) Size

Size indicates an expected call of Size

type MockBlock

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

MockBlock is a mock of Block interface

func NewMockBlock

func NewMockBlock(ctrl *gomock.Controller) *MockBlock

NewMockBlock creates a new mock instance

func (*MockBlock) AddResults

func (m *MockBlock) AddResults(results result.IndexBlock) error

AddResults mocks base method

func (*MockBlock) Aggregate

func (m *MockBlock) Aggregate(ctx context.Context, cancellable *resource.CancellableLifetime, opts QueryOptions, results AggregateResults, logFields []log.Field) (bool, error)

Aggregate mocks base method

func (*MockBlock) Close

func (m *MockBlock) Close() error

Close mocks base method

func (*MockBlock) EXPECT

func (m *MockBlock) EXPECT() *MockBlockMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBlock) EndTime

func (m *MockBlock) EndTime() time.Time

EndTime mocks base method

func (*MockBlock) EvictMutableSegments

func (m *MockBlock) EvictMutableSegments() error

EvictMutableSegments mocks base method

func (*MockBlock) IsSealed

func (m *MockBlock) IsSealed() bool

IsSealed mocks base method

func (*MockBlock) NeedsMutableSegmentsEvicted

func (m *MockBlock) NeedsMutableSegmentsEvicted() bool

NeedsMutableSegmentsEvicted mocks base method

func (*MockBlock) Query

func (m *MockBlock) Query(ctx context.Context, cancellable *resource.CancellableLifetime, query Query, opts QueryOptions, results BaseResults, logFields []log.Field) (bool, error)

Query mocks base method

func (*MockBlock) Seal

func (m *MockBlock) Seal() error

Seal mocks base method

func (*MockBlock) StartTime

func (m *MockBlock) StartTime() time.Time

StartTime mocks base method

func (*MockBlock) Stats

func (m *MockBlock) Stats(reporter BlockStatsReporter) error

Stats mocks base method

func (*MockBlock) Tick

Tick mocks base method

func (*MockBlock) WriteBatch

func (m *MockBlock) WriteBatch(inserts *WriteBatch) (WriteBatchResult, error)

WriteBatch mocks base method

type MockBlockMockRecorder

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

MockBlockMockRecorder is the mock recorder for MockBlock

func (*MockBlockMockRecorder) AddResults

func (mr *MockBlockMockRecorder) AddResults(results interface{}) *gomock.Call

AddResults indicates an expected call of AddResults

func (*MockBlockMockRecorder) Aggregate

func (mr *MockBlockMockRecorder) Aggregate(ctx, cancellable, opts, results, logFields interface{}) *gomock.Call

Aggregate indicates an expected call of Aggregate

func (*MockBlockMockRecorder) Close

func (mr *MockBlockMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockBlockMockRecorder) EndTime

func (mr *MockBlockMockRecorder) EndTime() *gomock.Call

EndTime indicates an expected call of EndTime

func (*MockBlockMockRecorder) EvictMutableSegments

func (mr *MockBlockMockRecorder) EvictMutableSegments() *gomock.Call

EvictMutableSegments indicates an expected call of EvictMutableSegments

func (*MockBlockMockRecorder) IsSealed

func (mr *MockBlockMockRecorder) IsSealed() *gomock.Call

IsSealed indicates an expected call of IsSealed

func (*MockBlockMockRecorder) NeedsMutableSegmentsEvicted

func (mr *MockBlockMockRecorder) NeedsMutableSegmentsEvicted() *gomock.Call

NeedsMutableSegmentsEvicted indicates an expected call of NeedsMutableSegmentsEvicted

func (*MockBlockMockRecorder) Query

func (mr *MockBlockMockRecorder) Query(ctx, cancellable, query, opts, results, logFields interface{}) *gomock.Call

Query indicates an expected call of Query

func (*MockBlockMockRecorder) Seal

func (mr *MockBlockMockRecorder) Seal() *gomock.Call

Seal indicates an expected call of Seal

func (*MockBlockMockRecorder) StartTime

func (mr *MockBlockMockRecorder) StartTime() *gomock.Call

StartTime indicates an expected call of StartTime

func (*MockBlockMockRecorder) Stats

func (mr *MockBlockMockRecorder) Stats(reporter interface{}) *gomock.Call

Stats indicates an expected call of Stats

func (*MockBlockMockRecorder) Tick

func (mr *MockBlockMockRecorder) Tick(c interface{}) *gomock.Call

Tick indicates an expected call of Tick

func (*MockBlockMockRecorder) WriteBatch

func (mr *MockBlockMockRecorder) WriteBatch(inserts interface{}) *gomock.Call

WriteBatch indicates an expected call of WriteBatch

type MockBlockStatsReporter

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

MockBlockStatsReporter is a mock of BlockStatsReporter interface

func NewMockBlockStatsReporter

func NewMockBlockStatsReporter(ctrl *gomock.Controller) *MockBlockStatsReporter

NewMockBlockStatsReporter creates a new mock instance

func (*MockBlockStatsReporter) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBlockStatsReporter) ReportSegmentStats

func (m *MockBlockStatsReporter) ReportSegmentStats(stats BlockSegmentStats)

ReportSegmentStats mocks base method

type MockBlockStatsReporterMockRecorder

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

MockBlockStatsReporterMockRecorder is the mock recorder for MockBlockStatsReporter

func (*MockBlockStatsReporterMockRecorder) ReportSegmentStats

func (mr *MockBlockStatsReporterMockRecorder) ReportSegmentStats(stats interface{}) *gomock.Call

ReportSegmentStats indicates an expected call of ReportSegmentStats

type MockOnIndexSeries

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

MockOnIndexSeries is a mock of OnIndexSeries interface

func NewMockOnIndexSeries

func NewMockOnIndexSeries(ctrl *gomock.Controller) *MockOnIndexSeries

NewMockOnIndexSeries creates a new mock instance

func (*MockOnIndexSeries) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockOnIndexSeries) NeedsIndexUpdate

func (m *MockOnIndexSeries) NeedsIndexUpdate(indexBlockStartForWrite time0.UnixNano) bool

NeedsIndexUpdate mocks base method

func (*MockOnIndexSeries) OnIndexFinalize

func (m *MockOnIndexSeries) OnIndexFinalize(blockStart time0.UnixNano)

OnIndexFinalize mocks base method

func (*MockOnIndexSeries) OnIndexPrepare

func (m *MockOnIndexSeries) OnIndexPrepare()

OnIndexPrepare mocks base method

func (*MockOnIndexSeries) OnIndexSuccess

func (m *MockOnIndexSeries) OnIndexSuccess(blockStart time0.UnixNano)

OnIndexSuccess mocks base method

type MockOnIndexSeriesMockRecorder

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

MockOnIndexSeriesMockRecorder is the mock recorder for MockOnIndexSeries

func (*MockOnIndexSeriesMockRecorder) NeedsIndexUpdate

func (mr *MockOnIndexSeriesMockRecorder) NeedsIndexUpdate(indexBlockStartForWrite interface{}) *gomock.Call

NeedsIndexUpdate indicates an expected call of NeedsIndexUpdate

func (*MockOnIndexSeriesMockRecorder) OnIndexFinalize

func (mr *MockOnIndexSeriesMockRecorder) OnIndexFinalize(blockStart interface{}) *gomock.Call

OnIndexFinalize indicates an expected call of OnIndexFinalize

func (*MockOnIndexSeriesMockRecorder) OnIndexPrepare

func (mr *MockOnIndexSeriesMockRecorder) OnIndexPrepare() *gomock.Call

OnIndexPrepare indicates an expected call of OnIndexPrepare

func (*MockOnIndexSeriesMockRecorder) OnIndexSuccess

func (mr *MockOnIndexSeriesMockRecorder) OnIndexSuccess(blockStart interface{}) *gomock.Call

OnIndexSuccess indicates an expected call of OnIndexSuccess

type MockOptions

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

MockOptions is a mock of Options interface

func NewMockOptions

func NewMockOptions(ctrl *gomock.Controller) *MockOptions

NewMockOptions creates a new mock instance

func (*MockOptions) AggregateResultsEntryArrayPool

func (m *MockOptions) AggregateResultsEntryArrayPool() AggregateResultsEntryArrayPool

AggregateResultsEntryArrayPool mocks base method

func (*MockOptions) AggregateResultsPool

func (m *MockOptions) AggregateResultsPool() AggregateResultsPool

AggregateResultsPool mocks base method

func (*MockOptions) AggregateValuesPool

func (m *MockOptions) AggregateValuesPool() AggregateValuesPool

AggregateValuesPool mocks base method

func (*MockOptions) BackgroundCompactionPlannerOptions

func (m *MockOptions) BackgroundCompactionPlannerOptions() compaction.PlannerOptions

BackgroundCompactionPlannerOptions mocks base method

func (*MockOptions) CheckedBytesPool

func (m *MockOptions) CheckedBytesPool() pool.CheckedBytesPool

CheckedBytesPool mocks base method

func (*MockOptions) ClockOptions

func (m *MockOptions) ClockOptions() clock.Options

ClockOptions mocks base method

func (*MockOptions) DocumentArrayPool

func (m *MockOptions) DocumentArrayPool() doc.DocumentArrayPool

DocumentArrayPool mocks base method

func (*MockOptions) EXPECT

func (m *MockOptions) EXPECT() *MockOptionsMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockOptions) FSTSegmentOptions

func (m *MockOptions) FSTSegmentOptions() fst.Options

FSTSegmentOptions mocks base method

func (*MockOptions) ForegroundCompactionPlannerOptions

func (m *MockOptions) ForegroundCompactionPlannerOptions() compaction.PlannerOptions

ForegroundCompactionPlannerOptions mocks base method

func (*MockOptions) ForwardIndexProbability

func (m *MockOptions) ForwardIndexProbability() float64

ForwardIndexProbability mocks base method

func (*MockOptions) ForwardIndexThreshold

func (m *MockOptions) ForwardIndexThreshold() float64

ForwardIndexThreshold mocks base method

func (*MockOptions) IdentifierPool

func (m *MockOptions) IdentifierPool() ident.Pool

IdentifierPool mocks base method

func (*MockOptions) InsertMode

func (m *MockOptions) InsertMode() InsertMode

InsertMode mocks base method

func (*MockOptions) InstrumentOptions

func (m *MockOptions) InstrumentOptions() instrument.Options

InstrumentOptions mocks base method

func (*MockOptions) MemSegmentOptions

func (m *MockOptions) MemSegmentOptions() mem.Options

MemSegmentOptions mocks base method

func (*MockOptions) PostingsListCache

func (m *MockOptions) PostingsListCache() *PostingsListCache

PostingsListCache mocks base method

func (*MockOptions) QueryResultsPool

func (m *MockOptions) QueryResultsPool() QueryResultsPool

QueryResultsPool mocks base method

func (*MockOptions) ReadThroughSegmentOptions

func (m *MockOptions) ReadThroughSegmentOptions() ReadThroughSegmentOptions

ReadThroughSegmentOptions mocks base method

func (*MockOptions) SegmentBuilderOptions

func (m *MockOptions) SegmentBuilderOptions() builder.Options

SegmentBuilderOptions mocks base method

func (*MockOptions) SetAggregateResultsEntryArrayPool

func (m *MockOptions) SetAggregateResultsEntryArrayPool(value AggregateResultsEntryArrayPool) Options

SetAggregateResultsEntryArrayPool mocks base method

func (*MockOptions) SetAggregateResultsPool

func (m *MockOptions) SetAggregateResultsPool(values AggregateResultsPool) Options

SetAggregateResultsPool mocks base method

func (*MockOptions) SetAggregateValuesPool

func (m *MockOptions) SetAggregateValuesPool(values AggregateValuesPool) Options

SetAggregateValuesPool mocks base method

func (*MockOptions) SetBackgroundCompactionPlannerOptions

func (m *MockOptions) SetBackgroundCompactionPlannerOptions(v compaction.PlannerOptions) Options

SetBackgroundCompactionPlannerOptions mocks base method

func (*MockOptions) SetCheckedBytesPool

func (m *MockOptions) SetCheckedBytesPool(value pool.CheckedBytesPool) Options

SetCheckedBytesPool mocks base method

func (*MockOptions) SetClockOptions

func (m *MockOptions) SetClockOptions(value clock.Options) Options

SetClockOptions mocks base method

func (*MockOptions) SetDocumentArrayPool

func (m *MockOptions) SetDocumentArrayPool(value doc.DocumentArrayPool) Options

SetDocumentArrayPool mocks base method

func (*MockOptions) SetFSTSegmentOptions

func (m *MockOptions) SetFSTSegmentOptions(value fst.Options) Options

SetFSTSegmentOptions mocks base method

func (*MockOptions) SetForegroundCompactionPlannerOptions

func (m *MockOptions) SetForegroundCompactionPlannerOptions(v compaction.PlannerOptions) Options

SetForegroundCompactionPlannerOptions mocks base method

func (*MockOptions) SetForwardIndexProbability

func (m *MockOptions) SetForwardIndexProbability(value float64) Options

SetForwardIndexProbability mocks base method

func (*MockOptions) SetForwardIndexThreshold

func (m *MockOptions) SetForwardIndexThreshold(value float64) Options

SetForwardIndexThreshold mocks base method

func (*MockOptions) SetIdentifierPool

func (m *MockOptions) SetIdentifierPool(value ident.Pool) Options

SetIdentifierPool mocks base method

func (*MockOptions) SetInsertMode

func (m *MockOptions) SetInsertMode(value InsertMode) Options

SetInsertMode mocks base method

func (*MockOptions) SetInstrumentOptions

func (m *MockOptions) SetInstrumentOptions(value instrument.Options) Options

SetInstrumentOptions mocks base method

func (*MockOptions) SetMemSegmentOptions

func (m *MockOptions) SetMemSegmentOptions(value mem.Options) Options

SetMemSegmentOptions mocks base method

func (*MockOptions) SetPostingsListCache

func (m *MockOptions) SetPostingsListCache(value *PostingsListCache) Options

SetPostingsListCache mocks base method

func (*MockOptions) SetQueryResultsPool

func (m *MockOptions) SetQueryResultsPool(values QueryResultsPool) Options

SetQueryResultsPool mocks base method

func (*MockOptions) SetReadThroughSegmentOptions

func (m *MockOptions) SetReadThroughSegmentOptions(value ReadThroughSegmentOptions) Options

SetReadThroughSegmentOptions mocks base method

func (*MockOptions) SetSegmentBuilderOptions

func (m *MockOptions) SetSegmentBuilderOptions(value builder.Options) Options

SetSegmentBuilderOptions mocks base method

func (*MockOptions) Validate

func (m *MockOptions) Validate() error

Validate mocks base method

type MockOptionsMockRecorder

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

MockOptionsMockRecorder is the mock recorder for MockOptions

func (*MockOptionsMockRecorder) AggregateResultsEntryArrayPool

func (mr *MockOptionsMockRecorder) AggregateResultsEntryArrayPool() *gomock.Call

AggregateResultsEntryArrayPool indicates an expected call of AggregateResultsEntryArrayPool

func (*MockOptionsMockRecorder) AggregateResultsPool

func (mr *MockOptionsMockRecorder) AggregateResultsPool() *gomock.Call

AggregateResultsPool indicates an expected call of AggregateResultsPool

func (*MockOptionsMockRecorder) AggregateValuesPool

func (mr *MockOptionsMockRecorder) AggregateValuesPool() *gomock.Call

AggregateValuesPool indicates an expected call of AggregateValuesPool

func (*MockOptionsMockRecorder) BackgroundCompactionPlannerOptions

func (mr *MockOptionsMockRecorder) BackgroundCompactionPlannerOptions() *gomock.Call

BackgroundCompactionPlannerOptions indicates an expected call of BackgroundCompactionPlannerOptions

func (*MockOptionsMockRecorder) CheckedBytesPool

func (mr *MockOptionsMockRecorder) CheckedBytesPool() *gomock.Call

CheckedBytesPool indicates an expected call of CheckedBytesPool

func (*MockOptionsMockRecorder) ClockOptions

func (mr *MockOptionsMockRecorder) ClockOptions() *gomock.Call

ClockOptions indicates an expected call of ClockOptions

func (*MockOptionsMockRecorder) DocumentArrayPool

func (mr *MockOptionsMockRecorder) DocumentArrayPool() *gomock.Call

DocumentArrayPool indicates an expected call of DocumentArrayPool

func (*MockOptionsMockRecorder) FSTSegmentOptions

func (mr *MockOptionsMockRecorder) FSTSegmentOptions() *gomock.Call

FSTSegmentOptions indicates an expected call of FSTSegmentOptions

func (*MockOptionsMockRecorder) ForegroundCompactionPlannerOptions

func (mr *MockOptionsMockRecorder) ForegroundCompactionPlannerOptions() *gomock.Call

ForegroundCompactionPlannerOptions indicates an expected call of ForegroundCompactionPlannerOptions

func (*MockOptionsMockRecorder) ForwardIndexProbability

func (mr *MockOptionsMockRecorder) ForwardIndexProbability() *gomock.Call

ForwardIndexProbability indicates an expected call of ForwardIndexProbability

func (*MockOptionsMockRecorder) ForwardIndexThreshold

func (mr *MockOptionsMockRecorder) ForwardIndexThreshold() *gomock.Call

ForwardIndexThreshold indicates an expected call of ForwardIndexThreshold

func (*MockOptionsMockRecorder) IdentifierPool

func (mr *MockOptionsMockRecorder) IdentifierPool() *gomock.Call

IdentifierPool indicates an expected call of IdentifierPool

func (*MockOptionsMockRecorder) InsertMode

func (mr *MockOptionsMockRecorder) InsertMode() *gomock.Call

InsertMode indicates an expected call of InsertMode

func (*MockOptionsMockRecorder) InstrumentOptions

func (mr *MockOptionsMockRecorder) InstrumentOptions() *gomock.Call

InstrumentOptions indicates an expected call of InstrumentOptions

func (*MockOptionsMockRecorder) MemSegmentOptions

func (mr *MockOptionsMockRecorder) MemSegmentOptions() *gomock.Call

MemSegmentOptions indicates an expected call of MemSegmentOptions

func (*MockOptionsMockRecorder) PostingsListCache

func (mr *MockOptionsMockRecorder) PostingsListCache() *gomock.Call

PostingsListCache indicates an expected call of PostingsListCache

func (*MockOptionsMockRecorder) QueryResultsPool

func (mr *MockOptionsMockRecorder) QueryResultsPool() *gomock.Call

QueryResultsPool indicates an expected call of QueryResultsPool

func (*MockOptionsMockRecorder) ReadThroughSegmentOptions

func (mr *MockOptionsMockRecorder) ReadThroughSegmentOptions() *gomock.Call

ReadThroughSegmentOptions indicates an expected call of ReadThroughSegmentOptions

func (*MockOptionsMockRecorder) SegmentBuilderOptions

func (mr *MockOptionsMockRecorder) SegmentBuilderOptions() *gomock.Call

SegmentBuilderOptions indicates an expected call of SegmentBuilderOptions

func (*MockOptionsMockRecorder) SetAggregateResultsEntryArrayPool

func (mr *MockOptionsMockRecorder) SetAggregateResultsEntryArrayPool(value interface{}) *gomock.Call

SetAggregateResultsEntryArrayPool indicates an expected call of SetAggregateResultsEntryArrayPool

func (*MockOptionsMockRecorder) SetAggregateResultsPool

func (mr *MockOptionsMockRecorder) SetAggregateResultsPool(values interface{}) *gomock.Call

SetAggregateResultsPool indicates an expected call of SetAggregateResultsPool

func (*MockOptionsMockRecorder) SetAggregateValuesPool

func (mr *MockOptionsMockRecorder) SetAggregateValuesPool(values interface{}) *gomock.Call

SetAggregateValuesPool indicates an expected call of SetAggregateValuesPool

func (*MockOptionsMockRecorder) SetBackgroundCompactionPlannerOptions

func (mr *MockOptionsMockRecorder) SetBackgroundCompactionPlannerOptions(v interface{}) *gomock.Call

SetBackgroundCompactionPlannerOptions indicates an expected call of SetBackgroundCompactionPlannerOptions

func (*MockOptionsMockRecorder) SetCheckedBytesPool

func (mr *MockOptionsMockRecorder) SetCheckedBytesPool(value interface{}) *gomock.Call

SetCheckedBytesPool indicates an expected call of SetCheckedBytesPool

func (*MockOptionsMockRecorder) SetClockOptions

func (mr *MockOptionsMockRecorder) SetClockOptions(value interface{}) *gomock.Call

SetClockOptions indicates an expected call of SetClockOptions

func (*MockOptionsMockRecorder) SetDocumentArrayPool

func (mr *MockOptionsMockRecorder) SetDocumentArrayPool(value interface{}) *gomock.Call

SetDocumentArrayPool indicates an expected call of SetDocumentArrayPool

func (*MockOptionsMockRecorder) SetFSTSegmentOptions

func (mr *MockOptionsMockRecorder) SetFSTSegmentOptions(value interface{}) *gomock.Call

SetFSTSegmentOptions indicates an expected call of SetFSTSegmentOptions

func (*MockOptionsMockRecorder) SetForegroundCompactionPlannerOptions

func (mr *MockOptionsMockRecorder) SetForegroundCompactionPlannerOptions(v interface{}) *gomock.Call

SetForegroundCompactionPlannerOptions indicates an expected call of SetForegroundCompactionPlannerOptions

func (*MockOptionsMockRecorder) SetForwardIndexProbability

func (mr *MockOptionsMockRecorder) SetForwardIndexProbability(value interface{}) *gomock.Call

SetForwardIndexProbability indicates an expected call of SetForwardIndexProbability

func (*MockOptionsMockRecorder) SetForwardIndexThreshold

func (mr *MockOptionsMockRecorder) SetForwardIndexThreshold(value interface{}) *gomock.Call

SetForwardIndexThreshold indicates an expected call of SetForwardIndexThreshold

func (*MockOptionsMockRecorder) SetIdentifierPool

func (mr *MockOptionsMockRecorder) SetIdentifierPool(value interface{}) *gomock.Call

SetIdentifierPool indicates an expected call of SetIdentifierPool

func (*MockOptionsMockRecorder) SetInsertMode

func (mr *MockOptionsMockRecorder) SetInsertMode(value interface{}) *gomock.Call

SetInsertMode indicates an expected call of SetInsertMode

func (*MockOptionsMockRecorder) SetInstrumentOptions

func (mr *MockOptionsMockRecorder) SetInstrumentOptions(value interface{}) *gomock.Call

SetInstrumentOptions indicates an expected call of SetInstrumentOptions

func (*MockOptionsMockRecorder) SetMemSegmentOptions

func (mr *MockOptionsMockRecorder) SetMemSegmentOptions(value interface{}) *gomock.Call

SetMemSegmentOptions indicates an expected call of SetMemSegmentOptions

func (*MockOptionsMockRecorder) SetPostingsListCache

func (mr *MockOptionsMockRecorder) SetPostingsListCache(value interface{}) *gomock.Call

SetPostingsListCache indicates an expected call of SetPostingsListCache

func (*MockOptionsMockRecorder) SetQueryResultsPool

func (mr *MockOptionsMockRecorder) SetQueryResultsPool(values interface{}) *gomock.Call

SetQueryResultsPool indicates an expected call of SetQueryResultsPool

func (*MockOptionsMockRecorder) SetReadThroughSegmentOptions

func (mr *MockOptionsMockRecorder) SetReadThroughSegmentOptions(value interface{}) *gomock.Call

SetReadThroughSegmentOptions indicates an expected call of SetReadThroughSegmentOptions

func (*MockOptionsMockRecorder) SetSegmentBuilderOptions

func (mr *MockOptionsMockRecorder) SetSegmentBuilderOptions(value interface{}) *gomock.Call

SetSegmentBuilderOptions indicates an expected call of SetSegmentBuilderOptions

func (*MockOptionsMockRecorder) Validate

func (mr *MockOptionsMockRecorder) Validate() *gomock.Call

Validate indicates an expected call of Validate

type MockQueryResults

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

MockQueryResults is a mock of QueryResults interface

func NewMockQueryResults

func NewMockQueryResults(ctrl *gomock.Controller) *MockQueryResults

NewMockQueryResults creates a new mock instance

func (*MockQueryResults) AddDocuments

func (m *MockQueryResults) AddDocuments(batch []doc.Document) (int, error)

AddDocuments mocks base method

func (*MockQueryResults) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockQueryResults) Finalize

func (m *MockQueryResults) Finalize()

Finalize mocks base method

func (*MockQueryResults) Map

func (m *MockQueryResults) Map() *ResultsMap

Map mocks base method

func (*MockQueryResults) Namespace

func (m *MockQueryResults) Namespace() ident.ID

Namespace mocks base method

func (*MockQueryResults) Reset

func (m *MockQueryResults) Reset(nsID ident.ID, opts QueryResultsOptions)

Reset mocks base method

func (*MockQueryResults) Size

func (m *MockQueryResults) Size() int

Size mocks base method

type MockQueryResultsMockRecorder

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

MockQueryResultsMockRecorder is the mock recorder for MockQueryResults

func (*MockQueryResultsMockRecorder) AddDocuments

func (mr *MockQueryResultsMockRecorder) AddDocuments(batch interface{}) *gomock.Call

AddDocuments indicates an expected call of AddDocuments

func (*MockQueryResultsMockRecorder) Finalize

func (mr *MockQueryResultsMockRecorder) Finalize() *gomock.Call

Finalize indicates an expected call of Finalize

func (*MockQueryResultsMockRecorder) Map

Map indicates an expected call of Map

func (*MockQueryResultsMockRecorder) Namespace

func (mr *MockQueryResultsMockRecorder) Namespace() *gomock.Call

Namespace indicates an expected call of Namespace

func (*MockQueryResultsMockRecorder) Reset

func (mr *MockQueryResultsMockRecorder) Reset(nsID, opts interface{}) *gomock.Call

Reset indicates an expected call of Reset

func (*MockQueryResultsMockRecorder) Size

Size indicates an expected call of Size

type MockQueryResultsPool

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

MockQueryResultsPool is a mock of QueryResultsPool interface

func NewMockQueryResultsPool

func NewMockQueryResultsPool(ctrl *gomock.Controller) *MockQueryResultsPool

NewMockQueryResultsPool creates a new mock instance

func (*MockQueryResultsPool) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockQueryResultsPool) Get

Get mocks base method

func (*MockQueryResultsPool) Init

Init mocks base method

func (*MockQueryResultsPool) Put

func (m *MockQueryResultsPool) Put(value QueryResults)

Put mocks base method

type MockQueryResultsPoolMockRecorder

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

MockQueryResultsPoolMockRecorder is the mock recorder for MockQueryResultsPool

func (*MockQueryResultsPoolMockRecorder) Get

Get indicates an expected call of Get

func (*MockQueryResultsPoolMockRecorder) Init

func (mr *MockQueryResultsPoolMockRecorder) Init(alloc interface{}) *gomock.Call

Init indicates an expected call of Init

func (*MockQueryResultsPoolMockRecorder) Put

func (mr *MockQueryResultsPoolMockRecorder) Put(value interface{}) *gomock.Call

Put indicates an expected call of Put

type MockfieldsAndTermsIterator

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

MockfieldsAndTermsIterator is a mock of fieldsAndTermsIterator interface

func NewMockfieldsAndTermsIterator

func NewMockfieldsAndTermsIterator(ctrl *gomock.Controller) *MockfieldsAndTermsIterator

NewMockfieldsAndTermsIterator creates a new mock instance

func (*MockfieldsAndTermsIterator) Close

func (m *MockfieldsAndTermsIterator) Close() error

Close mocks base method

func (*MockfieldsAndTermsIterator) Current

func (m *MockfieldsAndTermsIterator) Current() ([]byte, []byte)

Current mocks base method

func (*MockfieldsAndTermsIterator) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockfieldsAndTermsIterator) Err

Err mocks base method

func (*MockfieldsAndTermsIterator) Next

func (m *MockfieldsAndTermsIterator) Next() bool

Next mocks base method

func (*MockfieldsAndTermsIterator) Reset

func (m *MockfieldsAndTermsIterator) Reset(seg segment.Segment, opts fieldsAndTermsIteratorOpts) error

Reset mocks base method

type MockfieldsAndTermsIteratorMockRecorder

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

MockfieldsAndTermsIteratorMockRecorder is the mock recorder for MockfieldsAndTermsIterator

func (*MockfieldsAndTermsIteratorMockRecorder) Close

Close indicates an expected call of Close

func (*MockfieldsAndTermsIteratorMockRecorder) Current

Current indicates an expected call of Current

func (*MockfieldsAndTermsIteratorMockRecorder) Err

Err indicates an expected call of Err

func (*MockfieldsAndTermsIteratorMockRecorder) Next

Next indicates an expected call of Next

func (*MockfieldsAndTermsIteratorMockRecorder) Reset

func (mr *MockfieldsAndTermsIteratorMockRecorder) Reset(seg, opts interface{}) *gomock.Call

Reset indicates an expected call of Reset

type OnIndexSeries

type OnIndexSeries interface {
	// OnIndexSuccess is executed when an entry is successfully indexed. The
	// provided value for `blockStart` is the blockStart for which the write
	// was indexed.
	OnIndexSuccess(blockStart xtime.UnixNano)

	// OnIndexFinalize is executed when the index no longer holds any references
	// to the provided resources. It can be used to cleanup any resources held
	// during the course of indexing. `blockStart` is the startTime of the index
	// block for which the write was attempted.
	OnIndexFinalize(blockStart xtime.UnixNano)

	// OnIndexPrepare prepares the Entry to be handed off to the indexing sub-system.
	// NB(prateek): we retain the ref count on the entry while the indexing is pending,
	// the callback executed on the entry once the indexing is completed releases this
	// reference.
	OnIndexPrepare()

	// NeedsIndexUpdate returns a bool to indicate if the Entry needs to be indexed
	// for the provided blockStart. It only allows a single index attempt at a time
	// for a single entry.
	// NB(prateek): NeedsIndexUpdate is a CAS, i.e. when this method returns true, it
	// also sets state on the entry to indicate that a write for the given blockStart
	// is going to be sent to the index, and other go routines should not attempt the
	// same write. Callers are expected to ensure they follow this guideline.
	// Further, every call to NeedsIndexUpdate which returns true needs to have a corresponding
	// OnIndexFinalze() call. This is required for correct lifecycle maintenance.
	NeedsIndexUpdate(indexBlockStartForWrite xtime.UnixNano) bool
}

OnIndexSeries provides a set of callback hooks to allow the reverse index to do lifecycle management of any resources retained during indexing.

type Options

type Options interface {
	// Validate validates assumptions baked into the code.
	Validate() error

	// SetIndexInsertMode sets the index insert mode (sync/async).
	SetInsertMode(value InsertMode) Options

	// IndexInsertMode returns the index's insert mode (sync/async).
	InsertMode() InsertMode

	// SetClockOptions sets the clock options.
	SetClockOptions(value clock.Options) Options

	// ClockOptions returns the clock options.
	ClockOptions() clock.Options

	// SetInstrumentOptions sets the instrument options.
	SetInstrumentOptions(value instrument.Options) Options

	// InstrumentOptions returns the instrument options.
	InstrumentOptions() instrument.Options

	// SetSegmentBuilderOptions sets the mem segment options.
	SetSegmentBuilderOptions(value builder.Options) Options

	// SegmentBuilderOptions returns the mem segment options.
	SegmentBuilderOptions() builder.Options

	// SetMemSegmentOptions sets the mem segment options.
	SetMemSegmentOptions(value mem.Options) Options

	// MemSegmentOptions returns the mem segment options.
	MemSegmentOptions() mem.Options

	// SetFSTSegmentOptions sets the fst segment options.
	SetFSTSegmentOptions(value fst.Options) Options

	// FSTSegmentOptions returns the fst segment options.
	FSTSegmentOptions() fst.Options

	// SetIdentifierPool sets the identifier pool.
	SetIdentifierPool(value ident.Pool) Options

	// IdentifierPool returns the identifier pool.
	IdentifierPool() ident.Pool

	// SetCheckedBytesPool sets the checked bytes pool.
	SetCheckedBytesPool(value pool.CheckedBytesPool) Options

	// CheckedBytesPool returns the checked bytes pool.
	CheckedBytesPool() pool.CheckedBytesPool

	// SetQueryResultsPool updates the query results pool.
	SetQueryResultsPool(values QueryResultsPool) Options

	// ResultsPool returns the results pool.
	QueryResultsPool() QueryResultsPool

	// SetAggregateResultsPool updates the aggregate results pool.
	SetAggregateResultsPool(values AggregateResultsPool) Options

	// AggregateResultsPool returns the aggregate results pool.
	AggregateResultsPool() AggregateResultsPool

	// SetAggregateValuesPool updates the aggregate values pool.
	SetAggregateValuesPool(values AggregateValuesPool) Options

	// AggregateValuesPool returns the aggregate values pool.
	AggregateValuesPool() AggregateValuesPool

	// SetDocumentArrayPool sets the document array pool.
	SetDocumentArrayPool(value doc.DocumentArrayPool) Options

	// DocumentArrayPool returns the document array pool.
	DocumentArrayPool() doc.DocumentArrayPool

	// SetAggregateResultsEntryArrayPool sets the aggregate results entry array pool.
	SetAggregateResultsEntryArrayPool(value AggregateResultsEntryArrayPool) Options

	// AggregateResultsEntryArrayPool returns the aggregate results entry array pool.
	AggregateResultsEntryArrayPool() AggregateResultsEntryArrayPool

	// SetForegroundCompactionPlannerOptions sets the compaction planner options.
	SetForegroundCompactionPlannerOptions(v compaction.PlannerOptions) Options

	// ForegroundCompactionPlannerOptions returns the compaction planner options.
	ForegroundCompactionPlannerOptions() compaction.PlannerOptions

	// SetBackgroundCompactionPlannerOptions sets the compaction planner options.
	SetBackgroundCompactionPlannerOptions(v compaction.PlannerOptions) Options

	// BackgroundCompactionPlannerOptions returns the compaction planner options.
	BackgroundCompactionPlannerOptions() compaction.PlannerOptions

	// SetPostingsListCache sets the postings list cache.
	SetPostingsListCache(value *PostingsListCache) Options

	// PostingsListCache returns the postings list cache.
	PostingsListCache() *PostingsListCache

	// SetReadThroughSegmentOptions sets the read through segment cache options.
	SetReadThroughSegmentOptions(value ReadThroughSegmentOptions) Options

	// ReadThroughSegmentOptions returns the read through segment cache options.
	ReadThroughSegmentOptions() ReadThroughSegmentOptions

	// SetForwardIndexProbability sets the probability chance for forward writes.
	SetForwardIndexProbability(value float64) Options

	// ForwardIndexProbability returns the probability chance for forward writes.
	ForwardIndexProbability() float64

	// SetForwardIndexProbability sets the threshold for forward writes as a
	// fraction of the bufferFuture.
	SetForwardIndexThreshold(value float64) Options

	// ForwardIndexProbability returns the threshold for forward writes.
	ForwardIndexThreshold() float64
}

Options control the Indexing knobs.

func NewOptions

func NewOptions() Options

NewOptions returns a new Options object with default properties.

type PatternType

type PatternType int

PatternType is an enum for the various pattern types. It allows us separate them logically within the cache.

const (
	// PatternTypeRegexp indicates that the pattern is of type regexp.
	PatternTypeRegexp PatternType = iota
	// PatternTypeTerm indicates that the pattern is of type term.
	PatternTypeTerm
	// PatternTypeField indicates that the pattern is of type field.
	PatternTypeField
)

type PostingsListCache

type PostingsListCache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PostingsListCache implements an LRU for caching queries and their results.

func (*PostingsListCache) GetField

func (q *PostingsListCache) GetField(
	segmentUUID uuid.UUID,
	field string,
) (postings.List, bool)

GetField returns the cached results for the provided field query, if any.

func (*PostingsListCache) GetRegexp

func (q *PostingsListCache) GetRegexp(
	segmentUUID uuid.UUID,
	field string,
	pattern string,
) (postings.List, bool)

GetRegexp returns the cached results for the provided regexp query, if any.

func (*PostingsListCache) GetTerm

func (q *PostingsListCache) GetTerm(
	segmentUUID uuid.UUID,
	field string,
	pattern string,
) (postings.List, bool)

GetTerm returns the cached results for the provided term query, if any.

func (*PostingsListCache) PurgeSegment

func (q *PostingsListCache) PurgeSegment(segmentUUID uuid.UUID)

PurgeSegment removes all postings lists associated with the specified segment from the cache.

func (*PostingsListCache) PutField

func (q *PostingsListCache) PutField(
	segmentUUID uuid.UUID,
	field string,
	pl postings.List,
)

PutField updates the LRU with the result of the field query.

func (*PostingsListCache) PutRegexp

func (q *PostingsListCache) PutRegexp(
	segmentUUID uuid.UUID,
	field string,
	pattern string,
	pl postings.List,
)

PutRegexp updates the LRU with the result of the regexp query.

func (*PostingsListCache) PutTerm

func (q *PostingsListCache) PutTerm(
	segmentUUID uuid.UUID,
	field string,
	pattern string,
	pl postings.List,
)

PutTerm updates the LRU with the result of the term query.

func (*PostingsListCache) Report

func (q *PostingsListCache) Report()

Report will emit metrics about the status of the cache.

type PostingsListCacheOptions

type PostingsListCacheOptions struct {
	InstrumentOptions instrument.Options
}

PostingsListCacheOptions is the options struct for the query cache.

type Query

type Query struct {
	idx.Query
}

Query is a rich end user query to describe a set of constraints on required IDs.

type QueryMatcher

type QueryMatcher interface {
	gomock.Matcher
}

QueryMatcher is a gomock.Matcher that matches index.Query

func NewQueryMatcher

func NewQueryMatcher(q Query) QueryMatcher

NewQueryMatcher returns a new QueryMatcher

type QueryOptions

type QueryOptions struct {
	StartInclusive time.Time
	EndExclusive   time.Time
	Limit          int
}

QueryOptions enables users to specify constraints on query execution.

func (QueryOptions) LimitExceeded

func (o QueryOptions) LimitExceeded(size int) bool

LimitExceeded returns whether a given size exceeds the limit the query options imposes, if it is enabled.

type QueryResult

type QueryResult struct {
	Results    QueryResults
	Exhaustive bool
}

QueryResult is the collection of results for a query.

type QueryResults

type QueryResults interface {
	BaseResults

	// Reset resets the Results object to initial state.
	Reset(nsID ident.ID, opts QueryResultsOptions)

	// Map returns the results map from seriesID -> seriesTags, comprising
	// index results.
	// Since a lock is not held when accessing the map after a call to this
	// method, it is unsafe to read or write to the map if any other caller
	// mutates the state of the results after obtaining a reference to the map
	// with this call.
	Map() *ResultsMap
}

QueryResults is a collection of results for a query, it is synchronized when access to the results set is used as documented by the methods.

func NewQueryResults

func NewQueryResults(
	namespaceID ident.ID,
	opts QueryResultsOptions,
	indexOpts Options,
) QueryResults

NewQueryResults returns a new query results object.

type QueryResultsAllocator

type QueryResultsAllocator func() QueryResults

QueryResultsAllocator allocates QueryResults types.

type QueryResultsOptions

type QueryResultsOptions struct {
	// SizeLimit will limit the total results set to a given limit and if
	// overflown will return early successfully.
	SizeLimit int

	// FilterID, if provided, can be used to filter out unwanted IDs from
	// the query results.
	// NB(r): This is used to filter out results from shards the DB node
	// node no longer owns but is still included in index segments.
	FilterID func(id ident.ID) bool
}

QueryResultsOptions is a set of options to use for query results.

type QueryResultsPool

type QueryResultsPool interface {
	// Init initializes the QueryResults pool.
	Init(alloc QueryResultsAllocator)

	// Get retrieves a QueryResults object for use.
	Get() QueryResults

	// Put returns the provided QueryResults to the pool.
	Put(value QueryResults)
}

QueryResultsPool allows users to pool `Results` types.

func NewQueryResultsPool

func NewQueryResultsPool(opts pool.ObjectPoolOptions) QueryResultsPool

NewQueryResultsPool creates a new QueryResultsPool.

type ReadThroughSegment

type ReadThroughSegment struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ReadThroughSegment wraps a segment with a postings list cache so that queries can be transparently cached in a read through manner. In addition, the postings lists returned by the segments may not be safe to use once the underlying segments are closed due to the postings lists pointing into the segments mmap'd region. As a result, the close method of the ReadThroughSegment will make sure that the cache is purged of all the segments postings lists before the segment itself is closed.

func (*ReadThroughSegment) Close

func (r *ReadThroughSegment) Close() error

Close purges all entries in the cache associated with this segment, and then closes the underlying segment.

func (*ReadThroughSegment) ContainsField

func (r *ReadThroughSegment) ContainsField(field []byte) (bool, error)

ContainsField is a pass through call to the segment, since there's no postings lists to cache for queries.

func (*ReadThroughSegment) ContainsID

func (r *ReadThroughSegment) ContainsID(id []byte) (bool, error)

ContainsID is a pass through call to the segment, since there's no postings lists to cache for queries.

func (*ReadThroughSegment) FieldsIterable

func (r *ReadThroughSegment) FieldsIterable() segment.FieldsIterable

FieldsIterable is a pass through call to the segment, since there's no postings lists to cache for queries.

func (*ReadThroughSegment) Reader

func (r *ReadThroughSegment) Reader() (index.Reader, error)

Reader returns a read through reader for the read through segment.

func (*ReadThroughSegment) Size

func (r *ReadThroughSegment) Size() int64

Size is a pass through call to the segment, since there's no postings lists to cache for queries.

func (*ReadThroughSegment) TermsIterable

func (r *ReadThroughSegment) TermsIterable() segment.TermsIterable

TermsIterable is a pass through call to the segment, since there's no postings lists to cache for queries.

type ReadThroughSegmentOptions

type ReadThroughSegmentOptions struct {
	// Whether the postings list for regexp queries should be cached.
	CacheRegexp bool
	// Whether the postings list for term queries should be cached.
	CacheTerms bool
}

ReadThroughSegmentOptions is the options struct for the ReadThroughSegment.

type ResultsMap

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

ResultsMap uses the genny package to provide a generic hash map that can be specialized by running the following command from this root of the repository: ``` make hashmap-gen pkg=outpkg key_type=Type value_type=Type out_dir=/tmp ``` Or if you would like to use bytes or ident.ID as keys you can use the partially specialized maps to generate your own maps as well: ``` make byteshashmap-gen pkg=outpkg value_type=Type out_dir=/tmp make idhashmap-gen pkg=outpkg value_type=Type out_dir=/tmp ``` This will output to stdout the generated source file to use for your map. It uses linear probing by incrementing the number of the hash created when hashing the identifier if there is a collision. ResultsMap is a value type and not an interface to allow for less painful upgrades when adding/removing methods, it is not likely to need mocking so an interface would not be super useful either.

func (*ResultsMap) Contains

func (m *ResultsMap) Contains(k ident.ID) bool

Contains returns true if value exists for key, false otherwise, it is shorthand for a call to Get that doesn't return the value.

func (*ResultsMap) Delete

func (m *ResultsMap) Delete(k ident.ID)

Delete will remove a value set in the map for the specified key.

func (*ResultsMap) Get

func (m *ResultsMap) Get(k ident.ID) (ident.TagIterator, bool)

Get returns a value in the map for an identifier if found.

func (*ResultsMap) Iter

Iter provides the underlying map to allow for using a native Go for loop to iterate the map, however callers should only ever read and not write the map.

func (*ResultsMap) Len

func (m *ResultsMap) Len() int

Len returns the number of map entries in the map.

func (*ResultsMap) Reallocate

func (m *ResultsMap) Reallocate()

Reallocate will avoid deleting all keys and reallocate a new map, this is useful if you believe you have a large map and will not need to grow back to a similar size.

func (*ResultsMap) Reset

func (m *ResultsMap) Reset()

Reset will reset the map by simply deleting all keys to avoid allocating a new map.

func (*ResultsMap) Set

func (m *ResultsMap) Set(k ident.ID, v ident.TagIterator)

Set will set the value for an identifier.

func (*ResultsMap) SetUnsafe

SetUnsafe will set the value for an identifier with unsafe options for how the map treats the key.

type ResultsMapCopyFn

type ResultsMapCopyFn func(ident.ID) ident.ID

ResultsMapCopyFn is the copy key function to execute when copying the key.

type ResultsMapEntry

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

ResultsMapEntry is an entry in the map, this is public to support iterating over the map using a native Go for loop.

func (ResultsMapEntry) Key

func (e ResultsMapEntry) Key() ident.ID

Key returns the map entry key.

func (ResultsMapEntry) Value

func (e ResultsMapEntry) Value() ident.TagIterator

Value returns the map entry value.

type ResultsMapEqualsFn

type ResultsMapEqualsFn func(ident.ID, ident.ID) bool

ResultsMapEqualsFn is the equals key function to execute when detecting equality of a key.

type ResultsMapFinalizeFn

type ResultsMapFinalizeFn func(ident.ID)

ResultsMapFinalizeFn is the finalize key function to execute when finished with a key.

type ResultsMapHash

type ResultsMapHash uint64

ResultsMapHash is the hash for a given map entry, this is public to support iterating over the map using a native Go for loop.

type ResultsMapHashFn

type ResultsMapHashFn func(ident.ID) ResultsMapHash

ResultsMapHashFn is the hash function to execute when hashing a key.

type ResultsMapSetUnsafeOptions

type ResultsMapSetUnsafeOptions struct {
	NoCopyKey     bool
	NoFinalizeKey bool
}

ResultsMapSetUnsafeOptions is a set of options to use when setting a value with the SetUnsafe method.

type WriteBatch

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

WriteBatch is a batch type that allows for building of a slice of documents with metadata in a separate slice, this allows the documents slice to be passed to the segment to batch insert without having to copy into a buffer again.

func NewWriteBatch

func NewWriteBatch(opts WriteBatchOptions) *WriteBatch

NewWriteBatch creates a new write batch.

func (*WriteBatch) Append

func (b *WriteBatch) Append(
	entry WriteBatchEntry,
	doc doc.Document,
)

Append appends an entry with accompanying document.

func (*WriteBatch) AppendAll

func (b *WriteBatch) AppendAll(from *WriteBatch)

AppendAll appends all entries from another batch to this batch and ensures they share the same result struct.

func (*WriteBatch) ForEach

func (b *WriteBatch) ForEach(fn ForEachWriteBatchEntryFn)

ForEach allows a caller to perform an operation for each batch entry.

func (*WriteBatch) ForEachUnmarkedBatchByBlockStart

func (b *WriteBatch) ForEachUnmarkedBatchByBlockStart(
	fn ForEachWriteBatchByBlockStartFn,
)

ForEachUnmarkedBatchByBlockStart allows a caller to perform an operation with reference to a restricted set of the write batch for each unique block start for entries that have not been marked completed yet. The underlying batch returned is simply the current batch but with updated subslices to the relevant entries and documents that are restored at the end of `fn` being applied. NOTE: This means `fn` cannot perform any asynchronous work that uses the arguments passed to it as the args will be invalid at the synchronous execution of `fn`.

func (*WriteBatch) Len

func (b *WriteBatch) Len() int

Len returns the length of the batch.

func (*WriteBatch) Less

func (b *WriteBatch) Less(i, j int) bool

Less returns whether an entry appears before another depending on the type of sort.

func (*WriteBatch) MarkUnmarkedEntriesError

func (b *WriteBatch) MarkUnmarkedEntriesError(err error)

MarkUnmarkedEntriesError marks all unmarked entries as error.

func (*WriteBatch) MarkUnmarkedEntriesSuccess

func (b *WriteBatch) MarkUnmarkedEntriesSuccess()

MarkUnmarkedEntriesSuccess marks all unmarked entries as success.

func (*WriteBatch) MarkUnmarkedEntryError

func (b *WriteBatch) MarkUnmarkedEntryError(
	err error,
	idx int,
)

MarkUnmarkedEntryError marks an unmarked entry at index as error.

func (*WriteBatch) NumErrs

func (b *WriteBatch) NumErrs() int

NumErrs returns the number of errors encountered by the batch.

func (*WriteBatch) Options

func (b *WriteBatch) Options() WriteBatchOptions

Options returns the WriteBatchOptions for this batch.

func (*WriteBatch) PendingDocs

func (b *WriteBatch) PendingDocs() []doc.Document

PendingDocs returns all the docs in this batch that are unmarked.

func (*WriteBatch) PendingEntries

func (b *WriteBatch) PendingEntries() []WriteBatchEntry

PendingEntries returns all the entries in this batch that are unmarked.

func (*WriteBatch) Reset

func (b *WriteBatch) Reset()

Reset resets the batch for use.

func (*WriteBatch) SortByEnqueued

func (b *WriteBatch) SortByEnqueued()

SortByEnqueued sorts the entries and documents back to the sort order they were enqueued as.

func (*WriteBatch) SortByUnmarkedAndIndexBlockStart

func (b *WriteBatch) SortByUnmarkedAndIndexBlockStart()

SortByUnmarkedAndIndexBlockStart sorts the batch by unmarked first and then by index block start time.

func (*WriteBatch) Swap

func (b *WriteBatch) Swap(i, j int)

Swap will swap two entries and the corresponding docs.

type WriteBatchEntry

type WriteBatchEntry struct {
	// Timestamp is the timestamp that this entry should be indexed for
	Timestamp time.Time
	// OnIndexSeries is a listener/callback for when this entry is marked done
	// it is set to nil when the entry is marked done
	OnIndexSeries OnIndexSeries
	// EnqueuedAt is the timestamp that this entry was enqueued for indexing
	// so that we can calculate the latency it takes to index the entry
	EnqueuedAt time.Time
	// contains filtered or unexported fields
}

WriteBatchEntry represents the metadata accompanying the document that is being inserted.

func (WriteBatchEntry) Result

Result returns the result for this entry.

type WriteBatchEntryResult

type WriteBatchEntryResult struct {
	Done bool
	Err  error
}

WriteBatchEntryResult represents a result.

type WriteBatchOptions

type WriteBatchOptions struct {
	InitialCapacity int
	IndexBlockSize  time.Duration
}

WriteBatchOptions is a set of options required for a write batch.

type WriteBatchResult

type WriteBatchResult struct {
	NumSuccess int64
	NumError   int64
}

WriteBatchResult returns statistics about the WriteBatch execution.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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