Documentation ¶
Index ¶
- Constants
- Variables
- func BloomName(shard int) string
- func ShardKeyForSnapshotID(snapshotID []byte, shardCount int) int
- func ValidateConfig(b *BlockConfig) error
- func ValidateShardCount(shardCount int) int
- type BackendBlock
- type BlockConfig
- type CacheControl
- type CompactionOptions
- type Compactor
- type Finder
- type ID
- type IDMap
- type IDMapEntry
- type Iterator
- type SearchOptions
- type Searcher
- type ShardedBloomFilter
- type TagCallback
- type TagCallbackV2
- type WALBlock
Constants ¶
const ( // NameObjects names the backend data object NameObjects = "data" // NameIndex names the backend index object NameIndex = "index" )
Variables ¶
var ErrUnsupported = errors.New("unsupported")
Functions ¶
func ShardKeyForSnapshotID ¶
func ValidateConfig ¶
func ValidateConfig(b *BlockConfig) error
ValidateConfig returns true if the config is valid
func ValidateShardCount ¶
ValidateShardCount For backward compatibility
Types ¶
type BlockConfig ¶
type BlockConfig struct { BloomFP float64 `yaml:"bloom_filter_false_positive"` BloomShardSizeBytes int `yaml:"bloom_filter_shard_size_bytes"` Version string `yaml:"version"` SearchEncoding backend.Encoding `yaml:"search_encoding"` // v2 fields Encoding backend.Encoding `yaml:"v2_encoding"` // parquet fields RowGroupSizeBytes int `yaml:"parquet_row_group_size_bytes"` }
BlockConfig holds configuration options for newly created blocks
type CacheControl ¶
type CompactionOptions ¶
type CompactionOptions struct { ChunkSizeBytes uint32 FlushSizeBytes uint32 IteratorBufferSize int // How many snapshots to prefetch async. MaxBytesPerSnapshot int OutputBlocks uint8 BlockConfig BlockConfig ObjectsWritten func(compactionLevel, objects int) BytesWritten func(compactionLevel, bytes int) SnapshotsDiscarded func(snapshotID string, count int) }
type IDMap ¶
type IDMap[T any] struct { // contains filtered or unexported fields }
IDMap is a helper for recording and checking for IDs. Not safe for concurrent use.
func (*IDMap[T]) EntriesSortedByID ¶
func (m *IDMap[T]) EntriesSortedByID() []IDMapEntry[T]
type IDMapEntry ¶
type SearchOptions ¶
type SearchOptions struct { ChunkSizeBytes uint32 // Buffer size to read from backend storage. StartPage int // Controls searching only a subset of the block. Which page to begin searching at. TotalPages int // Controls searching only a subset of the block. How many pages to search. MaxBytes int // Max allowable snapshot size in bytes. Snapshots exceeding this are not searched. PrefetchSnapshotCount int // How many snapshots to prefetch async. ReadBufferCount int ReadBufferSize int CacheControl CacheControl }
func DefaultSearchOptions ¶
func DefaultSearchOptions() SearchOptions
DefaultSearchOptions is used in a lot of places such as local ingester searches. It is important in these cases to set a reasonable read buffer size and count to prevent constant tiny readranges against the local backend. TODO: Note that there is another method of creating "default search options" that looks like this: deepdb.SearchConfig{}.ApplyToOptions(&searchOpts). we should consolidate these.
type Searcher ¶
type Searcher interface { Search(ctx context.Context, req *deeppb.SearchRequest, opts SearchOptions) (*deeppb.SearchResponse, error) SearchTags(ctx context.Context, cb TagCallback, opts SearchOptions) error SearchTagValues(ctx context.Context, tag string, cb TagCallback, opts SearchOptions) error SearchTagValuesV2(ctx context.Context, tag string, cb TagCallbackV2, opts SearchOptions) error Fetch(context.Context, deepql.FetchSnapshotRequest, SearchOptions) (deepql.FetchSnapshotResponse, error) }
type ShardedBloomFilter ¶
type ShardedBloomFilter struct {
// contains filtered or unexported fields
}
func NewBloom ¶
func NewBloom(fp float64, shardSize, estimatedObjects uint) *ShardedBloomFilter
NewBloom creates a ShardedBloomFilter
func (*ShardedBloomFilter) Add ¶
func (b *ShardedBloomFilter) Add(snapshotID []byte)
func (*ShardedBloomFilter) GetShardCount ¶
func (b *ShardedBloomFilter) GetShardCount() int
func (*ShardedBloomFilter) Marshal ¶
func (b *ShardedBloomFilter) Marshal() ([][]byte, error)
Marshal is a wrapper around bloom.WriteTo
func (*ShardedBloomFilter) Test ¶
func (b *ShardedBloomFilter) Test(snapshotID []byte) bool
Test implements bloom.Test -> required only for testing
type TagCallback ¶
type TagCallback func(t string)
type TagCallbackV2 ¶
type WALBlock ¶
type WALBlock interface { BackendBlock // Append the given snapshot to the block. Must be safe for concurrent use with read operations. Append(id ID, b []byte, start uint32) error // Flush any unbuffered data to disk. Must be safe for concurrent use with read operations. Flush() error DataLength() uint64 Iterator() (Iterator, error) Clear() error }