Documentation ¶
Index ¶
- type Database
- type NamespaceMetadata
- type NamespaceOptions
- type Options
- func (o *Options) BoolArrayPool() *pool.BucketizedBoolArrayPool
- func (o *Options) BytesArrayPool() *pool.BucketizedBytesArrayPool
- func (o *Options) ClockOptions() clock.Options
- func (o *Options) DoubleArrayPool() *pool.BucketizedFloat64ArrayPool
- func (o *Options) FieldHashFn() hash.StringArrayHashFn
- func (o *Options) FieldPathSeparator() byte
- func (o *Options) FieldRetriever() persist.FieldRetriever
- func (o *Options) FilePathPrefix() string
- func (o *Options) FlushQueueSize() int
- func (o *Options) InstrumentOptions() instrument.Options
- func (o *Options) Int64ArrayPool() *pool.BucketizedInt64ArrayPool
- func (o *Options) IntArrayPool() *pool.BucketizedIntArrayPool
- func (o *Options) NamespaceFieldName() string
- func (o *Options) PersistManager() persist.Manager
- func (o *Options) QueryExecutor() executor.Executor
- func (o *Options) RawDocSourceFieldPath() []string
- func (o *Options) SegmentUnloadAfterUnreadFor() time.Duration
- func (o *Options) SetBoolArrayPool(v *pool.BucketizedBoolArrayPool) *Options
- func (o *Options) SetBytesArrayPool(v *pool.BucketizedBytesArrayPool) *Options
- func (o *Options) SetClockOptions(v clock.Options) *Options
- func (o *Options) SetDoubleArrayPool(v *pool.BucketizedFloat64ArrayPool) *Options
- func (o *Options) SetFieldHashFn(v hash.StringArrayHashFn) *Options
- func (o *Options) SetFieldPathSeparator(v byte) *Options
- func (o *Options) SetFieldRetriever(v persist.FieldRetriever) *Options
- func (o *Options) SetFilePathPrefix(v string) *Options
- func (o *Options) SetFlushQueueSize(v int) *Options
- func (o *Options) SetInstrumentOptions(v instrument.Options) *Options
- func (o *Options) SetInt64ArrayPool(v *pool.BucketizedInt64ArrayPool) *Options
- func (o *Options) SetIntArrayPool(v *pool.BucketizedIntArrayPool) *Options
- func (o *Options) SetNamespaceFieldName(v string) *Options
- func (o *Options) SetPersistManager(v persist.Manager) *Options
- func (o *Options) SetQueryExecutor(v executor.Executor) *Options
- func (o *Options) SetRawDocSourceFieldPath(v []string) *Options
- func (o *Options) SetSegmentUnloadAfterUnreadFor(v time.Duration) *Options
- func (o *Options) SetTickMinInterval(v time.Duration) *Options
- func (o *Options) SetTimestampFieldPath(v []string) *Options
- func (o *Options) SetWriteAsync(v bool) *Options
- func (o *Options) TickMinInterval() time.Duration
- func (o *Options) TimestampFieldPath() []string
- func (o *Options) WriteAsync() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { // Options returns database options. Options() *Options // Open opens the database for reading and writing events. Open() error // WriteBatch writes a batch of timestamped documents to a namespace. WriteBatch( ctx context.Context, namespace []byte, docs []document.Document, ) error // QueryRaw executes a raw query against database for documents matching // certain criteria, with optional filtering, sorting, and limiting applied. QueryRaw( ctx context.Context, q query.ParsedRawQuery, ) (*query.RawResults, error) // QueryGrouped executes a grouped query against database for documents matching // certain criteria, with optional filtering, grouping, sorting, and limiting applied. QueryGrouped( ctx context.Context, q query.ParsedGroupedQuery, ) (*query.GroupedResults, error) // QueryTimeBucket executes a time bucket query against database for documents // matching criteria, and counts the number of matching documents in each time bucket. QueryTimeBucket( ctx context.Context, q query.ParsedTimeBucketQuery, ) (*query.TimeBucketResults, error) // Close closes the database. Close() error }
Database is a database for timestamped events.
func NewDatabase ¶
func NewDatabase( namespaces []NamespaceMetadata, opts *Options, ) Database
NewDatabase creates a new database.
type NamespaceMetadata ¶
type NamespaceMetadata struct {
// contains filtered or unexported fields
}
NamespaceMetadata provides namespace-level metadata.
func NewNamespaceMetadata ¶
func NewNamespaceMetadata(id []byte, opts *NamespaceOptions) NamespaceMetadata
NewNamespaceMetadata creates a new namespace metadata.
func (NamespaceMetadata) Options ¶
func (m NamespaceMetadata) Options() *NamespaceOptions
Options return the namespace options.
type NamespaceOptions ¶
type NamespaceOptions struct {
// contains filtered or unexported fields
}
NamespaceOptions provide a set of options controlling namespace-level behavior.
func NewNamespaceOptions ¶
func NewNamespaceOptions() *NamespaceOptions
NewNamespaceOptions create a new set of namespace options.
func (*NamespaceOptions) Retention ¶
func (o *NamespaceOptions) Retention() time.Duration
Retention returns the namespce retention.
func (*NamespaceOptions) SetRetention ¶
func (o *NamespaceOptions) SetRetention(v time.Duration) *NamespaceOptions
SetRetention sets the namespace retention.
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options provide a set of options for the database.
func (*Options) BoolArrayPool ¶
func (o *Options) BoolArrayPool() *pool.BucketizedBoolArrayPool
BoolArrayPool returns the bool array pool.
func (*Options) BytesArrayPool ¶
func (o *Options) BytesArrayPool() *pool.BucketizedBytesArrayPool
BytesArrayPool returns the string array pool.
func (*Options) ClockOptions ¶
ClockOptions returns the clock options.
func (*Options) DoubleArrayPool ¶
func (o *Options) DoubleArrayPool() *pool.BucketizedFloat64ArrayPool
DoubleArrayPool returns the double array pool.
func (*Options) FieldHashFn ¶
func (o *Options) FieldHashFn() hash.StringArrayHashFn
FieldHashFn returns the field hashing function.
func (*Options) FieldPathSeparator ¶
FieldPathSeparator returns the path separator when flattening nested document fields. This is used when persisting and querying nested fields.
func (*Options) FieldRetriever ¶
func (o *Options) FieldRetriever() persist.FieldRetriever
FieldRetriever returns the field retriever.
func (*Options) FilePathPrefix ¶
FilePathPrefix return the file path prefix.
func (*Options) FlushQueueSize ¶
FlushQueueSize returns the flush queue size.
func (*Options) InstrumentOptions ¶
func (o *Options) InstrumentOptions() instrument.Options
InstrumentOptions returns the instrument options.
func (*Options) Int64ArrayPool ¶
func (o *Options) Int64ArrayPool() *pool.BucketizedInt64ArrayPool
Int64ArrayPool returns the int64 array pool.
func (*Options) IntArrayPool ¶
func (o *Options) IntArrayPool() *pool.BucketizedIntArrayPool
IntArrayPool returns the int array pool.
func (*Options) NamespaceFieldName ¶
NamespaceFieldName returns the field name of the namespace field.
func (*Options) PersistManager ¶
PersistManager returns the persistence manager.
func (*Options) QueryExecutor ¶
QueryExecutor returns the query executor.
func (*Options) RawDocSourceFieldPath ¶
RawDocSourceFieldPath returns the raw document source field path.
func (*Options) SegmentUnloadAfterUnreadFor ¶
SegmentUnloadAfterUnreadFor sets the segment unload after unread for duration. If a segment is unread for longer than the configuration duration since its last read access, it is eligible to be unloaded from memory.
func (*Options) SetBoolArrayPool ¶
func (o *Options) SetBoolArrayPool(v *pool.BucketizedBoolArrayPool) *Options
SetBoolArrayPool sets the bool array pool.
func (*Options) SetBytesArrayPool ¶
func (o *Options) SetBytesArrayPool(v *pool.BucketizedBytesArrayPool) *Options
SetBytesArrayPool sets the string array pool.
func (*Options) SetClockOptions ¶
SetClockOptions sets the clock options.
func (*Options) SetDoubleArrayPool ¶
func (o *Options) SetDoubleArrayPool(v *pool.BucketizedFloat64ArrayPool) *Options
SetDoubleArrayPool sets the double array pool.
func (*Options) SetFieldHashFn ¶
func (o *Options) SetFieldHashFn(v hash.StringArrayHashFn) *Options
SetFieldHashFn sets the field hashing function.
func (*Options) SetFieldPathSeparator ¶
SetFieldPathSeparator sets the path separator when flattening nested document fields. This is used when persisting and querying nested fields.
func (*Options) SetFieldRetriever ¶
func (o *Options) SetFieldRetriever(v persist.FieldRetriever) *Options
SetFieldRetriever sets the field retriever.
func (*Options) SetFilePathPrefix ¶
SetFilePathPrefix sets the file path prefix.
func (*Options) SetFlushQueueSize ¶
SetFlushQueueSize sets the flush queue size.
func (*Options) SetInstrumentOptions ¶
func (o *Options) SetInstrumentOptions(v instrument.Options) *Options
SetInstrumentOptions sets the instrument options.
func (*Options) SetInt64ArrayPool ¶
func (o *Options) SetInt64ArrayPool(v *pool.BucketizedInt64ArrayPool) *Options
SetInt64ArrayPool sets the int64 array pool.
func (*Options) SetIntArrayPool ¶
func (o *Options) SetIntArrayPool(v *pool.BucketizedIntArrayPool) *Options
SetIntArrayPool sets the int array pool.
func (*Options) SetNamespaceFieldName ¶
SetNamespaceFieldName sets the field name of the namespace field.
func (*Options) SetPersistManager ¶
SetPersistManager sets the persistence manager.
func (*Options) SetQueryExecutor ¶
SetQueryExecutor sets the query executor.
func (*Options) SetRawDocSourceFieldPath ¶
SetRawDocSourceFieldPath sets the raw document source field path.
func (*Options) SetSegmentUnloadAfterUnreadFor ¶
SetSegmentUnloadAfterUnreadFor sets the segment unload after unread for duration. If a segment is unread for longer than the configuration duration since its last read access, it is eligible to be unloaded from memory.
func (*Options) SetTickMinInterval ¶
SetTickMinInterval sets the minimum interval between consecutive ticks for performing periodic administrative tasks (e.g., unloading segments from memory) to smoothen the load.
func (*Options) SetTimestampFieldPath ¶
SetTimestampFieldPath sets the timestamp field path.
func (*Options) SetWriteAsync ¶
SetWriteAsync determines whether a new batch of incoming writes are performed asynchronously. If set to true, writes are acknowledged when they are enqueued to the flush queue. Otherwise, writes are acknowledged when they are flushed to disk.
func (*Options) TickMinInterval ¶
TickMinInterval returns the minimum interval between consecutive ticks for performing periodic administrative tasks (e.g., unloading segments from memory) to smoothen the load.
func (*Options) TimestampFieldPath ¶
TimestampFieldPath returns the timestamp field path.
func (*Options) WriteAsync ¶
WriteAsync determines whether a new batch of incoming writes are performed asynchronously. If set to true, writes are acknowledged when they are enqueued to the flush queue. Otherwise, writes are acknowledged when they are flushed to disk.