Versions in this module Expand all Collapse all v1 v1.7.9 Oct 27, 2019 Changes in this version + const CompactingExt + const FileSignature + const IndexFileExt + const IndexFileTrailerSize + const IndexFileVersion + const IndexFileVersionSize + const IndexName + const LoadFactor + const LogEntryMeasurementTombstoneFlag + const LogEntrySeriesTombstoneFlag + const LogEntryTagKeyTombstoneFlag + const LogEntryTagValueTombstoneFlag + const LogFileExt + const ManifestFileName + const MaxIndexFileSize + const MaxIndexMergeCount + const MeasurementBlockVersion + const MeasurementFillSize + const MeasurementNSize + const MeasurementOffsetSize + const MeasurementSeriesIDSetFlag + const MeasurementTombstoneFlag + const MeasurementTrailerSize + const SeriesIDSize + const TagBlockTrailerSize + const TagBlockVersion + const TagKeyNSize + const TagKeyOffsetSize + const TagKeyTombstoneFlag + const TagValueNSize + const TagValueOffsetSize + const TagValueSeriesIDSetFlag + const TagValueTombstoneFlag + const Version + var DefaultCompactionLevels = []CompactionLevel + var DefaultPartitionN uint64 = 8 + var DisableCompactions = func() IndexOption + var DisableFsync = func() IndexOption + var ErrCompactionInterrupted = errors.New("tsi1: compaction interrupted") + var ErrIncompatibleVersion = errors.New("incompatible tsi1 index MANIFEST") + var ErrInvalidIndexFile = errors.New("invalid index file") + var ErrLogEntryChecksumMismatch = errors.New("log entry checksum mismatch") + var ErrMeasurementBlockSizeMismatch = errors.New("measurement block size mismatch") + var ErrTagBlockSizeMismatch = errors.New("tag block size mismatch") + var ErrUnsupportedIndexFileVersion = errors.New("unsupported index file version") + var ErrUnsupportedMeasurementBlockVersion = errors.New("unsupported measurement block version") + var ErrUnsupportedTagBlockVersion = errors.New("unsupported tag block version") + var WithLogFileBufferSize = func(sz int) IndexOption + var WithLogger = func(l zap.Logger) IndexOption + var WithMaximumLogFileSize = func(size int64) IndexOption + var WithPath = func(path string) IndexOption + var WithSeriesIDCacheSize = func(sz int) IndexOption + func FormatIndexFileName(id, level int) string + func FormatLogFileName(id int) string + func IsIndexDir(path string) (bool, error) + func IsPartitionDir(path string) (bool, error) + func NewTSDBMeasurementIteratorAdapter(itr MeasurementIterator) tsdb.MeasurementIterator + func NewTSDBTagKeyIteratorAdapter(itr TagKeyIterator) tsdb.TagKeyIterator + func NewTSDBTagValueIteratorAdapter(itr TagValueIterator) tsdb.TagValueIterator + func ParseFilename(name string) (level, id int) + type CompactionLevel struct + K uint64 + M uint64 + type File interface + Close func() error + ID func() int + Level func() int + Measurement func(name []byte) MeasurementElem + MeasurementHasSeries func(ss *tsdb.SeriesIDSet, name []byte) bool + MeasurementIterator func() MeasurementIterator + MeasurementSeriesIDIterator func(name []byte) tsdb.SeriesIDIterator + MeasurementsSketches func() (s, t estimator.Sketch, err error) + Path func() string + Release func() + Retain func() + SeriesIDSet func() (*tsdb.SeriesIDSet, error) + SeriesSketches func() (s, t estimator.Sketch, err error) + Size func() int64 + TagKey func(name, key []byte) TagKeyElem + TagKeyIterator func(name []byte) TagKeyIterator + TagKeySeriesIDIterator func(name, key []byte) tsdb.SeriesIDIterator + TagValue func(name, key, value []byte) TagValueElem + TagValueIterator func(name, key []byte) TagValueIterator + TagValueSeriesIDSet func(name, key, value []byte) (*tsdb.SeriesIDSet, error) + TombstoneSeriesIDSet func() (*tsdb.SeriesIDSet, error) + type FileSet struct + func NewFileSet(levels []CompactionLevel, sfile *tsdb.SeriesFile, files []File) (*FileSet, error) + func (fs *FileSet) Files() []File + func (fs *FileSet) HasTagKey(name, key []byte) bool + func (fs *FileSet) HasTagValue(name, key, value []byte) bool + func (fs *FileSet) IndexFiles() []*IndexFile + func (fs *FileSet) LastContiguousIndexFilesByLevel(level int) []*IndexFile + func (fs *FileSet) LogFiles() []*LogFile + func (fs *FileSet) MaxID() int + func (fs *FileSet) Measurement(name []byte) MeasurementElem + func (fs *FileSet) MeasurementIterator() MeasurementIterator + func (fs *FileSet) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator + func (fs *FileSet) MeasurementTagKeysByExpr(name []byte, expr influxql.Expr) (map[string]struct{}, error) + func (fs *FileSet) MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error) + func (fs *FileSet) MustReplace(oldFiles []File, newFile File) *FileSet + func (fs *FileSet) PrependLogFile(f *LogFile) *FileSet + func (fs *FileSet) Release() + func (fs *FileSet) Retain() + func (fs *FileSet) SeriesFile() *tsdb.SeriesFile + func (fs *FileSet) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) + func (fs *FileSet) Size() int64 + func (fs *FileSet) TagKeyIterator(name []byte) TagKeyIterator + func (fs *FileSet) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator + func (fs *FileSet) TagValueIterator(name, key []byte) TagValueIterator + func (fs *FileSet) TagValueSeriesIDIterator(name, key, value []byte) (tsdb.SeriesIDIterator, error) + func (fs FileSet) Close() error + type Files []File + func (a Files) IDs() []int + type Index struct + PartitionN uint64 + func NewIndex(sfile *tsdb.SeriesFile, database string, options ...IndexOption) *Index + func (i *Index) Bytes() int + func (i *Index) Close() error + func (i *Index) Compact() + func (i *Index) CreateSeriesIfNotExists(key, name []byte, tags models.Tags) error + func (i *Index) CreateSeriesListIfNotExists(keys [][]byte, names [][]byte, tagsSlice []models.Tags) error + func (i *Index) Database() string + func (i *Index) DisableCompactions() + func (i *Index) DiskSizeBytes() int64 + func (i *Index) DropMeasurement(name []byte) error + func (i *Index) DropMeasurementIfSeriesNotExist(name []byte) (bool, error) + func (i *Index) DropSeries(seriesID uint64, key []byte, cascade bool) error + func (i *Index) DropSeriesGlobal(key []byte) error + func (i *Index) EnableCompactions() + func (i *Index) FieldSet() *tsdb.MeasurementFieldSet + func (i *Index) ForEachMeasurementName(fn func(name []byte) error) error + func (i *Index) HasTagKey(name, key []byte) (bool, error) + func (i *Index) HasTagValue(name, key, value []byte) (bool, error) + func (i *Index) InitializeSeries(keys, names [][]byte, tags []models.Tags) error + func (i *Index) MeasurementExists(name []byte) (bool, error) + func (i *Index) MeasurementHasSeries(name []byte) (bool, error) + func (i *Index) MeasurementIterator() (tsdb.MeasurementIterator, error) + func (i *Index) MeasurementNamesByRegex(re *regexp.Regexp) ([][]byte, error) + func (i *Index) MeasurementSeriesIDIterator(name []byte) (tsdb.SeriesIDIterator, error) + func (i *Index) MeasurementTagKeysByExpr(name []byte, expr influxql.Expr) (map[string]struct{}, error) + func (i *Index) MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error) + func (i *Index) Open() error + func (i *Index) PartitionAt(index int) *Partition + func (i *Index) Path() string + func (i *Index) Rebuild() + func (i *Index) RetainFileSet() (*FileSet, error) + func (i *Index) SeriesFile() *tsdb.SeriesFile + func (i *Index) SeriesIDSet() *tsdb.SeriesIDSet + func (i *Index) SeriesN() int64 + func (i *Index) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) + func (i *Index) SetFieldName(measurement []byte, name string) + func (i *Index) SetFieldSet(fs *tsdb.MeasurementFieldSet) + func (i *Index) TagKeyCardinality(name, key []byte) int + func (i *Index) TagKeyIterator(name []byte) (tsdb.TagKeyIterator, error) + func (i *Index) TagKeySeriesIDIterator(name, key []byte) (tsdb.SeriesIDIterator, error) + func (i *Index) TagValueIterator(name, key []byte) (tsdb.TagValueIterator, error) + func (i *Index) TagValueSeriesIDIterator(name, key, value []byte) (tsdb.SeriesIDIterator, error) + func (i *Index) Type() string + func (i *Index) UniqueReferenceID() uintptr + func (i *Index) Wait() + func (i *Index) WithLogger(l *zap.Logger) + type IndexFile struct + func NewIndexFile(sfile *tsdb.SeriesFile) *IndexFile + func (f *IndexFile) Close() error + func (f *IndexFile) Compacting() bool + func (f *IndexFile) HasSeries(name []byte, tags models.Tags, buf []byte) (exists, tombstoned bool) + func (f *IndexFile) ID() int + func (f *IndexFile) Level() int + func (f *IndexFile) Measurement(name []byte) MeasurementElem + func (f *IndexFile) MeasurementHasSeries(ss *tsdb.SeriesIDSet, name []byte) (ok bool) + func (f *IndexFile) MeasurementIterator() MeasurementIterator + func (f *IndexFile) MeasurementN() (n uint64) + func (f *IndexFile) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator + func (f *IndexFile) MeasurementsSketches() (sketch, tSketch estimator.Sketch, err error) + func (f *IndexFile) Open() error + func (f *IndexFile) Path() string + func (f *IndexFile) Release() + func (f *IndexFile) Retain() + func (f *IndexFile) SeriesIDSet() (*tsdb.SeriesIDSet, error) + func (f *IndexFile) SeriesSketches() (sketch, tSketch estimator.Sketch, err error) + func (f *IndexFile) SetPath(path string) + func (f *IndexFile) Size() int64 + func (f *IndexFile) TagKey(name, key []byte) TagKeyElem + func (f *IndexFile) TagKeyIterator(name []byte) TagKeyIterator + func (f *IndexFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator + func (f *IndexFile) TagValue(name, key, value []byte) TagValueElem + func (f *IndexFile) TagValueElem(name, key, value []byte) TagValueElem + func (f *IndexFile) TagValueIterator(name, key []byte) TagValueIterator + func (f *IndexFile) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) + func (f *IndexFile) TombstoneSeriesIDSet() (*tsdb.SeriesIDSet, error) + func (f *IndexFile) UnmarshalBinary(data []byte) error + type IndexFileTrailer struct + MeasurementBlock struct{ ... } + SeriesIDSet struct{ ... } + SeriesSketch struct{ ... } + TombstoneSeriesIDSet struct{ ... } + TombstoneSeriesSketch struct{ ... } + Version int + func ReadIndexFileTrailer(data []byte) (IndexFileTrailer, error) + func (t *IndexFileTrailer) WriteTo(w io.Writer) (n int64, err error) + type IndexFiles []*IndexFile + func (p *IndexFiles) MeasurementNames() [][]byte + func (p *IndexFiles) TagKeyIterator(name []byte) (TagKeyIterator, error) + func (p IndexFiles) CompactTo(w io.Writer, sfile *tsdb.SeriesFile, m, k uint64, cancel <-chan struct{}) (n int64, err error) + func (p IndexFiles) Files() []File + func (p IndexFiles) IDs() []int + func (p IndexFiles) MeasurementIterator() MeasurementIterator + func (p IndexFiles) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator + func (p IndexFiles) Release() + func (p IndexFiles) Retain() + func (p IndexFiles) Stat() (*IndexFilesInfo, error) + func (p IndexFiles) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) + type IndexFilesInfo struct + MaxSize int64 + ModTime time.Time + Size int64 + type IndexOption func(i *Index) + type LogEntry struct + Checksum uint32 + Flag byte + Key []byte + Name []byte + SeriesID uint64 + Size int + Value []byte + func (e *LogEntry) UnmarshalBinary(data []byte) error + type LogFile struct + func NewLogFile(sfile *tsdb.SeriesFile, path string) *LogFile + func (f *LogFile) AddSeriesList(seriesSet *tsdb.SeriesIDSet, names [][]byte, tagsSlice []models.Tags) ([]uint64, error) + func (f *LogFile) Close() error + func (f *LogFile) CompactTo(w io.Writer, m, k uint64, cancel <-chan struct{}) (n int64, err error) + func (f *LogFile) DeleteMeasurement(name []byte) error + func (f *LogFile) DeleteSeriesID(id uint64) error + func (f *LogFile) DeleteTagKey(name, key []byte) error + func (f *LogFile) DeleteTagValue(name, key, value []byte) error + func (f *LogFile) Filter() *bloom.Filter + func (f *LogFile) FlushAndSync() error + func (f *LogFile) ID() int + func (f *LogFile) Level() int + func (f *LogFile) Measurement(name []byte) MeasurementElem + func (f *LogFile) MeasurementHasSeries(ss *tsdb.SeriesIDSet, name []byte) bool + func (f *LogFile) MeasurementIterator() MeasurementIterator + func (f *LogFile) MeasurementN() (n uint64) + func (f *LogFile) MeasurementNames() []string + func (f *LogFile) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator + func (f *LogFile) MeasurementsSketches() (sketch, tSketch estimator.Sketch, err error) + func (f *LogFile) Open() error + func (f *LogFile) Path() string + func (f *LogFile) Release() + func (f *LogFile) Retain() + func (f *LogFile) SeriesIDIterator() tsdb.SeriesIDIterator + func (f *LogFile) SeriesIDSet() (*tsdb.SeriesIDSet, error) + func (f *LogFile) SeriesN() (n uint64) + func (f *LogFile) SeriesSketches() (sketch, tSketch estimator.Sketch, err error) + func (f *LogFile) SetPath(path string) + func (f *LogFile) Size() int64 + func (f *LogFile) Stat() (int64, time.Time) + func (f *LogFile) TagKey(name, key []byte) TagKeyElem + func (f *LogFile) TagKeyIterator(name []byte) TagKeyIterator + func (f *LogFile) TagKeyN() (n uint64) + func (f *LogFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator + func (f *LogFile) TagValue(name, key, value []byte) TagValueElem + func (f *LogFile) TagValueIterator(name, key []byte) TagValueIterator + func (f *LogFile) TagValueN() (n uint64) + func (f *LogFile) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) + func (f *LogFile) TombstoneSeriesIDSet() (*tsdb.SeriesIDSet, error) + type Manifest struct + Files []string + Levels []CompactionLevel + Version int + func NewManifest(path string) *Manifest + func ReadManifestFile(path string) (*Manifest, int64, error) + func (m *Manifest) HasFile(name string) bool + func (m *Manifest) Validate() error + func (m *Manifest) Write() (int64, error) + type MeasurementBlock struct + func (blk *MeasurementBlock) Elem(name []byte) (e MeasurementBlockElem, ok bool) + func (blk *MeasurementBlock) Iterator() MeasurementIterator + func (blk *MeasurementBlock) SeriesIDIterator(name []byte) tsdb.SeriesIDIterator + func (blk *MeasurementBlock) Sketches() (sketch, tSketch estimator.Sketch, err error) + func (blk *MeasurementBlock) UnmarshalBinary(data []byte) error + func (blk *MeasurementBlock) Version() int + type MeasurementBlockElem struct + func (e *MeasurementBlockElem) Deleted() bool + func (e *MeasurementBlockElem) ForEachSeriesID(fn func(uint64) error) error + func (e *MeasurementBlockElem) HasSeries() bool + func (e *MeasurementBlockElem) Name() []byte + func (e *MeasurementBlockElem) SeriesData() []byte + func (e *MeasurementBlockElem) SeriesID(i int) uint64 + func (e *MeasurementBlockElem) SeriesIDs() []uint64 + func (e *MeasurementBlockElem) SeriesN() uint64 + func (e *MeasurementBlockElem) Size() int + func (e *MeasurementBlockElem) TagBlockOffset() int64 + func (e *MeasurementBlockElem) TagBlockSize() int64 + func (e *MeasurementBlockElem) UnmarshalBinary(data []byte) error + type MeasurementBlockTrailer struct + Data struct{ ... } + HashIndex struct{ ... } + Sketch struct{ ... } + TSketch struct{ ... } + Version int + func ReadMeasurementBlockTrailer(data []byte) (MeasurementBlockTrailer, error) + func (t *MeasurementBlockTrailer) WriteTo(w io.Writer) (n int64, err error) + type MeasurementBlockWriter struct + func NewMeasurementBlockWriter() *MeasurementBlockWriter + func (mw *MeasurementBlockWriter) Add(name []byte, deleted bool, offset, size int64, seriesIDs []uint64) + func (mw *MeasurementBlockWriter) WriteTo(w io.Writer) (n int64, err error) + type MeasurementElem interface + Deleted func() bool + Name func() []byte + type MeasurementElems []MeasurementElem + func (a MeasurementElems) Len() int + func (a MeasurementElems) Less(i, j int) bool + func (a MeasurementElems) Swap(i, j int) + type MeasurementIterator interface + Next func() MeasurementElem + func MergeMeasurementIterators(itrs ...MeasurementIterator) MeasurementIterator + type Partition struct + MaxLogFileSize int64 + func NewPartition(sfile *tsdb.SeriesFile, path string) *Partition + func (p *Partition) AssignShard(k string, shardID uint64) + func (p *Partition) CheckLogFile() error + func (p *Partition) Close() error + func (p *Partition) Compact() + func (p *Partition) CurrentCompactionN() int + func (p *Partition) DisableCompactions() + func (p *Partition) DropMeasurement(name []byte) error + func (p *Partition) DropSeries(seriesID uint64) error + func (p *Partition) EnableCompactions() + func (p *Partition) FieldSet() *tsdb.MeasurementFieldSet + func (p *Partition) FileN() int + func (p *Partition) ForEachMeasurementName(fn func(name []byte) error) error + func (p *Partition) ForEachMeasurementTagKey(name []byte, fn func(key []byte) error) error + func (p *Partition) HasTagKey(name, key []byte) (bool, error) + func (p *Partition) HasTagValue(name, key, value []byte) (bool, error) + func (p *Partition) Manifest() *Manifest + func (p *Partition) ManifestPath() string + func (p *Partition) MeasurementExists(name []byte) (bool, error) + func (p *Partition) MeasurementHasSeries(name []byte) (bool, error) + func (p *Partition) MeasurementIterator() (tsdb.MeasurementIterator, error) + func (p *Partition) MeasurementNamesByRegex(re *regexp.Regexp) ([][]byte, error) + func (p *Partition) MeasurementSeriesIDIterator(name []byte) (tsdb.SeriesIDIterator, error) + func (p *Partition) MeasurementTagKeysByExpr(name []byte, expr influxql.Expr) (map[string]struct{}, error) + func (p *Partition) MeasurementsSketches() (estimator.Sketch, estimator.Sketch, error) + func (p *Partition) NextSequence() int + func (p *Partition) Open() error + func (p *Partition) Path() string + func (p *Partition) Rebuild() + func (p *Partition) RemoveShard(shardID uint64) + func (p *Partition) RetainFileSet() (*FileSet, error) + func (p *Partition) SeriesFile() *tsdb.SeriesFile + func (p *Partition) SeriesSketches() (estimator.Sketch, estimator.Sketch, error) + func (p *Partition) SetFieldName(measurement []byte, name string) + func (p *Partition) SetFieldSet(fs *tsdb.MeasurementFieldSet) + func (p *Partition) TagKeyCardinality(name, key []byte) int + func (p *Partition) TagKeyIterator(name []byte) tsdb.TagKeyIterator + func (p *Partition) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator + func (p *Partition) TagValueIterator(name, key []byte) tsdb.TagValueIterator + func (p *Partition) TagValueSeriesIDIterator(name, key, value []byte) (tsdb.SeriesIDIterator, error) + func (p *Partition) Wait() + func (p *Partition) WithLogger(logger *zap.Logger) + type TagBlock struct + func (blk *TagBlock) DecodeTagKeyElem(key []byte, elem *TagBlockKeyElem) bool + func (blk *TagBlock) DecodeTagValueElem(key, value []byte, valueElem *TagBlockValueElem) bool + func (blk *TagBlock) TagKeyElem(key []byte) TagKeyElem + func (blk *TagBlock) TagKeyIterator() TagKeyIterator + func (blk *TagBlock) TagValueElem(key, value []byte) TagValueElem + func (blk *TagBlock) UnmarshalBinary(data []byte) error + func (blk *TagBlock) Version() int + type TagBlockEncoder struct + func NewTagBlockEncoder(w io.Writer) *TagBlockEncoder + func (enc *TagBlockEncoder) Close() error + func (enc *TagBlockEncoder) EncodeKey(key []byte, deleted bool) error + func (enc *TagBlockEncoder) EncodeValue(value []byte, deleted bool, ss *tsdb.SeriesIDSet) error + func (enc *TagBlockEncoder) N() int64 + type TagBlockKeyElem struct + func (e *TagBlockKeyElem) Deleted() bool + func (e *TagBlockKeyElem) Key() []byte + func (e *TagBlockKeyElem) TagValueIterator() TagValueIterator + type TagBlockTrailer struct + HashIndex struct{ ... } + KeyData struct{ ... } + Size int64 + ValueData struct{ ... } + Version int + func ReadTagBlockTrailer(data []byte) (TagBlockTrailer, error) + func (t *TagBlockTrailer) WriteTo(w io.Writer) (n int64, err error) + type TagBlockValueElem struct + func (e *TagBlockValueElem) Deleted() bool + func (e *TagBlockValueElem) SeriesData() []byte + func (e *TagBlockValueElem) SeriesID(i int) uint64 + func (e *TagBlockValueElem) SeriesIDSet() (*tsdb.SeriesIDSet, error) + func (e *TagBlockValueElem) SeriesIDs() ([]uint64, error) + func (e *TagBlockValueElem) SeriesN() uint64 + func (e *TagBlockValueElem) Size() int + func (e *TagBlockValueElem) Value() []byte + type TagKeyElem interface + Deleted func() bool + Key func() []byte + TagValueIterator func() TagValueIterator + type TagKeyIterator interface + Next func() TagKeyElem + func MergeTagKeyIterators(itrs ...TagKeyIterator) TagKeyIterator + type TagValueElem interface + Deleted func() bool + Value func() []byte + type TagValueIterator interface + Next func() TagValueElem + func MergeTagValueIterators(itrs ...TagValueIterator) TagValueIterator + type TagValueSeriesIDCache struct + func NewTagValueSeriesIDCache(c int) *TagValueSeriesIDCache + func (c *TagValueSeriesIDCache) Delete(name, key, value []byte, x uint64) + func (c *TagValueSeriesIDCache) Get(name, key, value []byte) *tsdb.SeriesIDSet + func (c *TagValueSeriesIDCache) Put(name, key, value []byte, ss *tsdb.SeriesIDSet)