Documentation ¶
Overview ¶
Package index is a generated GoMock package.
Index ¶
- Variables
- func NewBootstrapResultMutableSegmentAllocator(opts Options) result.MutableSegmentAllocator
- func NewPostingsListCache(size int, opts PostingsListCacheOptions) (*PostingsListCache, Closer, error)
- func NewReadThroughSegment(seg segment.Segment, cache *PostingsListCache, opts ReadThroughSegmentOptions) segment.Segment
- type AggregateQueryResult
- type AggregateResults
- type AggregateResultsAllocator
- type AggregateResultsMap
- func (m *AggregateResultsMap) Contains(k ident.ID) bool
- func (m *AggregateResultsMap) Delete(k ident.ID)
- func (m *AggregateResultsMap) Get(k ident.ID) (AggregateValues, bool)
- func (m *AggregateResultsMap) Iter() map[AggregateResultsMapHash]AggregateResultsMapEntry
- func (m *AggregateResultsMap) Len() int
- func (m *AggregateResultsMap) Reallocate()
- func (m *AggregateResultsMap) Reset()
- func (m *AggregateResultsMap) Set(k ident.ID, v AggregateValues)
- func (m *AggregateResultsMap) SetUnsafe(k ident.ID, v AggregateValues, opts AggregateResultsMapSetUnsafeOptions)
- type AggregateResultsMapCopyFn
- type AggregateResultsMapEntry
- type AggregateResultsMapEqualsFn
- type AggregateResultsMapFinalizeFn
- type AggregateResultsMapHash
- type AggregateResultsMapHashFn
- type AggregateResultsMapSetUnsafeOptions
- type AggregateResultsOptions
- type AggregateResultsPool
- type AggregateTermFilter
- type AggregateValues
- type AggregateValuesAllocator
- type AggregateValuesMap
- func (m *AggregateValuesMap) Contains(k ident.ID) bool
- func (m *AggregateValuesMap) Delete(k ident.ID)
- func (m *AggregateValuesMap) Get(k ident.ID) (struct{}, bool)
- func (m *AggregateValuesMap) Iter() map[AggregateValuesMapHash]AggregateValuesMapEntry
- func (m *AggregateValuesMap) Len() int
- func (m *AggregateValuesMap) Reallocate()
- func (m *AggregateValuesMap) Reset()
- func (m *AggregateValuesMap) Set(k ident.ID, v struct{})
- func (m *AggregateValuesMap) SetUnsafe(k ident.ID, v struct{}, opts AggregateValuesMapSetUnsafeOptions)
- type AggregateValuesMapCopyFn
- type AggregateValuesMapEntry
- type AggregateValuesMapEqualsFn
- type AggregateValuesMapFinalizeFn
- type AggregateValuesMapHash
- type AggregateValuesMapHashFn
- type AggregateValuesMapSetUnsafeOptions
- type AggregateValuesPool
- type AggregationOptions
- type AggregationType
- type BaseResults
- type Block
- type BlockOptions
- type BlockSegmentStats
- type BlockSegmentType
- type BlockStatsReporter
- type BlockStatsReporterFn
- type BlockTickResult
- type Closer
- type EvictMutableSegmentResults
- type ForEachWriteBatchByBlockStartFn
- type ForEachWriteBatchEntryFn
- type InsertMode
- type MockAggregateResults
- func (m *MockAggregateResults) AddDocuments(arg0 []doc.Document) (int, error)
- func (m *MockAggregateResults) EXPECT() *MockAggregateResultsMockRecorder
- func (m *MockAggregateResults) Finalize()
- func (m *MockAggregateResults) Map() *AggregateResultsMap
- func (m *MockAggregateResults) Namespace() ident.ID
- func (m *MockAggregateResults) Reset(arg0 ident.ID, arg1 AggregateResultsOptions)
- func (m *MockAggregateResults) Size() int
- type MockAggregateResultsMockRecorder
- func (mr *MockAggregateResultsMockRecorder) AddDocuments(arg0 interface{}) *gomock.Call
- func (mr *MockAggregateResultsMockRecorder) Finalize() *gomock.Call
- func (mr *MockAggregateResultsMockRecorder) Map() *gomock.Call
- func (mr *MockAggregateResultsMockRecorder) Namespace() *gomock.Call
- func (mr *MockAggregateResultsMockRecorder) Reset(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockAggregateResultsMockRecorder) Size() *gomock.Call
- type MockBlock
- func (m *MockBlock) AddResults(arg0 result.IndexBlock) error
- func (m *MockBlock) Close() error
- func (m *MockBlock) EXPECT() *MockBlockMockRecorder
- func (m *MockBlock) EndTime() time.Time
- func (m *MockBlock) EvictMutableSegments() error
- func (m *MockBlock) IsSealed() bool
- func (m *MockBlock) NeedsMutableSegmentsEvicted() bool
- func (m *MockBlock) Query(arg0 *resource.CancellableLifetime, arg1 Query, arg2 QueryOptions, ...) (bool, error)
- func (m *MockBlock) Seal() error
- func (m *MockBlock) StartTime() time.Time
- func (m *MockBlock) Stats(arg0 BlockStatsReporter) error
- func (m *MockBlock) Tick(arg0 context.Cancellable, arg1 time.Time) (BlockTickResult, error)
- func (m *MockBlock) WriteBatch(arg0 *WriteBatch) (WriteBatchResult, error)
- type MockBlockMockRecorder
- func (mr *MockBlockMockRecorder) AddResults(arg0 interface{}) *gomock.Call
- func (mr *MockBlockMockRecorder) Close() *gomock.Call
- func (mr *MockBlockMockRecorder) EndTime() *gomock.Call
- func (mr *MockBlockMockRecorder) EvictMutableSegments() *gomock.Call
- func (mr *MockBlockMockRecorder) IsSealed() *gomock.Call
- func (mr *MockBlockMockRecorder) NeedsMutableSegmentsEvicted() *gomock.Call
- func (mr *MockBlockMockRecorder) Query(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockBlockMockRecorder) Seal() *gomock.Call
- func (mr *MockBlockMockRecorder) StartTime() *gomock.Call
- func (mr *MockBlockMockRecorder) Stats(arg0 interface{}) *gomock.Call
- func (mr *MockBlockMockRecorder) Tick(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockBlockMockRecorder) WriteBatch(arg0 interface{}) *gomock.Call
- type MockOnIndexSeries
- type MockOnIndexSeriesMockRecorder
- type MockQueryResults
- func (m *MockQueryResults) AddDocuments(arg0 []doc.Document) (int, error)
- func (m *MockQueryResults) EXPECT() *MockQueryResultsMockRecorder
- func (m *MockQueryResults) Finalize()
- func (m *MockQueryResults) Map() *ResultsMap
- func (m *MockQueryResults) Namespace() ident.ID
- func (m *MockQueryResults) NoFinalize()
- func (m *MockQueryResults) Reset(arg0 ident.ID, arg1 QueryResultsOptions)
- func (m *MockQueryResults) Size() int
- type MockQueryResultsMockRecorder
- func (mr *MockQueryResultsMockRecorder) AddDocuments(arg0 interface{}) *gomock.Call
- func (mr *MockQueryResultsMockRecorder) Finalize() *gomock.Call
- func (mr *MockQueryResultsMockRecorder) Map() *gomock.Call
- func (mr *MockQueryResultsMockRecorder) Namespace() *gomock.Call
- func (mr *MockQueryResultsMockRecorder) NoFinalize() *gomock.Call
- func (mr *MockQueryResultsMockRecorder) Reset(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockQueryResultsMockRecorder) Size() *gomock.Call
- type OnIndexSeries
- type Options
- type PatternType
- type PostingsListCache
- func (q *PostingsListCache) GetRegexp(segmentUUID uuid.UUID, field string, pattern string) (postings.List, bool)
- func (q *PostingsListCache) GetTerm(segmentUUID uuid.UUID, field string, pattern string) (postings.List, bool)
- func (q *PostingsListCache) PurgeSegment(segmentUUID uuid.UUID)
- func (q *PostingsListCache) PutRegexp(segmentUUID uuid.UUID, field string, pattern string, pl postings.List)
- func (q *PostingsListCache) PutTerm(segmentUUID uuid.UUID, field string, pattern string, pl postings.List)
- func (q *PostingsListCache) Report()
- type PostingsListCacheOptions
- type Query
- type QueryMatcher
- type QueryOptions
- type QueryResult
- type QueryResults
- type QueryResultsAllocator
- type QueryResultsOptions
- type QueryResultsPool
- type ReadThroughSegment
- func (r *ReadThroughSegment) Close() error
- func (r *ReadThroughSegment) ContainsID(id []byte) (bool, error)
- func (r *ReadThroughSegment) FieldsIterable() segment.FieldsIterable
- func (r *ReadThroughSegment) Reader() (index.Reader, error)
- func (r *ReadThroughSegment) Size() int64
- func (r *ReadThroughSegment) TermsIterable() segment.TermsIterable
- type ReadThroughSegmentOptions
- type ResultsMap
- func (m *ResultsMap) Contains(k ident.ID) bool
- func (m *ResultsMap) Delete(k ident.ID)
- func (m *ResultsMap) Get(k ident.ID) (ident.Tags, bool)
- func (m *ResultsMap) Iter() map[ResultsMapHash]ResultsMapEntry
- func (m *ResultsMap) Len() int
- func (m *ResultsMap) Reallocate()
- func (m *ResultsMap) Reset()
- func (m *ResultsMap) Set(k ident.ID, v ident.Tags)
- func (m *ResultsMap) SetUnsafe(k ident.ID, v ident.Tags, opts ResultsMapSetUnsafeOptions)
- type ResultsMapCopyFn
- type ResultsMapEntry
- type ResultsMapEqualsFn
- type ResultsMapFinalizeFn
- type ResultsMapHash
- type ResultsMapHashFn
- type ResultsMapSetUnsafeOptions
- type WriteBatch
- func (b *WriteBatch) Append(entry WriteBatchEntry, doc doc.Document)
- func (b *WriteBatch) AppendAll(from *WriteBatch)
- func (b *WriteBatch) ForEach(fn ForEachWriteBatchEntryFn)
- func (b *WriteBatch) ForEachUnmarkedBatchByBlockStart(fn ForEachWriteBatchByBlockStartFn)
- func (b *WriteBatch) Len() int
- func (b *WriteBatch) Less(i, j int) bool
- func (b *WriteBatch) MarkUnmarkedEntriesError(err error)
- func (b *WriteBatch) MarkUnmarkedEntriesSuccess()
- func (b *WriteBatch) MarkUnmarkedEntryError(err error, idx int)
- func (b *WriteBatch) NumErrs() int
- func (b *WriteBatch) PendingDocs() []doc.Document
- func (b *WriteBatch) PendingEntries() []WriteBatchEntry
- func (b *WriteBatch) Reset()
- func (b *WriteBatch) SortByEnqueued()
- func (b *WriteBatch) SortByUnmarkedAndIndexBlockStart()
- func (b *WriteBatch) Swap(i, j int)
- type WriteBatchEntry
- type WriteBatchEntryResult
- type WriteBatchOptions
- type WriteBatchResult
Constants ¶
This section is empty.
Variables ¶
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") )
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 ¶ added in v0.6.0
func NewPostingsListCache(size int, opts PostingsListCacheOptions) (*PostingsListCache, Closer, error)
NewPostingsListCache creates a new query cache.
func NewReadThroughSegment ¶ added in v0.6.0
func NewReadThroughSegment( seg segment.Segment, cache *PostingsListCache, opts ReadThroughSegmentOptions, ) segment.Segment
NewReadThroughSegment creates a new read through segment.
Types ¶
type AggregateQueryResult ¶ added in v0.8.0
type AggregateQueryResult struct { Results AggregateResults Exhaustive bool }
AggregateQueryResult is the collection of results for an aggregate query.
type AggregateResults ¶ added in v0.8.0
type AggregateResults interface { BaseResults // Reset resets the AggregateResults object to initial state. Reset( nsID ident.ID, aggregateQueryOpts AggregateResultsOptions, ) // 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 ¶ added in v0.8.0
func NewAggregateResults( namespaceID ident.ID, aggregateOpts AggregateResultsOptions, opts Options, ) AggregateResults
NewAggregateResults returns a new AggregateResults object.
type AggregateResultsAllocator ¶ added in v0.8.0
type AggregateResultsAllocator func() AggregateResults
AggregateResultsAllocator allocates AggregateResults types.
type AggregateResultsMap ¶ added in v0.8.0
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 ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (m *AggregateResultsMap) Delete(k ident.ID)
Delete will remove a value set in the map for the specified key.
func (*AggregateResultsMap) Get ¶ added in v0.8.0
func (m *AggregateResultsMap) Get(k ident.ID) (AggregateValues, bool)
Get returns a value in the map for an identifier if found.
func (*AggregateResultsMap) Iter ¶ added in v0.8.0
func (m *AggregateResultsMap) Iter() map[AggregateResultsMapHash]AggregateResultsMapEntry
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 ¶ added in v0.8.0
func (m *AggregateResultsMap) Len() int
Len returns the number of map entries in the map.
func (*AggregateResultsMap) Reallocate ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (m *AggregateResultsMap) Reset()
Reset will reset the map by simply deleting all keys to avoid allocating a new map.
func (*AggregateResultsMap) Set ¶ added in v0.8.0
func (m *AggregateResultsMap) Set(k ident.ID, v AggregateValues)
Set will set the value for an identifier.
func (*AggregateResultsMap) SetUnsafe ¶ added in v0.8.0
func (m *AggregateResultsMap) SetUnsafe(k ident.ID, v AggregateValues, opts AggregateResultsMapSetUnsafeOptions)
SetUnsafe will set the value for an identifier with unsafe options for how the map treats the key.
type AggregateResultsMapCopyFn ¶ added in v0.8.0
AggregateResultsMapCopyFn is the copy key function to execute when copying the key.
type AggregateResultsMapEntry ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (e AggregateResultsMapEntry) Key() ident.ID
Key returns the map entry key.
func (AggregateResultsMapEntry) Value ¶ added in v0.8.0
func (e AggregateResultsMapEntry) Value() AggregateValues
Value returns the map entry value.
type AggregateResultsMapEqualsFn ¶ added in v0.8.0
AggregateResultsMapEqualsFn is the equals key function to execute when detecting equality of a key.
type AggregateResultsMapFinalizeFn ¶ added in v0.8.0
AggregateResultsMapFinalizeFn is the finalize key function to execute when finished with a key.
type AggregateResultsMapHash ¶ added in v0.8.0
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 ¶ added in v0.8.0
type AggregateResultsMapHashFn func(ident.ID) AggregateResultsMapHash
AggregateResultsMapHashFn is the hash function to execute when hashing a key.
type AggregateResultsMapSetUnsafeOptions ¶ added in v0.8.0
AggregateResultsMapSetUnsafeOptions is a set of options to use when setting a value with the SetUnsafe method.
type AggregateResultsOptions ¶ added in v0.8.0
type AggregateResultsOptions struct { // SizeLimit will limit the total results set to a given limit and if // overflown will return early successfully. SizeLimit int // Optional param to filter aggregate values. TermFilter AggregateTermFilter // Type determines what result is required. Type AggregationType }
AggregateResultsOptions is a set of options to use for results.
type AggregateResultsPool ¶ added in v0.8.0
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 ¶ added in v0.8.0
func NewAggregateResultsPool( opts pool.ObjectPoolOptions) AggregateResultsPool
NewAggregateResultsPool creates a new AggregateResultsPool.
type AggregateTermFilter ¶ added in v0.8.0
type AggregateTermFilter [][]byte
AggregateTermFilter dictates which fields will appear in the aggregated result; if filter values exist, only those whose term matches a value in the filter are returned.
func (AggregateTermFilter) Allow ¶ added in v0.8.0
func (f AggregateTermFilter) Allow(term []byte) bool
Allow returns true if the given term satisfies the filter.
type AggregateValues ¶ added in v0.8.0
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 ¶ added in v0.8.0
func MustNewAggregateValues(opts Options, ids ...ident.ID) AggregateValues
MustNewAggregateValues returns a new AggregateValues object with provided idents added in.
func NewAggregateValues ¶ added in v0.8.0
func NewAggregateValues(opts Options) AggregateValues
NewAggregateValues returns a new AggregateValues object.
func (*AggregateValues) Map ¶ added in v0.8.0
func (v *AggregateValues) Map() *AggregateValuesMap
Map returns a map from an ID -> empty struct to signify existence of the ID in the set this structure represents.
func (*AggregateValues) Size ¶ added in v0.8.0
func (v *AggregateValues) Size() int
Size returns the number of IDs tracked.
type AggregateValuesAllocator ¶ added in v0.8.0
type AggregateValuesAllocator func() AggregateValues
AggregateValuesAllocator allocates AggregateValues types.
type AggregateValuesMap ¶ added in v0.8.0
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 ¶ added in v0.8.0
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 ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (m *AggregateValuesMap) Delete(k ident.ID)
Delete will remove a value set in the map for the specified key.
func (*AggregateValuesMap) Get ¶ added in v0.8.0
func (m *AggregateValuesMap) Get(k ident.ID) (struct{}, bool)
Get returns a value in the map for an identifier if found.
func (*AggregateValuesMap) Iter ¶ added in v0.8.0
func (m *AggregateValuesMap) Iter() map[AggregateValuesMapHash]AggregateValuesMapEntry
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 ¶ added in v0.8.0
func (m *AggregateValuesMap) Len() int
Len returns the number of map entries in the map.
func (*AggregateValuesMap) Reallocate ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (m *AggregateValuesMap) Reset()
Reset will reset the map by simply deleting all keys to avoid allocating a new map.
func (*AggregateValuesMap) Set ¶ added in v0.8.0
func (m *AggregateValuesMap) Set(k ident.ID, v struct{})
Set will set the value for an identifier.
func (*AggregateValuesMap) SetUnsafe ¶ added in v0.8.0
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 ¶ added in v0.8.0
AggregateValuesMapCopyFn is the copy key function to execute when copying the key.
type AggregateValuesMapEntry ¶ added in v0.8.0
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 ¶ added in v0.8.0
func (e AggregateValuesMapEntry) Key() ident.ID
Key returns the map entry key.
func (AggregateValuesMapEntry) Value ¶ added in v0.8.0
func (e AggregateValuesMapEntry) Value() struct{}
Value returns the map entry value.
type AggregateValuesMapEqualsFn ¶ added in v0.8.0
AggregateValuesMapEqualsFn is the equals key function to execute when detecting equality of a key.
type AggregateValuesMapFinalizeFn ¶ added in v0.8.0
AggregateValuesMapFinalizeFn is the finalize key function to execute when finished with a key.
type AggregateValuesMapHash ¶ added in v0.8.0
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 ¶ added in v0.8.0
type AggregateValuesMapHashFn func(ident.ID) AggregateValuesMapHash
AggregateValuesMapHashFn is the hash function to execute when hashing a key.
type AggregateValuesMapSetUnsafeOptions ¶ added in v0.8.0
AggregateValuesMapSetUnsafeOptions is a set of options to use when setting a value with the SetUnsafe method.
type AggregateValuesPool ¶ added in v0.8.0
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 ¶ added in v0.8.0
func NewAggregateValuesPool( opts pool.ObjectPoolOptions) AggregateValuesPool
NewAggregateValuesPool creates a new AggregateValuesPool.
type AggregationOptions ¶ added in v0.8.0
type AggregationOptions struct { QueryOptions TermFilter AggregateTermFilter Type AggregationType }
AggregationOptions enables users to specify constraints on aggregations.
type AggregationType ¶ added in v0.8.0
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 ¶ added in v0.8.0
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( cancellable *resource.CancellableLifetime, query Query, opts QueryOptions, results BaseResults, ) (exhaustive bool, err error) // AddResults adds bootstrap results to the block, if c. AddResults(results result.IndexBlock) error // Tick does internal house keeping operations. Tick(c context.Cancellable, tickStart time.Time) (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).
type BlockOptions ¶ added in v0.7.3
type BlockOptions struct { ForegroundCompactorMmapDocsData bool BackgroundCompactorMmapDocsData bool }
BlockOptions is a set of options used when constructing an index block.
type BlockSegmentStats ¶ added in v0.5.0
type BlockSegmentStats struct { Type BlockSegmentType Mutable bool Age time.Duration Size int64 }
BlockSegmentStats has segment stats.
type BlockSegmentType ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 ¶ added in v0.5.0
type BlockStatsReporterFn func(stats BlockSegmentStats)
BlockStatsReporterFn implements the block stats reporter using a callback function.
func (BlockStatsReporterFn) ReportSegmentStats ¶ added in v0.5.0
func (f BlockStatsReporterFn) ReportSegmentStats(stats BlockSegmentStats)
ReportSegmentStats implements the BlockStatsReporter interface.
type BlockTickResult ¶
BlockTickResult returns statistics about tick.
type Closer ¶ added in v0.6.0
type Closer func()
Closer represents a function that will close managed resources.
type EvictMutableSegmentResults ¶
EvictMutableSegmentResults returns statistics about the EvictMutableSegments execution.
func (*EvictMutableSegmentResults) Add ¶
func (e *EvictMutableSegmentResults) Add(o EvictMutableSegmentResults)
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 ¶ added in v0.8.0
type MockAggregateResults struct {
// contains filtered or unexported fields
}
MockAggregateResults is a mock of AggregateResults interface
func NewMockAggregateResults ¶ added in v0.8.0
func NewMockAggregateResults(ctrl *gomock.Controller) *MockAggregateResults
NewMockAggregateResults creates a new mock instance
func (*MockAggregateResults) AddDocuments ¶ added in v0.8.0
func (m *MockAggregateResults) AddDocuments(arg0 []doc.Document) (int, error)
AddDocuments mocks base method
func (*MockAggregateResults) EXPECT ¶ added in v0.8.0
func (m *MockAggregateResults) EXPECT() *MockAggregateResultsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockAggregateResults) Finalize ¶ added in v0.8.0
func (m *MockAggregateResults) Finalize()
Finalize mocks base method
func (*MockAggregateResults) Map ¶ added in v0.8.0
func (m *MockAggregateResults) Map() *AggregateResultsMap
Map mocks base method
func (*MockAggregateResults) Namespace ¶ added in v0.8.0
func (m *MockAggregateResults) Namespace() ident.ID
Namespace mocks base method
func (*MockAggregateResults) Reset ¶ added in v0.8.0
func (m *MockAggregateResults) Reset(arg0 ident.ID, arg1 AggregateResultsOptions)
Reset mocks base method
func (*MockAggregateResults) Size ¶ added in v0.8.0
func (m *MockAggregateResults) Size() int
Size mocks base method
type MockAggregateResultsMockRecorder ¶ added in v0.8.0
type MockAggregateResultsMockRecorder struct {
// contains filtered or unexported fields
}
MockAggregateResultsMockRecorder is the mock recorder for MockAggregateResults
func (*MockAggregateResultsMockRecorder) AddDocuments ¶ added in v0.8.0
func (mr *MockAggregateResultsMockRecorder) AddDocuments(arg0 interface{}) *gomock.Call
AddDocuments indicates an expected call of AddDocuments
func (*MockAggregateResultsMockRecorder) Finalize ¶ added in v0.8.0
func (mr *MockAggregateResultsMockRecorder) Finalize() *gomock.Call
Finalize indicates an expected call of Finalize
func (*MockAggregateResultsMockRecorder) Map ¶ added in v0.8.0
func (mr *MockAggregateResultsMockRecorder) Map() *gomock.Call
Map indicates an expected call of Map
func (*MockAggregateResultsMockRecorder) Namespace ¶ added in v0.8.0
func (mr *MockAggregateResultsMockRecorder) Namespace() *gomock.Call
Namespace indicates an expected call of Namespace
func (*MockAggregateResultsMockRecorder) Reset ¶ added in v0.8.0
func (mr *MockAggregateResultsMockRecorder) Reset(arg0, arg1 interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockAggregateResultsMockRecorder) Size ¶ added in v0.8.0
func (mr *MockAggregateResultsMockRecorder) Size() *gomock.Call
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(arg0 result.IndexBlock) error
AddResults 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) EvictMutableSegments ¶
EvictMutableSegments mocks base method
func (*MockBlock) NeedsMutableSegmentsEvicted ¶
NeedsMutableSegmentsEvicted mocks base method
func (*MockBlock) Query ¶
func (m *MockBlock) Query(arg0 *resource.CancellableLifetime, arg1 Query, arg2 QueryOptions, arg3 BaseResults) (bool, error)
Query mocks base method
func (*MockBlock) Stats ¶ added in v0.5.0
func (m *MockBlock) Stats(arg0 BlockStatsReporter) error
Stats mocks base method
func (*MockBlock) Tick ¶
func (m *MockBlock) Tick(arg0 context.Cancellable, arg1 time.Time) (BlockTickResult, error)
Tick mocks base method
func (*MockBlock) WriteBatch ¶
func (m *MockBlock) WriteBatch(arg0 *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(arg0 interface{}) *gomock.Call
AddResults indicates an expected call of AddResults
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(arg0, arg1, arg2, arg3 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 ¶ added in v0.5.0
func (mr *MockBlockMockRecorder) Stats(arg0 interface{}) *gomock.Call
Stats indicates an expected call of Stats
func (*MockBlockMockRecorder) Tick ¶
func (mr *MockBlockMockRecorder) Tick(arg0, arg1 interface{}) *gomock.Call
Tick indicates an expected call of Tick
func (*MockBlockMockRecorder) WriteBatch ¶
func (mr *MockBlockMockRecorder) WriteBatch(arg0 interface{}) *gomock.Call
WriteBatch indicates an expected call of WriteBatch
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 ¶
func (m *MockOnIndexSeries) EXPECT() *MockOnIndexSeriesMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockOnIndexSeries) OnIndexFinalize ¶
func (m *MockOnIndexSeries) OnIndexFinalize(arg0 time0.UnixNano)
OnIndexFinalize mocks base method
func (*MockOnIndexSeries) OnIndexSuccess ¶
func (m *MockOnIndexSeries) OnIndexSuccess(arg0 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) OnIndexFinalize ¶
func (mr *MockOnIndexSeriesMockRecorder) OnIndexFinalize(arg0 interface{}) *gomock.Call
OnIndexFinalize indicates an expected call of OnIndexFinalize
func (*MockOnIndexSeriesMockRecorder) OnIndexSuccess ¶
func (mr *MockOnIndexSeriesMockRecorder) OnIndexSuccess(arg0 interface{}) *gomock.Call
OnIndexSuccess indicates an expected call of OnIndexSuccess
type MockQueryResults ¶ added in v0.8.0
type MockQueryResults struct {
// contains filtered or unexported fields
}
MockQueryResults is a mock of QueryResults interface
func NewMockQueryResults ¶ added in v0.8.0
func NewMockQueryResults(ctrl *gomock.Controller) *MockQueryResults
NewMockQueryResults creates a new mock instance
func (*MockQueryResults) AddDocuments ¶ added in v0.8.0
func (m *MockQueryResults) AddDocuments(arg0 []doc.Document) (int, error)
AddDocuments mocks base method
func (*MockQueryResults) EXPECT ¶ added in v0.8.0
func (m *MockQueryResults) EXPECT() *MockQueryResultsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockQueryResults) Finalize ¶ added in v0.8.0
func (m *MockQueryResults) Finalize()
Finalize mocks base method
func (*MockQueryResults) Map ¶ added in v0.8.0
func (m *MockQueryResults) Map() *ResultsMap
Map mocks base method
func (*MockQueryResults) Namespace ¶ added in v0.8.0
func (m *MockQueryResults) Namespace() ident.ID
Namespace mocks base method
func (*MockQueryResults) NoFinalize ¶ added in v0.8.0
func (m *MockQueryResults) NoFinalize()
NoFinalize mocks base method
func (*MockQueryResults) Reset ¶ added in v0.8.0
func (m *MockQueryResults) Reset(arg0 ident.ID, arg1 QueryResultsOptions)
Reset mocks base method
func (*MockQueryResults) Size ¶ added in v0.8.0
func (m *MockQueryResults) Size() int
Size mocks base method
type MockQueryResultsMockRecorder ¶ added in v0.8.0
type MockQueryResultsMockRecorder struct {
// contains filtered or unexported fields
}
MockQueryResultsMockRecorder is the mock recorder for MockQueryResults
func (*MockQueryResultsMockRecorder) AddDocuments ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) AddDocuments(arg0 interface{}) *gomock.Call
AddDocuments indicates an expected call of AddDocuments
func (*MockQueryResultsMockRecorder) Finalize ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) Finalize() *gomock.Call
Finalize indicates an expected call of Finalize
func (*MockQueryResultsMockRecorder) Map ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) Map() *gomock.Call
Map indicates an expected call of Map
func (*MockQueryResultsMockRecorder) Namespace ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) Namespace() *gomock.Call
Namespace indicates an expected call of Namespace
func (*MockQueryResultsMockRecorder) NoFinalize ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) NoFinalize() *gomock.Call
NoFinalize indicates an expected call of NoFinalize
func (*MockQueryResultsMockRecorder) Reset ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) Reset(arg0, arg1 interface{}) *gomock.Call
Reset indicates an expected call of Reset
func (*MockQueryResultsMockRecorder) Size ¶ added in v0.8.0
func (mr *MockQueryResultsMockRecorder) Size() *gomock.Call
Size indicates an expected call of Size
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) }
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 // 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 }
Options control the Indexing knobs.
func NewOptions ¶
func NewOptions() Options
NewOptions returns a new Options object with default properties.
type PatternType ¶ added in v0.6.0
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 )
type PostingsListCache ¶ added in v0.6.0
PostingsListCache implements an LRU for caching queries and their results.
func (*PostingsListCache) GetRegexp ¶ added in v0.6.0
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 ¶ added in v0.6.0
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 ¶ added in v0.6.0
func (q *PostingsListCache) PurgeSegment(segmentUUID uuid.UUID)
PurgeSegment removes all postings lists associated with the specified segment from the cache.
func (*PostingsListCache) PutRegexp ¶ added in v0.6.0
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 ¶ added in v0.6.0
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 ¶ added in v0.6.0
func (q *PostingsListCache) Report()
Report will emit metrics about the status of the cache.
type PostingsListCacheOptions ¶ added in v0.6.0
type PostingsListCacheOptions struct {
InstrumentOptions instrument.Options
}
PostingsListCacheOptions is the options struct for the query cache.
type QueryMatcher ¶
QueryMatcher is a gomock.Matcher that matches index.Query
func NewQueryMatcher ¶
func NewQueryMatcher(q Query) QueryMatcher
NewQueryMatcher returns a new QueryMatcher
type QueryOptions ¶
QueryOptions enables users to specify constraints on query execution.
func (QueryOptions) LimitExceeded ¶ added in v0.5.0
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 ¶ added in v0.8.0
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 // NoFinalize marks the Results such that a subsequent call to Finalize() // will be a no-op and will not return the object to the pool or release any // of its resources. NoFinalize() }
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 ¶ added in v0.8.0
func NewQueryResults( namespaceID ident.ID, opts QueryResultsOptions, indexOpts Options, ) QueryResults
NewQueryResults returns a new query results object.
type QueryResultsAllocator ¶ added in v0.8.0
type QueryResultsAllocator func() QueryResults
QueryResultsAllocator allocates QueryResults types.
type QueryResultsOptions ¶ added in v0.8.0
type QueryResultsOptions struct { // SizeLimit will limit the total results set to a given limit and if // overflown will return early successfully. SizeLimit int }
QueryResultsOptions is a set of options to use for query results.
type QueryResultsPool ¶ added in v0.8.0
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 ¶ added in v0.8.0
func NewQueryResultsPool(opts pool.ObjectPoolOptions) QueryResultsPool
NewQueryResultsPool creates a new QueryResultsPool.
type ReadThroughSegment ¶ added in v0.6.0
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 ¶ added in v0.6.0
func (r *ReadThroughSegment) Close() error
Close purges all entries in the cache associated with this segment, and then closes the underlying segment.
func (*ReadThroughSegment) ContainsID ¶ added in v0.8.1
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 ¶ added in v0.8.1
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 ¶ added in v0.6.0
func (r *ReadThroughSegment) Reader() (index.Reader, error)
Reader returns a read through reader for the read through segment.
func (*ReadThroughSegment) Size ¶ added in v0.8.1
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 ¶ added in v0.8.1
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 ¶ added in v0.6.0
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) Iter ¶
func (m *ResultsMap) Iter() map[ResultsMapHash]ResultsMapEntry
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.Tags)
Set will set the value for an identifier.
func (*ResultsMap) SetUnsafe ¶
func (m *ResultsMap) SetUnsafe(k ident.ID, v ident.Tags, opts ResultsMapSetUnsafeOptions)
SetUnsafe will set the value for an identifier with unsafe options for how the map treats the key.
type ResultsMapCopyFn ¶
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) Value ¶
func (e ResultsMapEntry) Value() ident.Tags
Value returns the map entry value.
type ResultsMapEqualsFn ¶
ResultsMapEqualsFn is the equals key function to execute when detecting equality of a key.
type ResultsMapFinalizeFn ¶
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 ¶
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 ¶ added in v0.5.0
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) 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) 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) 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 ¶
func (e WriteBatchEntry) Result() WriteBatchEntryResult
Result returns the result for this entry.
type WriteBatchEntryResult ¶
WriteBatchEntryResult represents a result.
type WriteBatchOptions ¶
WriteBatchOptions is a set of options required for a write batch.
type WriteBatchResult ¶
WriteBatchResult returns statistics about the WriteBatch execution.
Source Files ¶
- aggregate_results.go
- aggregate_results_map_gen.go
- aggregate_results_new_map.go
- aggregate_results_pool.go
- aggregate_values.go
- aggregate_values_map_gen.go
- aggregate_values_new_map.go
- aggregate_values_pool.go
- aggregated_term_filter.go
- allocator.go
- block.go
- index_mock.go
- options.go
- postings_list_cache.go
- postings_list_cache_lru.go
- query_matcher.go
- read_through_segment.go
- results.go
- results_map_gen.go
- results_new_map.go
- results_pool.go
- segments.go
- types.go