Versions in this module Expand all Collapse all v1 v1.0.3 Jun 17, 2022 v1.0.2 May 27, 2022 v1.0.1 Apr 22, 2022 Changes in this version + const DefaultMaxSavedErrors + type TSMErrors []error + func (t TSMErrors) Error() string v0 v0.10.3 Apr 8, 2022 Changes in this version + const TombstoneFileExtension v0.10.2 Mar 25, 2022 v0.10.1 Mar 15, 2022 Changes in this version + const BadTSMFileExtension + const BlockBoolean + const BlockFloat64 + const BlockInteger + const BlockString + const BlockUnsigned + const CompactionTempExtension + const DefaultSegmentSize + const DigestFilename + const MagicNumber + const TSMFileExtension + const TmpTSMFileExtension + const Version + const WALFileExtension + const WALFilePrefix + var ErrDigestAlreadyWritten = errors.New("digest manifest already written") + var ErrDigestManifestAlreadyRead = errors.New("digest manifest already read") + var ErrFileInUse = fmt.Errorf("file still in use") + var ErrMaxBlocksExceeded = fmt.Errorf("max blocks exceeded") + var ErrMaxKeyLengthExceeded = fmt.Errorf("max key length exceeded") + var ErrNoDigestManifest = errors.New("no digest manifest") + var ErrNoValues = fmt.Errorf("no values written") + var ErrSnapshotInProgress = fmt.Errorf("snapshot in progress") + var ErrStringArrayEncodeTooLarge = errors.New("StringArrayEncodeAll: source length too large") + var ErrTSMClosed = fmt.Errorf("tsm file closed") + var ErrWALClosed = fmt.Errorf("WAL closed") + var ErrWALCorrupt = fmt.Errorf("corrupted WAL entry") + var WithMadviseWillNeed = func(willNeed bool) tsmReaderOption + func BlockCount(block []byte) int + func BlockType(block []byte) (byte, error) + func BlockTypeToCnosQLDataType(typ byte) cnosql.DataType + func BooleanArrayDecodeAll(b []byte, dst []bool) ([]bool, error) + func BooleanArrayEncodeAll(src []bool, b []byte) ([]byte, error) + func CountTimestamps(b []byte) int + func DecodeBooleanArrayBlock(block []byte, a *tsdb.BooleanArray) error + func DecodeFloatArrayBlock(block []byte, a *tsdb.FloatArray) error + func DecodeIntegerArrayBlock(block []byte, a *tsdb.IntegerArray) error + func DecodeStringArrayBlock(block []byte, a *tsdb.StringArray) error + func DecodeUnsignedArrayBlock(block []byte, a *tsdb.UnsignedArray) error + func DefaultFormatFileName(generation, sequence int) string + func DefaultParseFileName(name string) (int, int, error) + func Digest(dir string, files []string, w io.WriteCloser) error + func DigestFresh(dir string, files []string, shardLastMod time.Time) (bool, string) + func DigestWithOptions(dir string, files []string, opts DigestOptions, w io.WriteCloser) error + func EncodeBooleanArrayBlock(a *tsdb.BooleanArray, b []byte) ([]byte, error) + func EncodeFloatArrayBlock(a *tsdb.FloatArray, b []byte) ([]byte, error) + func EncodeIntegerArrayBlock(a *tsdb.IntegerArray, b []byte) ([]byte, error) + func EncodeStringArrayBlock(a *tsdb.StringArray, b []byte) ([]byte, error) + func EncodeUnsignedArrayBlock(a *tsdb.UnsignedArray, b []byte) ([]byte, error) + func ErrCacheMemorySizeLimitExceeded(n, limit uint64) error + func FloatArrayDecodeAll(b []byte, buf []float64) ([]float64, error) + func FloatArrayEncodeAll(src []float64, b []byte) ([]byte, error) + func IntegerArrayDecodeAll(b []byte, dst []int64) ([]int64, error) + func IntegerArrayEncodeAll(src []int64, b []byte) ([]byte, error) + func MetricsGroupFromContext(ctx context.Context) *metrics.Group + func NewBooleanArrayFromValues(v BooleanValues) *tsdb.BooleanArray + func NewContextWithMetricsGroup(ctx context.Context) context.Context + func NewEngine(id uint64, idx tsdb.Index, path string, walPath string, sfile *tsdb.SeriesFile, ...) tsdb.Engine + func NewFloatArrayFromValues(v FloatValues) *tsdb.FloatArray + func NewIndirectIndex() *indirectIndex + func NewIntegerArrayFromValues(v IntegerValues) *tsdb.IntegerArray + func NewStringArrayFromValues(v StringValues) *tsdb.StringArray + func NewUnsignedArrayFromValues(v UnsignedValues) *tsdb.UnsignedArray + func SeriesAndFieldFromCompositeKey(key []byte) ([]byte, []byte) + func SeriesFieldKey(seriesKey, field string) string + func SeriesFieldKeyBytes(seriesKey, field string) []byte + func StringArrayDecodeAll(b []byte, dst []string) ([]string, error) + func StringArrayEncodeAll(src []string, b []byte) ([]byte, error) + func TimeArrayDecodeAll(b []byte, dst []int64) ([]int64, error) + func TimeArrayEncodeAll(src []int64, b []byte) ([]byte, error) + func UnsignedArrayDecodeAll(b []byte, dst []uint64) ([]uint64, error) + func UnsignedArrayEncodeAll(src []uint64, b []byte) ([]byte, error) + func ZigZagDecode(v uint64) int64 + func ZigZagEncode(x int64) uint64 + type BatchDeleter interface + Commit func() error + DeleteRange func(keys [][]byte, min, max int64) error + Rollback func() error + type BatchDeleters []BatchDeleter + func (a BatchDeleters) Commit() error + func (a BatchDeleters) DeleteRange(keys [][]byte, min, max int64) error + func (a BatchDeleters) Rollback() error + type BitReader struct + func NewBitReader(data []byte) *BitReader + func (r *BitReader) CanReadBitFast() bool + func (r *BitReader) ReadBit() (bool, error) + func (r *BitReader) ReadBitFast() bool + func (r *BitReader) ReadBits(nbits uint) (uint64, error) + func (r *BitReader) Reset(data []byte) + type BlockIterator struct + func (b *BlockIterator) Err() error + func (b *BlockIterator) Next() bool + func (b *BlockIterator) PeekNext() []byte + func (b *BlockIterator) Read() (key []byte, minTime int64, maxTime int64, typ byte, checksum uint32, ...) + type BooleanDecoder struct + func (e *BooleanDecoder) Error() error + func (e *BooleanDecoder) Next() bool + func (e *BooleanDecoder) Read() bool + func (e *BooleanDecoder) SetBytes(b []byte) + type BooleanEncoder struct + func NewBooleanEncoder(sz int) BooleanEncoder + func (e *BooleanEncoder) Bytes() ([]byte, error) + func (e *BooleanEncoder) Flush() + func (e *BooleanEncoder) Reset() + func (e *BooleanEncoder) Write(b bool) + type BooleanValue struct + func DecodeBooleanBlock(block []byte, a *[]BooleanValue) ([]BooleanValue, error) + func (v BooleanValue) Size() int + func (v BooleanValue) String() string + func (v BooleanValue) UnixNano() int64 + func (v BooleanValue) Value() interface{} + type BooleanValues []BooleanValue + func (a BooleanValues) Deduplicate() BooleanValues + func (a BooleanValues) Encode(buf []byte) ([]byte, error) + func (a BooleanValues) Exclude(min, max int64) BooleanValues + func (a BooleanValues) FindRange(min, max int64) (int, int) + func (a BooleanValues) Include(min, max int64) BooleanValues + func (a BooleanValues) Len() int + func (a BooleanValues) Less(i, j int) bool + func (a BooleanValues) MaxTime() int64 + func (a BooleanValues) Merge(b BooleanValues) BooleanValues + func (a BooleanValues) MinTime() int64 + func (a BooleanValues) Size() int + func (a BooleanValues) Swap(i, j int) + type Cache struct + func NewCache(maxSize uint64) *Cache + func (c *Cache) ApplyEntryFn(f func(key []byte, entry *entry) error) error + func (c *Cache) ClearSnapshot(success bool) + func (c *Cache) Count() int + func (c *Cache) Deduplicate() + func (c *Cache) Delete(keys [][]byte) + func (c *Cache) DeleteRange(keys [][]byte, min, max int64) + func (c *Cache) Free() + func (c *Cache) Keys() [][]byte + func (c *Cache) LastWriteTime() time.Time + func (c *Cache) MaxSize() uint64 + func (c *Cache) SetMaxSize(size uint64) + func (c *Cache) Size() uint64 + func (c *Cache) Snapshot() (*Cache, error) + func (c *Cache) Split(n int) []*Cache + func (c *Cache) Statistics(tags map[string]string) []models.Statistic + func (c *Cache) Type(key []byte) (models.FieldType, error) + func (c *Cache) UpdateAge() + func (c *Cache) UpdateCompactTime(d time.Duration) + func (c *Cache) Values(key []byte) Values + func (c *Cache) Write(key []byte, values []Value) error + func (c *Cache) WriteMulti(values map[string][]Value) error + type CacheLoader struct + Logger *zap.Logger + func NewCacheLoader(files []string) *CacheLoader + func (cl *CacheLoader) Load(cache *Cache) error + func (cl *CacheLoader) WithLogger(log *zap.Logger) + type CacheStatistics struct + CacheAgeMs int64 + CachedBytes int64 + DiskSizeBytes int64 + MemSizeBytes int64 + SnapshotCount int64 + WALCompactionTimeMs int64 + WriteDropped int64 + WriteErr int64 + WriteOK int64 + type CompactionGroup []string + type CompactionPlanner interface + ForceFull func() + FullyCompacted func() bool + Plan func(lastWrite time.Time) []CompactionGroup + PlanLevel func(level int) []CompactionGroup + PlanOptimize func() []CompactionGroup + Release func(group []CompactionGroup) + SetFileStore func(fs *FileStore) + type Compactor struct + Dir string + FileStore interface{ ... } + RateLimit limiter.Rate + Size int + func NewCompactor() *Compactor + func (c *Compactor) Close() + func (c *Compactor) CompactFast(tsmFiles []string) ([]string, error) + func (c *Compactor) CompactFull(tsmFiles []string) ([]string, error) + func (c *Compactor) DisableCompactions() + func (c *Compactor) DisableSnapshots() + func (c *Compactor) EnableCompactions() + func (c *Compactor) EnableSnapshots() + func (c *Compactor) Open() + func (c *Compactor) WithFormatFileNameFunc(formatFileNameFunc FormatFileNameFunc) + func (c *Compactor) WithParseFileNameFunc(parseFileNameFunc ParseFileNameFunc) + func (c *Compactor) WriteSnapshot(cache *Cache) ([]string, error) + type DefaultPlanner struct + FileStore fileStore + func NewDefaultPlanner(fs fileStore, writeColdDuration time.Duration) *DefaultPlanner + func (c *DefaultPlanner) ForceFull() + func (c *DefaultPlanner) FullyCompacted() bool + func (c *DefaultPlanner) ParseFileName(path string) (int, int, error) + func (c *DefaultPlanner) Plan(lastWrite time.Time) []CompactionGroup + func (c *DefaultPlanner) PlanLevel(level int) []CompactionGroup + func (c *DefaultPlanner) PlanOptimize() []CompactionGroup + func (c *DefaultPlanner) Release(groups []CompactionGroup) + func (c *DefaultPlanner) SetFileStore(fs *FileStore) + type DeleteRangeWALEntry struct + Keys [][]byte + Max int64 + Min int64 + func (w *DeleteRangeWALEntry) Encode(b []byte) ([]byte, error) + func (w *DeleteRangeWALEntry) MarshalBinary() ([]byte, error) + func (w *DeleteRangeWALEntry) MarshalSize() int + func (w *DeleteRangeWALEntry) Type() WalEntryType + func (w *DeleteRangeWALEntry) UnmarshalBinary(b []byte) error + type DeleteWALEntry struct + Keys [][]byte + func (w *DeleteWALEntry) Encode(dst []byte) ([]byte, error) + func (w *DeleteWALEntry) MarshalBinary() ([]byte, error) + func (w *DeleteWALEntry) MarshalSize() int + func (w *DeleteWALEntry) Type() WalEntryType + func (w *DeleteWALEntry) UnmarshalBinary(b []byte) error + type DigestManifest struct + Dir string + Entries DigestManifestEntries + func NewDigestManifest(dir string, files []string) (*DigestManifest, error) + type DigestManifestEntries []*DigestManifestEntry + func (a DigestManifestEntries) Len() int + func (a DigestManifestEntries) Less(i, j int) bool + func (a DigestManifestEntries) Swap(i, j int) + type DigestManifestEntry struct + Filename string + Size int64 + func NewDigestManifestEntry(filename string, size int64) *DigestManifestEntry + type DigestOptions struct + MaxKey []byte + MaxTime int64 + MinKey []byte + MinTime int64 + type DigestReader struct + func NewDigestReader(r io.ReadCloser) (*DigestReader, error) + func (r *DigestReader) Close() error + func (r *DigestReader) ReadManifest() (*DigestManifest, error) + func (r *DigestReader) ReadTimeSpan() (string, *DigestTimeSpan, error) + type DigestTimeRange struct + CRC uint32 + Max int64 + Min int64 + N int + type DigestTimeSpan struct + Ranges []DigestTimeRange + func (a DigestTimeSpan) Len() int + func (a DigestTimeSpan) Less(i, j int) bool + func (a DigestTimeSpan) Swap(i, j int) + func (t *DigestTimeSpan) Add(min, max int64, n int, crc uint32) + type DigestWriter struct + func NewDigestWriter(w io.WriteCloser) (*DigestWriter, error) + func (w *DigestWriter) Close() error + func (w *DigestWriter) Flush() error + func (w *DigestWriter) WriteManifest(m *DigestManifest) error + func (w *DigestWriter) WriteTimeSpan(key string, t *DigestTimeSpan) error + type EmptyValue struct + func (e EmptyValue) Size() int + func (e EmptyValue) String() string + func (e EmptyValue) UnixNano() int64 + func (e EmptyValue) Value() interface{} + type Engine struct + Cache *Cache + CacheFlushMemorySizeThreshold uint64 + CacheFlushWriteColdDuration time.Duration + CompactionPlan CompactionPlanner + Compactor *Compactor + FileStore *FileStore + MaxPointsPerBlock int + WAL *WAL + WALEnabled bool + func (e *Engine) Backup(w io.Writer, basePath string, since time.Time) error + func (e *Engine) Close() error + func (e *Engine) CreateCursorIterator(ctx context.Context) (tsdb.CursorIterator, error) + func (e *Engine) CreateIterator(ctx context.Context, measurement string, opt query.IteratorOptions) (query.Iterator, error) + func (e *Engine) CreateSeriesIfNotExists(key, name []byte, tags models.Tags) error + func (e *Engine) CreateSeriesListIfNotExists(keys, names [][]byte, tagsSlice []models.Tags) error + func (e *Engine) CreateSnapshot() (string, error) + func (e *Engine) DeleteMeasurement(name []byte) error + func (e *Engine) DeleteSeriesRange(itr tsdb.SeriesIterator, min, max int64) error + func (e *Engine) DeleteSeriesRangeWithPredicate(itr tsdb.SeriesIterator, ...) error + func (e *Engine) Digest() (io.ReadCloser, int64, error) + func (e *Engine) DiskSize() int64 + func (e *Engine) Export(w io.Writer, basePath string, start time.Time, end time.Time) error + func (e *Engine) ForEachMeasurementName(fn func(name []byte) error) error + func (e *Engine) Free() error + func (e *Engine) HasTagKey(name, key []byte) (bool, error) + func (e *Engine) Import(r io.Reader, basePath string) error + func (e *Engine) IsIdle() bool + func (e *Engine) IteratorCost(measurement string, opt query.IteratorOptions) (query.IteratorCost, error) + func (e *Engine) KeyCursor(ctx context.Context, key []byte, t int64, ascending bool) *KeyCursor + func (e *Engine) LastModified() time.Time + func (e *Engine) LoadMetadataIndex(shardID uint64, index tsdb.Index) error + func (e *Engine) MeasurementExists(name []byte) (bool, error) + func (e *Engine) MeasurementFieldSet() *tsdb.MeasurementFieldSet + func (e *Engine) MeasurementFields(measurement []byte) *tsdb.MeasurementFields + func (e *Engine) MeasurementNamesByRegex(re *regexp.Regexp) ([][]byte, error) + func (e *Engine) MeasurementTagKeysByExpr(name []byte, expr cnosql.Expr) (map[string]struct{}, error) + func (e *Engine) MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error) + func (e *Engine) Open() error + func (e *Engine) Path() string + func (e *Engine) Restore(r io.Reader, basePath string) error + func (e *Engine) ScheduleFullCompaction() error + func (e *Engine) SeriesN() int64 + func (e *Engine) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) + func (e *Engine) SetCompactionsEnabled(enabled bool) + func (e *Engine) SetEnabled(enabled bool) + func (e *Engine) SetFieldName(measurement []byte, name string) + func (e *Engine) ShouldCompactCache(t time.Time) bool + func (e *Engine) Statistics(tags map[string]string) []models.Statistic + func (e *Engine) TagKeyCardinality(name, key []byte) int + func (e *Engine) Type(series []byte) (models.FieldType, error) + func (e *Engine) WithFormatFileNameFunc(formatFileNameFunc FormatFileNameFunc) + func (e *Engine) WithLogger(log *zap.Logger) + func (e *Engine) WithParseFileNameFunc(parseFileNameFunc ParseFileNameFunc) + func (e *Engine) WritePoints(points []models.Point) error + func (e *Engine) WriteSnapshot() (err error) + func (e *Engine) WriteTo(w io.Writer) (n int64, err error) + type EngineStatistics struct + CacheCompactionDuration int64 + CacheCompactionErrors int64 + CacheCompactions int64 + CacheCompactionsActive int64 + TSMCompactionDuration [3]int64 + TSMCompactionErrors [3]int64 + TSMCompactions [3]int64 + TSMCompactionsActive [3]int64 + TSMCompactionsQueue [3]int64 + TSMFullCompactionDuration int64 + TSMFullCompactionErrors int64 + TSMFullCompactions int64 + TSMFullCompactionsActive int64 + TSMFullCompactionsQueue int64 + TSMOptimizeCompactionDuration int64 + TSMOptimizeCompactionErrors int64 + TSMOptimizeCompactions int64 + TSMOptimizeCompactionsActive int64 + TSMOptimizeCompactionsQueue int64 + type FileStat struct + HasTombstone bool + LastModified int64 + MaxKey []byte + MaxTime int64 + MinKey []byte + MinTime int64 + Path string + Size uint32 + func (f FileStat) ContainsKey(key []byte) bool + func (f FileStat) OverlapsKeyRange(min, max []byte) bool + func (f FileStat) OverlapsTimeRange(min, max int64) bool + type FileStore struct + func NewFileStore(dir string) *FileStore + func (f *FileStore) Apply(fn func(r TSMFile) error) error + func (f *FileStore) BlockCount(path string, idx int) int + func (f *FileStore) Close() error + func (f *FileStore) Cost(key []byte, min, max int64) query.IteratorCost + func (f *FileStore) Count() int + func (f *FileStore) CreateSnapshot() (string, error) + func (f *FileStore) CurrentGeneration() int + func (f *FileStore) Delete(keys [][]byte) error + func (f *FileStore) DeleteRange(keys [][]byte, min, max int64) error + func (f *FileStore) DiskSizeBytes() int64 + func (f *FileStore) Files() []TSMFile + func (f *FileStore) Free() error + func (f *FileStore) KeyCursor(ctx context.Context, key []byte, t int64, ascending bool) *KeyCursor + func (f *FileStore) Keys() map[string]byte + func (f *FileStore) LastModified() time.Time + func (f *FileStore) NextGeneration() int + func (f *FileStore) Open() error + func (f *FileStore) ParseFileName(path string) (int, int, error) + func (f *FileStore) Read(key []byte, t int64) ([]Value, error) + func (f *FileStore) Replace(oldFiles, newFiles []string) error + func (f *FileStore) ReplaceWithCallback(oldFiles, newFiles []string, updatedFn func(r []TSMFile)) error + func (f *FileStore) Statistics(tags map[string]string) []models.Statistic + func (f *FileStore) Stats() []FileStat + func (f *FileStore) TSMReader(path string) *TSMReader + func (f *FileStore) Type(key []byte) (byte, error) + func (f *FileStore) WalkKeys(seek []byte, fn func(key []byte, typ byte) error) error + func (f *FileStore) WithLogger(log *zap.Logger) + func (f *FileStore) WithObserver(obs tsdb.FileStoreObserver) + func (f *FileStore) WithParseFileNameFunc(parseFileNameFunc ParseFileNameFunc) + type FileStoreStatistics struct + DiskBytes int64 + FileCount int64 + type FloatDecoder struct + func (it *FloatDecoder) Error() error + func (it *FloatDecoder) Next() bool + func (it *FloatDecoder) SetBytes(b []byte) error + func (it *FloatDecoder) Values() float64 + type FloatEncoder struct + func NewFloatEncoder() *FloatEncoder + func (s *FloatEncoder) Bytes() ([]byte, error) + func (s *FloatEncoder) Flush() + func (s *FloatEncoder) Reset() + func (s *FloatEncoder) Write(v float64) + type FloatValue struct + func DecodeFloatBlock(block []byte, a *[]FloatValue) ([]FloatValue, error) + func (v FloatValue) Size() int + func (v FloatValue) String() string + func (v FloatValue) UnixNano() int64 + func (v FloatValue) Value() interface{} + type FloatValues []FloatValue + func (a FloatValues) Deduplicate() FloatValues + func (a FloatValues) Encode(buf []byte) ([]byte, error) + func (a FloatValues) Exclude(min, max int64) FloatValues + func (a FloatValues) FindRange(min, max int64) (int, int) + func (a FloatValues) Include(min, max int64) FloatValues + func (a FloatValues) Len() int + func (a FloatValues) Less(i, j int) bool + func (a FloatValues) MaxTime() int64 + func (a FloatValues) Merge(b FloatValues) FloatValues + func (a FloatValues) MinTime() int64 + func (a FloatValues) Size() int + func (a FloatValues) Swap(i, j int) + type FormatFileNameFunc func(generation, sequence int) string + type IndexEntry struct + MaxTime int64 + MinTime int64 + Offset int64 + Size uint32 + func (e *IndexEntry) AppendTo(b []byte) []byte + func (e *IndexEntry) Contains(t int64) bool + func (e *IndexEntry) OverlapsTimeRange(min, max int64) bool + func (e *IndexEntry) String() string + func (e *IndexEntry) UnmarshalBinary(b []byte) error + type IndexWriter interface + Add func(key []byte, blockType byte, minTime, maxTime int64, offset int64, size uint32) + Close func() error + Entries func(key []byte) []IndexEntry + KeyCount func() int + MarshalBinary func() ([]byte, error) + Remove func() error + Size func() uint32 + WriteTo func(w io.Writer) (int64, error) + func NewDiskIndexWriter(f *os.File) IndexWriter + func NewIndexWriter() IndexWriter + type IntegerDecoder struct + func (d *IntegerDecoder) Error() error + func (d *IntegerDecoder) Next() bool + func (d *IntegerDecoder) Read() int64 + func (d *IntegerDecoder) SetBytes(b []byte) + type IntegerEncoder struct + func NewIntegerEncoder(sz int) IntegerEncoder + func (e *IntegerEncoder) Bytes() ([]byte, error) + func (e *IntegerEncoder) Flush() + func (e *IntegerEncoder) Reset() + func (e *IntegerEncoder) Write(v int64) + type IntegerValue struct + func DecodeIntegerBlock(block []byte, a *[]IntegerValue) ([]IntegerValue, error) + func (v IntegerValue) Size() int + func (v IntegerValue) String() string + func (v IntegerValue) UnixNano() int64 + func (v IntegerValue) Value() interface{} + type IntegerValues []IntegerValue + func (a IntegerValues) Deduplicate() IntegerValues + func (a IntegerValues) Encode(buf []byte) ([]byte, error) + func (a IntegerValues) Exclude(min, max int64) IntegerValues + func (a IntegerValues) FindRange(min, max int64) (int, int) + func (a IntegerValues) Include(min, max int64) IntegerValues + func (a IntegerValues) Len() int + func (a IntegerValues) Less(i, j int) bool + func (a IntegerValues) MaxTime() int64 + func (a IntegerValues) Merge(b IntegerValues) IntegerValues + func (a IntegerValues) MinTime() int64 + func (a IntegerValues) Size() int + func (a IntegerValues) Swap(i, j int) + type KeyCursor struct + func (c *KeyCursor) Close() + func (c *KeyCursor) Next() + func (c *KeyCursor) ReadBooleanArrayBlock(values *tsdb.BooleanArray) (*tsdb.BooleanArray, error) + func (c *KeyCursor) ReadBooleanBlock(buf *[]BooleanValue) ([]BooleanValue, error) + func (c *KeyCursor) ReadFloatArrayBlock(values *tsdb.FloatArray) (*tsdb.FloatArray, error) + func (c *KeyCursor) ReadFloatBlock(buf *[]FloatValue) ([]FloatValue, error) + func (c *KeyCursor) ReadIntegerArrayBlock(values *tsdb.IntegerArray) (*tsdb.IntegerArray, error) + func (c *KeyCursor) ReadIntegerBlock(buf *[]IntegerValue) ([]IntegerValue, error) + func (c *KeyCursor) ReadStringArrayBlock(values *tsdb.StringArray) (*tsdb.StringArray, error) + func (c *KeyCursor) ReadStringBlock(buf *[]StringValue) ([]StringValue, error) + func (c *KeyCursor) ReadUnsignedArrayBlock(values *tsdb.UnsignedArray) (*tsdb.UnsignedArray, error) + func (c *KeyCursor) ReadUnsignedBlock(buf *[]UnsignedValue) ([]UnsignedValue, error) + type KeyIterator interface + Close func() error + Err func() error + EstimatedIndexSize func() int + Next func() bool + Read func() (key []byte, minTime int64, maxTime int64, data []byte, err error) + func NewCacheKeyIterator(cache *Cache, size int, interrupt chan struct{}) KeyIterator + func NewTSMBatchKeyIterator(size int, fast bool, interrupt chan struct{}, tsmFiles []string, ...) (KeyIterator, error) + func NewTSMKeyIterator(size int, fast bool, interrupt chan struct{}, readers ...*TSMReader) (KeyIterator, error) + type ParseFileNameFunc func(name string) (generation, sequence int, err error) + type StringDecoder struct + func (e *StringDecoder) Error() error + func (e *StringDecoder) Next() bool + func (e *StringDecoder) Read() string + func (e *StringDecoder) SetBytes(b []byte) error + type StringEncoder struct + func NewStringEncoder(sz int) StringEncoder + func (e *StringEncoder) Bytes() ([]byte, error) + func (e *StringEncoder) Flush() + func (e *StringEncoder) Reset() + func (e *StringEncoder) Write(s string) + type StringValue struct + func DecodeStringBlock(block []byte, a *[]StringValue) ([]StringValue, error) + func (v StringValue) Size() int + func (v StringValue) String() string + func (v StringValue) UnixNano() int64 + func (v StringValue) Value() interface{} + type StringValues []StringValue + func (a StringValues) Deduplicate() StringValues + func (a StringValues) Encode(buf []byte) ([]byte, error) + func (a StringValues) Exclude(min, max int64) StringValues + func (a StringValues) FindRange(min, max int64) (int, int) + func (a StringValues) Include(min, max int64) StringValues + func (a StringValues) Len() int + func (a StringValues) Less(i, j int) bool + func (a StringValues) MaxTime() int64 + func (a StringValues) Merge(b StringValues) StringValues + func (a StringValues) MinTime() int64 + func (a StringValues) Size() int + func (a StringValues) Swap(i, j int) + type TSMFile interface + BatchDelete func() BatchDeleter + BlockIterator func() *BlockIterator + Close func() error + Contains func(key []byte) bool + ContainsValue func(key []byte, t int64) bool + Delete func(keys [][]byte) error + DeleteRange func(keys [][]byte, min, max int64) error + Entries func(key []byte) []IndexEntry + Free func() error + HasTombstones func() bool + InUse func() bool + KeyAt func(idx int) ([]byte, byte) + KeyCount func() int + KeyRange func() ([]byte, []byte) + OverlapsKeyRange func(min, max []byte) bool + OverlapsTimeRange func(min, max int64) bool + Path func() string + Read func(key []byte, t int64) ([]Value, error) + ReadAt func(entry *IndexEntry, values []Value) ([]Value, error) + ReadBooleanArrayBlockAt func(entry *IndexEntry, values *tsdb.BooleanArray) error + ReadBooleanBlockAt func(entry *IndexEntry, values *[]BooleanValue) ([]BooleanValue, error) + ReadEntries func(key []byte, entries *[]IndexEntry) []IndexEntry + ReadFloatArrayBlockAt func(entry *IndexEntry, values *tsdb.FloatArray) error + ReadFloatBlockAt func(entry *IndexEntry, values *[]FloatValue) ([]FloatValue, error) + ReadIntegerArrayBlockAt func(entry *IndexEntry, values *tsdb.IntegerArray) error + ReadIntegerBlockAt func(entry *IndexEntry, values *[]IntegerValue) ([]IntegerValue, error) + ReadStringArrayBlockAt func(entry *IndexEntry, values *tsdb.StringArray) error + ReadStringBlockAt func(entry *IndexEntry, values *[]StringValue) ([]StringValue, error) + ReadUnsignedArrayBlockAt func(entry *IndexEntry, values *tsdb.UnsignedArray) error + ReadUnsignedBlockAt func(entry *IndexEntry, values *[]UnsignedValue) ([]UnsignedValue, error) + Ref func() + Remove func() error + Rename func(path string) error + Seek func(key []byte) int + Size func() uint32 + Stats func() FileStat + TimeRange func() (int64, int64) + TombstoneFiles func() []FileStat + TombstoneRange func(key []byte) []TimeRange + Type func(key []byte) (byte, error) + Unref func() + type TSMIndex interface + Close func() error + Contains func(key []byte) bool + ContainsKey func(key []byte) bool + ContainsValue func(key []byte, timestamp int64) bool + Delete func(keys [][]byte) + DeleteRange func(keys [][]byte, minTime, maxTime int64) + Entries func(key []byte) []IndexEntry + Entry func(key []byte, timestamp int64) *IndexEntry + Key func(index int, entries *[]IndexEntry) ([]byte, byte, []IndexEntry) + KeyAt func(index int) ([]byte, byte) + KeyCount func() int + KeyRange func() ([]byte, []byte) + OverlapsKeyRange func(min, max []byte) bool + OverlapsTimeRange func(min, max int64) bool + ReadEntries func(key []byte, entries *[]IndexEntry) []IndexEntry + Seek func(key []byte) int + Size func() uint32 + TimeRange func() (int64, int64) + TombstoneRange func(key []byte) []TimeRange + Type func(key []byte) (byte, error) + UnmarshalBinary func(b []byte) error + type TSMReader struct + func NewTSMReader(f *os.File, options ...tsmReaderOption) (*TSMReader, error) + func (r *TSMReader) BatchDelete() BatchDeleter + func (t *TSMReader) BlockIterator() *BlockIterator + func (t *TSMReader) Close() error + func (t *TSMReader) Contains(key []byte) bool + func (t *TSMReader) ContainsValue(key []byte, ts int64) bool + func (t *TSMReader) Delete(keys [][]byte) error + func (t *TSMReader) DeleteRange(keys [][]byte, minTime, maxTime int64) error + func (t *TSMReader) Entries(key []byte) []IndexEntry + func (t *TSMReader) Free() error + func (t *TSMReader) HasTombstones() bool + func (t *TSMReader) InUse() bool + func (t *TSMReader) IndexSize() uint32 + func (t *TSMReader) Key(index int, entries *[]IndexEntry) ([]byte, byte, []IndexEntry) + func (t *TSMReader) KeyAt(idx int) ([]byte, byte) + func (t *TSMReader) KeyCount() int + func (t *TSMReader) KeyRange() ([]byte, []byte) + func (t *TSMReader) LastModified() int64 + func (t *TSMReader) OverlapsKeyRange(min, max []byte) bool + func (t *TSMReader) OverlapsTimeRange(min, max int64) bool + func (t *TSMReader) Path() string + func (t *TSMReader) Read(key []byte, timestamp int64) ([]Value, error) + func (t *TSMReader) ReadAll(key []byte) ([]Value, error) + func (t *TSMReader) ReadAt(entry *IndexEntry, vals []Value) ([]Value, error) + func (t *TSMReader) ReadBooleanArrayBlockAt(entry *IndexEntry, vals *tsdb.BooleanArray) error + func (t *TSMReader) ReadBooleanBlockAt(entry *IndexEntry, vals *[]BooleanValue) ([]BooleanValue, error) + func (t *TSMReader) ReadBytes(e *IndexEntry, b []byte) (uint32, []byte, error) + func (t *TSMReader) ReadEntries(key []byte, entries *[]IndexEntry) []IndexEntry + func (t *TSMReader) ReadFloatArrayBlockAt(entry *IndexEntry, vals *tsdb.FloatArray) error + func (t *TSMReader) ReadFloatBlockAt(entry *IndexEntry, vals *[]FloatValue) ([]FloatValue, error) + func (t *TSMReader) ReadIntegerArrayBlockAt(entry *IndexEntry, vals *tsdb.IntegerArray) error + func (t *TSMReader) ReadIntegerBlockAt(entry *IndexEntry, vals *[]IntegerValue) ([]IntegerValue, error) + func (t *TSMReader) ReadStringArrayBlockAt(entry *IndexEntry, vals *tsdb.StringArray) error + func (t *TSMReader) ReadStringBlockAt(entry *IndexEntry, vals *[]StringValue) ([]StringValue, error) + func (t *TSMReader) ReadUnsignedArrayBlockAt(entry *IndexEntry, vals *tsdb.UnsignedArray) error + func (t *TSMReader) ReadUnsignedBlockAt(entry *IndexEntry, vals *[]UnsignedValue) ([]UnsignedValue, error) + func (t *TSMReader) Ref() + func (t *TSMReader) Remove() error + func (t *TSMReader) Rename(path string) error + func (t *TSMReader) Seek(key []byte) int + func (t *TSMReader) Size() uint32 + func (t *TSMReader) Stats() FileStat + func (t *TSMReader) TimeRange() (int64, int64) + func (t *TSMReader) TombstoneFiles() []FileStat + func (t *TSMReader) TombstoneRange(key []byte) []TimeRange + func (t *TSMReader) Type(key []byte) (byte, error) + func (t *TSMReader) Unref() + func (t *TSMReader) WithObserver(obs tsdb.FileStoreObserver) + type TSMWriter interface + Close func() error + Flush func() error + Remove func() error + Size func() uint32 + Write func(key []byte, values Values) error + WriteBlock func(key []byte, minTime, maxTime int64, block []byte) error + WriteIndex func() error + func NewTSMWriter(w io.Writer) (TSMWriter, error) + func NewTSMWriterWithDiskBuffer(w io.Writer) (TSMWriter, error) + type TimeDecoder struct + func (d *TimeDecoder) Error() error + func (d *TimeDecoder) Init(b []byte) + func (d *TimeDecoder) Next() bool + func (d *TimeDecoder) Read() int64 + type TimeEncoder interface + Bytes func() ([]byte, error) + Reset func() + Write func(t int64) + func NewTimeEncoder(sz int) TimeEncoder + type TimeRange struct + Max int64 + Min int64 + func (t TimeRange) Overlaps(min, max int64) bool + type Tombstone struct + Key []byte + Max int64 + Min int64 + type Tombstoner struct + FilterFn func(k []byte) bool + Path string + func NewTombstoner(path string, filterFn func(k []byte) bool) *Tombstoner + func (t *Tombstoner) Add(keys [][]byte) error + func (t *Tombstoner) AddRange(keys [][]byte, min, max int64) error + func (t *Tombstoner) Delete() error + func (t *Tombstoner) Flush() error + func (t *Tombstoner) HasTombstones() bool + func (t *Tombstoner) Rollback() error + func (t *Tombstoner) TombstoneFiles() []FileStat + func (t *Tombstoner) Walk(fn func(t Tombstone) error) error + func (t *Tombstoner) WithObserver(obs tsdb.FileStoreObserver) + type UnsignedValue struct + func DecodeUnsignedBlock(block []byte, a *[]UnsignedValue) ([]UnsignedValue, error) + func (v UnsignedValue) Size() int + func (v UnsignedValue) String() string + func (v UnsignedValue) UnixNano() int64 + func (v UnsignedValue) Value() interface{} + type UnsignedValues []UnsignedValue + func (a UnsignedValues) Deduplicate() UnsignedValues + func (a UnsignedValues) Encode(buf []byte) ([]byte, error) + func (a UnsignedValues) Exclude(min, max int64) UnsignedValues + func (a UnsignedValues) FindRange(min, max int64) (int, int) + func (a UnsignedValues) Include(min, max int64) UnsignedValues + func (a UnsignedValues) Len() int + func (a UnsignedValues) Less(i, j int) bool + func (a UnsignedValues) MaxTime() int64 + func (a UnsignedValues) Merge(b UnsignedValues) UnsignedValues + func (a UnsignedValues) MinTime() int64 + func (a UnsignedValues) Size() int + func (a UnsignedValues) Swap(i, j int) + type Value interface + Size func() int + String func() string + UnixNano func() int64 + Value func() interface{} + func DecodeBlock(block []byte, vals []Value) ([]Value, error) + func NewBooleanValue(t int64, v bool) Value + func NewFloatValue(t int64, v float64) Value + func NewIntegerValue(t int64, v int64) Value + func NewStringValue(t int64, v string) Value + func NewUnsignedValue(t int64, v uint64) Value + func NewValue(t int64, value interface{}) Value + type Values []Value + func (a Values) CnosQLType() (cnosql.DataType, error) + func (a Values) Deduplicate() Values + func (a Values) Encode(buf []byte) ([]byte, error) + func (a Values) Exclude(min, max int64) Values + func (a Values) FindRange(min, max int64) (int, int) + func (a Values) Include(min, max int64) Values + func (a Values) Len() int + func (a Values) Less(i, j int) bool + func (a Values) MaxTime() int64 + func (a Values) Merge(b Values) Values + func (a Values) MinTime() int64 + func (a Values) Size() int + func (a Values) Swap(i, j int) + type WAL struct + SegmentSize int + func NewWAL(path string) *WAL + func (l *WAL) Close() error + func (l *WAL) CloseSegment() error + func (l *WAL) ClosedSegments() ([]string, error) + func (l *WAL) Delete(keys [][]byte) (int, error) + func (l *WAL) DeleteRange(keys [][]byte, min, max int64) (int, error) + func (l *WAL) DiskSizeBytes() int64 + func (l *WAL) LastWriteTime() time.Time + func (l *WAL) Open() error + func (l *WAL) Path() string + func (l *WAL) Remove(files []string) error + func (l *WAL) Statistics(tags map[string]string) []models.Statistic + func (l *WAL) WithLogger(log *zap.Logger) + func (l *WAL) WriteMulti(values map[string][]Value) (int, error) + type WALEntry interface + Encode func(dst []byte) ([]byte, error) + MarshalBinary func() ([]byte, error) + MarshalSize func() int + Type func() WalEntryType + UnmarshalBinary func(b []byte) error + type WALSegmentReader struct + func NewWALSegmentReader(r io.ReadCloser) *WALSegmentReader + func (r *WALSegmentReader) Close() error + func (r *WALSegmentReader) Count() int64 + func (r *WALSegmentReader) Error() error + func (r *WALSegmentReader) Next() bool + func (r *WALSegmentReader) Read() (WALEntry, error) + func (r *WALSegmentReader) Reset(rc io.ReadCloser) + type WALSegmentWriter struct + func NewWALSegmentWriter(w io.WriteCloser) *WALSegmentWriter + func (w *WALSegmentWriter) Flush() error + func (w *WALSegmentWriter) Write(entryType WalEntryType, compressed []byte) error + type WALStatistics struct + CurrentBytes int64 + OldBytes int64 + WriteErr int64 + WriteOK int64 + type WalEntryType byte + const DeleteRangeWALEntryType + const DeleteWALEntryType + const WriteWALEntryType + type WriteWALEntry struct + Values map[string][]Value + func (w *WriteWALEntry) Encode(dst []byte) ([]byte, error) + func (w *WriteWALEntry) MarshalBinary() ([]byte, error) + func (w *WriteWALEntry) MarshalSize() int + func (w *WriteWALEntry) Type() WalEntryType + func (w *WriteWALEntry) UnmarshalBinary(b []byte) error