Documentation ¶
Index ¶
- Constants
- Variables
- func AggregateData(newRec, baseRec *record.Record, ops []*comm.CallOption)
- func CacheDataInMemory() bool
- func CacheMetaInMemory() bool
- func CheckCrc32En() bool
- func CompactRecovery(path string, group *CompactGroup)
- func DecodeBooleanBlock(in []byte, out *[]byte, ctx *CoderContext) ([]bool, error)
- func DecodeFloatBlock(in []byte, out *[]byte, ctx *CoderContext) ([]float64, error)
- func DecodeIntegerBlock(in []byte, out *[]byte, ctx *CoderContext) ([]int64, error)
- func DecodeStringBlock(in []byte, out *[]byte, dstOffset *[]uint32, ctx *CoderContext) ([]byte, []uint32, error)
- func DecodeTimestampBlock(in []byte, out *[]byte, ctx *CoderContext) ([]int64, error)
- func DecodeUnsignedBlock(in []byte, out *[]byte, ctx *CoderContext) ([]uint64, error)
- func EnableMmapRead(en bool)
- func EnableReadCache(readCacheLimit int)
- func EncodeBooleanBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
- func EncodeFloatBlock(in []byte, out []byte, ctx *CoderContext) ([]byte, error)
- func EncodeIntegerBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
- func EncodeStringBlock(in []byte, offset []uint32, out []byte, ctx *CoderContext) ([]byte, error)
- func EncodeTimestampBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
- func EncodeUnsignedBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
- func EstimateBufferSize(recSize int, rows int) int
- func FilterByField(rec *record.Record, filterMap map[string]interface{}, con influxql.Expr, ...) *record.Record
- func FilterByTime(rec *record.Record, tr record.TimeRange) *record.Record
- func FilterByTimeDescend(rec *record.Record, tr record.TimeRange) *record.Record
- func Init()
- func InitDecFunctions()
- func IsInterfaceNil(value interface{}) bool
- func IsTempleFile(name string) bool
- func MaxRowsPerSegment() int
- func MergeFlag() int32
- func MergeRecovery(path string, name string, inputs *OutOfOrderMergeContext)
- func NewDiskFileReader(f fileops.File) *diskFileReader
- func NewDiskWriter(lw NameReadWriterCloser, bufferSize int) *diskWriter
- func NewIndexWriter(indexName string, cacheMeta bool, limitCompact bool) *indexWriter
- func NewMemReaderEvictCtx() *memReaderEvictCtx
- func NewMergeHelper(logger *logger.Logger, tier uint64, name string, path string, ...) *mergeHelper
- func NonStreamingCompaction(fi FilesInfo) bool
- func PutDataCoder(coder DataCoder)
- func PutIDTimePairs(pair *IdTimePairs)
- func PutMsBuilder(msBuilder *MsBuilder)
- func ReleaseColumnBuilder(b PreAggBuilder)
- func RenameTmpFiles(newFiles []TSSPFile) error
- func ResetAggregateData(newRec *record.Record, ops []*comm.CallOption)
- func SegMergeFlag(v int32)
- func SetCacheDataBlock(en bool)
- func SetCacheMetaData(en bool)
- func SetCompactLimit(bytesPerSec int64, burstLimit int64)
- func SetImmTableMaxMemoryPercentage(sysTotalMem, percentage int)
- func SetMaxCompactor(n int)
- func SetMaxFullCompactor(n int)
- func SetMaxRowsPerSegment(maxRowsPerSegmentLimit int)
- func SetMaxSegmentLimit(limit int)
- func SetSnapshotLimit(bytesPerSec int64, burstLimit int64)
- func SnapshotLimit() bool
- func UnrefFiles(files ...TSSPFile)
- func ZSTDCompressBound(srcSize int) int
- func ZigZagDecode(v uint64) int64
- func ZigZagEncode(v int64) uint64
- type Boolean
- type BooleanPreAgg
- type BytesBuffer
- func (w *BytesBuffer) Bytes() []byte
- func (w *BytesBuffer) Len() int
- func (w *BytesBuffer) Read(p []byte) (n int, err error)
- func (w *BytesBuffer) ReadByte() (b byte, err error)
- func (w *BytesBuffer) Reset(b []byte)
- func (w *BytesBuffer) Write(p []byte) (n int, err error)
- func (w *BytesBuffer) WriteByte(b byte) error
- type ChunkDataBuilder
- type ChunkIterator
- type ChunkIterators
- func (c *ChunkIterators) Close()
- func (c *ChunkIterators) Len() int
- func (c *ChunkIterators) Less(i, j int) bool
- func (c *ChunkIterators) Next() (uint64, *record.Record, error)
- func (c *ChunkIterators) Pop() interface{}
- func (c *ChunkIterators) Push(v interface{})
- func (c *ChunkIterators) Swap(i, j int)
- func (c *ChunkIterators) WithLog(log *Log.Logger)
- type ChunkMeta
- type CoderContext
- type ColumnBuilder
- type ColumnMeta
- type ColumnReader
- type CompactGroup
- type CompactedFileInfo
- type Config
- type DataCoder
- type DiskFileReader
- type FileIterator
- type FileIterators
- type FileWriter
- type FilesInfo
- type FilterOptions
- type Float
- type FloatPreAgg
- type IdTimePairs
- func (p *IdTimePairs) Add(id uint64, tm int64)
- func (p *IdTimePairs) AddRowCounts(rowCounts int64)
- func (p *IdTimePairs) Len() int
- func (p *IdTimePairs) Marshal(isOrder bool, dst []byte, ctx *CoderContext) []byte
- func (p *IdTimePairs) Reset(name string)
- func (p *IdTimePairs) Unmarshal(isOrder bool, src []byte) ([]byte, error)
- type InMerge
- type Integer
- type IntegerPreAgg
- type LimitWriter
- type Limiter
- type Location
- func (l *Location) Contains(sid uint64, tr record.TimeRange) (bool, error)
- func (l *Location) GetChunkMeta() *ChunkMeta
- func (l *Location) Next() bool
- func (l *Location) ReadData(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
- func (l *Location) ReadDone()
- func (l *Location) ResetMeta()
- type LocationCursor
- func (l *LocationCursor) AddLocation(loc *Location)
- func (l *LocationCursor) AddRef()
- func (l LocationCursor) Len() int
- func (l LocationCursor) Less(i, j int) bool
- func (l *LocationCursor) ReadData(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
- func (l *LocationCursor) ReadMeta(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
- func (l *LocationCursor) ReadOutOfOrderMeta(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
- func (l LocationCursor) Reverse()
- func (l LocationCursor) Swap(i, j int)
- func (l *LocationCursor) Unref()
- type MemBlock
- func (mb *MemBlock) AppendDataBlock(srcData []byte)
- func (mb *MemBlock) CopyBlocks(src MemoryReader)
- func (mb *MemBlock) DataBlocks() [][]byte
- func (mb *MemBlock) DataInMemory() bool
- func (mb *MemBlock) FreeMemory() int64
- func (mb *MemBlock) LoadIntoMemory(dr DiskFileReader, tr *Trailer, metaIndexItems []MetaIndex) error
- func (mb *MemBlock) MetaBlocks() [][]byte
- func (mb *MemBlock) MetaInMemory() bool
- func (mb *MemBlock) ReadChunkMetaBlock(metaIdx int, sid uint64, count uint32) []byte
- func (mb *MemBlock) ReadDataBlock(offset int64, size uint32, dstPtr *[]byte) ([]byte, error)
- func (mb *MemBlock) ReserveDataBlock(n int)
- func (mb *MemBlock) ReserveMetaBlock(n int)
- func (mb *MemBlock) Reset()
- func (mb *MemBlock) SetMetaBlocks(blocks [][]byte)
- func (mb *MemBlock) Size() int64
- type MemoryReader
- type MetaIndex
- type MmsIdTime
- type MmsReaders
- type MmsTables
- func (m *MmsTables) AddRowCountsBySid(measurement string, sid uint64, rowCounts int64)
- func (m *MmsTables) AddTSSPFiles(name string, isOrder bool, files ...TSSPFile)
- func (m *MmsTables) AddTable(mb *MsBuilder, isOrder bool, tmp bool)
- func (m *MmsTables) Close() error
- func (m *MmsTables) CompactDone(files []string)
- func (m *MmsTables) CompactionDisable()
- func (m *MmsTables) CompactionEnable()
- func (m *MmsTables) CompactionEnabled() bool
- func (m *MmsTables) DropMeasurement(_ context.Context, name string) error
- func (m *MmsTables) File(mstName string, fileName string, isOrder bool) TSSPFile
- func (m *MmsTables) FreeAllMemReader()
- func (m *MmsTables) FullCompact(shid uint64) error
- func (m *MmsTables) GetFilesRef(measurement string, isOrder bool) []TSSPFile
- func (m *MmsTables) GetFilesRefByAscending(measurement string, isOrder bool, ascending bool, tr record.TimeRange) []TSSPFile
- func (m *MmsTables) GetLastFlushTimeBySid(measurement string, sid uint64) int64
- func (m *MmsTables) GetMstFileStat() *statistics.FileStat
- func (m *MmsTables) GetOutOfOrderFileNum() int
- func (m *MmsTables) GetRowCountsBySid(measurement string, sid uint64) int64
- func (m *MmsTables) LevelCompact(level uint16, shid uint64) error
- func (m *MmsTables) LevelPlan(level uint16) []*CompactGroup
- func (m *MmsTables) MergeDisable()
- func (m *MmsTables) MergeEnable()
- func (m *MmsTables) MergeEnabled() bool
- func (m *MmsTables) MergeOutOfOrder(shId uint64) error
- func (m *MmsTables) NewChunkIterators(group FilesInfo) (*ChunkIterators, error)
- func (m *MmsTables) NewFileIterators(group *CompactGroup) (FilesInfo, error)
- func (m *MmsTables) NewStreamIterators(group FilesInfo) (*StreamIterators, error)
- func (m *MmsTables) NextSequence() uint64
- func (m *MmsTables) Open() (int64, int64, error)
- func (m *MmsTables) ReplaceFiles(name string, oldFiles, newFiles []TSSPFile, isOrder bool, log *Log.Logger) (err error)
- func (m *MmsTables) Sequencer() *Sequencer
- func (m *MmsTables) Tier() uint64
- func (m *MmsTables) Wait()
- type MsBuilder
- func (b *MsBuilder) FileVersion() uint64
- func (b *MsBuilder) Flush() error
- func (b *MsBuilder) MaxRowsPerSegment() int
- func (b *MsBuilder) Name() string
- func (b *MsBuilder) NewTSSPFile(tmp bool) (TSSPFile, error)
- func (b *MsBuilder) Reset()
- func (b *MsBuilder) Size() int64
- func (b *MsBuilder) WithLog(log *Log.Logger)
- func (b *MsBuilder) WriteData(id uint64, data *record.Record) error
- func (b *MsBuilder) WriteRecord(id uint64, data *record.Record, ...) (*MsBuilder, error)
- type MsBuilderPool
- type NameReadWriterCloser
- type OrderInfo
- type OutOfOrderMergeContext
- type PreAggBuilder
- type PreAggBuilders
- type ReadContext
- func (d *ReadContext) GetOps() []*comm.CallOption
- func (d *ReadContext) InitPreAggBuilder()
- func (d *ReadContext) MatchPreAgg() bool
- func (d *ReadContext) Release()
- func (d *ReadContext) Reset()
- func (d *ReadContext) Set(ascending bool, tr record.TimeRange, onlyFirstOrLast bool, ...)
- func (d *ReadContext) SetOps(c []*comm.CallOption)
- func (d *ReadContext) SetTr(tr record.TimeRange)
- type Segment
- type SegmentRange
- type Sequencer
- type StreamIterator
- type StreamIterators
- func (c *StreamIterators) Close()
- func (c *StreamIterators) FileVersion() uint64
- func (c *StreamIterators) Flush() error
- func (c *StreamIterators) Init(id uint64, chunkDataOffset int64, schema record.Schemas)
- func (c *StreamIterators) Len() int
- func (c *StreamIterators) Less(i, j int) bool
- func (c *StreamIterators) NewFile(addFileExt bool) error
- func (c *StreamIterators) NewTSSPFile(tmp bool) (TSSPFile, error)
- func (c *StreamIterators) Pop() interface{}
- func (c *StreamIterators) Push(v interface{})
- func (c *StreamIterators) Size() int64
- func (c *StreamIterators) Swap(i, j int)
- func (c *StreamIterators) WithLog(log *Log.Logger)
- type StreamIteratorsPool
- type String
- type StringPreAgg
- type TSSPFile
- type TSSPFileName
- func (n *TSSPFileName) Equal(other *TSSPFileName) bool
- func (n *TSSPFileName) ParseFileName(name string) error
- func (n *TSSPFileName) Path(dir string, tmp bool) string
- func (n *TSSPFileName) SetExtend(extend uint16)
- func (n *TSSPFileName) SetLevel(l uint16)
- func (n *TSSPFileName) SetMerge(merge uint16)
- func (n *TSSPFileName) SetOrder(v bool)
- func (n *TSSPFileName) SetSeq(seq uint64)
- func (n *TSSPFileName) String() string
- func (n *TSSPFileName) TmpPath(dir string) string
- type TSSPFileReader
- func (r *TSSPFileReader) AverageChunkRows() int
- func (r *TSSPFileReader) BlockHeader(meta *ChunkMeta, dst []record.Field) ([]record.Field, error)
- func (r *TSSPFileReader) ChunkMeta(id uint64, offset int64, size, itemCount uint32, metaIdx int, dst *ChunkMeta) (*ChunkMeta, error)
- func (r *TSSPFileReader) ChunkMetaAt(index int) (*ChunkMeta, error)
- func (r *TSSPFileReader) Close() error
- func (r *TSSPFileReader) Contains(id uint64, tm record.TimeRange) bool
- func (r *TSSPFileReader) ContainsId(id uint64) bool
- func (r *TSSPFileReader) ContainsTime(tm record.TimeRange) bool
- func (r *TSSPFileReader) CreateTime() int64
- func (r *TSSPFileReader) FileName() string
- func (r *TSSPFileReader) FileSize() int64
- func (r *TSSPFileReader) FreeMemory() int64
- func (r *TSSPFileReader) GetTSSPFileBytes(offset int64, size uint32, buf *[]byte) ([]byte, error)
- func (r *TSSPFileReader) InMemSize() int64
- func (r *TSSPFileReader) LoadIndex() error
- func (r *TSSPFileReader) LoadIntoMemory() error
- func (r *TSSPFileReader) MaxChunkRows() int
- func (r *TSSPFileReader) MetaIndex(id uint64, tr record.TimeRange) (int, *MetaIndex, error)
- func (r *TSSPFileReader) MetaIndexAt(idx int) (*MetaIndex, error)
- func (r *TSSPFileReader) MinMaxSeriesID() (min, max uint64, err error)
- func (r *TSSPFileReader) MinMaxTime() (min, max int64, err error)
- func (r *TSSPFileReader) Name() string
- func (r *TSSPFileReader) Open() error
- func (r *TSSPFileReader) Read(offset int64, size uint32, dst *[]byte) ([]byte, error)
- func (r *TSSPFileReader) ReadChunkMetaData(metaIdx int, m *MetaIndex, dst []ChunkMeta) ([]ChunkMeta, error)
- func (r *TSSPFileReader) ReadData(cm *ChunkMeta, segment int, dst *record.Record, decs *ReadContext) (*record.Record, error)
- func (r *TSSPFileReader) ReadDataBlock(offset int64, size uint32, dst *[]byte) (rb []byte, err error)
- func (r *TSSPFileReader) ReadMetaBlock(metaIdx int, id uint64, offset int64, size uint32, count uint32, dst *[]byte) (rb []byte, err error)
- func (r *TSSPFileReader) Rename(newName string) error
- func (r *TSSPFileReader) Stat() *Trailer
- func (r *TSSPFileReader) Version() uint64
- type TSSPFiles
- type TableData
- type TableReader
- type TableReaders
- type TableStat
- type TableStoreGC
- type TablesGC
- type TablesStore
- type Time
- type TimePreAgg
- type Tombstone
- type TombstoneFile
- type Trailer
Constants ¶
const ( CompactLevels = 7 MergeFirstSeqLen = 5 MergeFirstSeqSize = 1 * 1024 * 1024 MergeFirstMergeTime = 300 MergeFirstAvgSize = 10 * 1024 * 1024 MergeFirstDstSize = 10 * 1024 * 1024 MergeFirstRatio = 0.75 )
const ( DefaultMaxRowsPerSegment = 1000 DefaultMaxChunkMetaItemSize = 256 * 1024 DefaultMaxChunkMetaItemCount = 512 NonStreamingCompact = 2 StreamingCompact = 1 AutoCompact = 0 )
const ( // BlockFloat64 designates a block encodes float64 values. BlockFloat64 = byte(influx.Field_Type_Float) // BlockInteger designates a block encodes int64 values. BlockInteger = byte(influx.Field_Type_Int) // BlockBoolean designates a block encodes boolean values. BlockBoolean = byte(influx.Field_Type_Boolean) // BlockString designates a block encodes string values. BlockString = byte(influx.Field_Type_String) )
const ( MB = 1024 * 1024 GB = 1024 * MB )
const (
StringCompressedZstd = 2
)
const (
TsspDirName = "tssp"
)
Variables ¶
var ( ErrCompStopped = errors.New("compact stopped") ErrDroppingMst = errors.New("measurement is dropped") LevelCompactRule = []uint16{0, 1, 0, 2, 0, 3, 0, 1, 2, 3, 0, 4, 0, 5, 0, 1, 2, 6} LeveLMinGroupFiles = [CompactLevels]int{8, 4, 4, 4, 4, 4, 2} EnableMergeOutOfOrder = true MaxNumOfFileToMerge = 256 MaxSizeOfFileToMerge int64 = 512 * 1024 * 1024 // 512MB )
var ( MinMaxTimeLen = int(unsafe.Sizeof(SegmentRange{})) SegmentLen = (Segment{}).bytes() ColumnMetaLenMin = (ColumnMeta{}).bytes(1) ChunkMetaLen = int(unsafe.Sizeof(ChunkMeta{})-24*2) + MinMaxTimeLen ChunkMetaMinLen = ChunkMetaLen + ColumnMetaLenMin*2 MetaIndexLen = int(unsafe.Sizeof(MetaIndex{})) )
var (
CLog = Log.NewLogger(errno.ModuleCompact)
)
var ErrDirtyLog = errors.New("incomplete log file")
Functions ¶
func AggregateData ¶
func AggregateData(newRec, baseRec *record.Record, ops []*comm.CallOption)
func CacheDataInMemory ¶
func CacheDataInMemory() bool
func CacheMetaInMemory ¶
func CacheMetaInMemory() bool
func CheckCrc32En ¶
func CheckCrc32En() bool
func CompactRecovery ¶
func CompactRecovery(path string, group *CompactGroup)
func DecodeBooleanBlock ¶
func DecodeBooleanBlock(in []byte, out *[]byte, ctx *CoderContext) ([]bool, error)
func DecodeFloatBlock ¶
func DecodeFloatBlock(in []byte, out *[]byte, ctx *CoderContext) ([]float64, error)
func DecodeIntegerBlock ¶
func DecodeIntegerBlock(in []byte, out *[]byte, ctx *CoderContext) ([]int64, error)
func DecodeStringBlock ¶
func DecodeTimestampBlock ¶
func DecodeTimestampBlock(in []byte, out *[]byte, ctx *CoderContext) ([]int64, error)
func DecodeUnsignedBlock ¶
func DecodeUnsignedBlock(in []byte, out *[]byte, ctx *CoderContext) ([]uint64, error)
func EnableMmapRead ¶
func EnableMmapRead(en bool)
func EnableReadCache ¶
func EnableReadCache(readCacheLimit int)
func EncodeBooleanBlock ¶
func EncodeBooleanBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
func EncodeFloatBlock ¶
func EncodeFloatBlock(in []byte, out []byte, ctx *CoderContext) ([]byte, error)
func EncodeIntegerBlock ¶
func EncodeIntegerBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
func EncodeStringBlock ¶
func EncodeTimestampBlock ¶
func EncodeTimestampBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
func EncodeUnsignedBlock ¶
func EncodeUnsignedBlock(in, out []byte, ctx *CoderContext) ([]byte, error)
func EstimateBufferSize ¶
func FilterByField ¶
func FilterByTimeDescend ¶
func InitDecFunctions ¶
func InitDecFunctions()
func IsInterfaceNil ¶
func IsInterfaceNil(value interface{}) bool
func IsTempleFile ¶
func MaxRowsPerSegment ¶
func MaxRowsPerSegment() int
func MergeRecovery ¶
func MergeRecovery(path string, name string, inputs *OutOfOrderMergeContext)
func NewDiskFileReader ¶
func NewDiskWriter ¶
func NewDiskWriter(lw NameReadWriterCloser, bufferSize int) *diskWriter
func NewIndexWriter ¶
func NewMemReaderEvictCtx ¶
func NewMemReaderEvictCtx() *memReaderEvictCtx
func NewMergeHelper ¶
func NonStreamingCompaction ¶
func PutDataCoder ¶
func PutDataCoder(coder DataCoder)
func PutIDTimePairs ¶
func PutIDTimePairs(pair *IdTimePairs)
func PutMsBuilder ¶
func PutMsBuilder(msBuilder *MsBuilder)
func ReleaseColumnBuilder ¶
func ReleaseColumnBuilder(b PreAggBuilder)
func RenameTmpFiles ¶
func ResetAggregateData ¶
func ResetAggregateData(newRec *record.Record, ops []*comm.CallOption)
func SegMergeFlag ¶
func SegMergeFlag(v int32)
func SetCacheDataBlock ¶
func SetCacheDataBlock(en bool)
func SetCacheMetaData ¶
func SetCacheMetaData(en bool)
func SetCompactLimit ¶
func SetImmTableMaxMemoryPercentage ¶
func SetImmTableMaxMemoryPercentage(sysTotalMem, percentage int)
func SetMaxCompactor ¶
func SetMaxCompactor(n int)
func SetMaxFullCompactor ¶
func SetMaxFullCompactor(n int)
func SetMaxRowsPerSegment ¶
func SetMaxRowsPerSegment(maxRowsPerSegmentLimit int)
func SetMaxSegmentLimit ¶
func SetMaxSegmentLimit(limit int)
func SetSnapshotLimit ¶
func SnapshotLimit ¶
func SnapshotLimit() bool
func UnrefFiles ¶
func UnrefFiles(files ...TSSPFile)
func ZSTDCompressBound ¶
func ZigZagDecode ¶
func ZigZagEncode ¶
ZigZagEncode ZigZag encoding maps signed integers to unsigned integers from: https://developers.google.com/protocol-buffers/docs/encoding
Types ¶
type Boolean ¶
type Boolean struct {
// contains filtered or unexported fields
}
func GetBoolCoder ¶
func GetBoolCoder() *Boolean
func (*Boolean) SetEncodingType ¶
type BooleanPreAgg ¶
type BooleanPreAgg struct {
// contains filtered or unexported fields
}
func NewBooleanPreAgg ¶
func NewBooleanPreAgg() *BooleanPreAgg
type BytesBuffer ¶
type BytesBuffer struct {
// contains filtered or unexported fields
}
func NewBytesBuffer ¶
func NewBytesBuffer(buf []byte) *BytesBuffer
func (*BytesBuffer) Bytes ¶
func (w *BytesBuffer) Bytes() []byte
func (*BytesBuffer) Len ¶
func (w *BytesBuffer) Len() int
func (*BytesBuffer) ReadByte ¶
func (w *BytesBuffer) ReadByte() (b byte, err error)
func (*BytesBuffer) Reset ¶
func (w *BytesBuffer) Reset(b []byte)
func (*BytesBuffer) WriteByte ¶
func (w *BytesBuffer) WriteByte(b byte) error
type ChunkDataBuilder ¶
type ChunkDataBuilder struct {
// contains filtered or unexported fields
}
func NewChunkDataBuilder ¶
func NewChunkDataBuilder(maxRowsPerSegment, maxSegmentLimit int) *ChunkDataBuilder
func (*ChunkDataBuilder) EncodeChunk ¶
func (*ChunkDataBuilder) EncodeTime ¶
func (b *ChunkDataBuilder) EncodeTime(offset int64) error
type ChunkIterator ¶
type ChunkIterator struct { *FileIterator // contains filtered or unexported fields }
func NewChunkIterator ¶
func NewChunkIterator(r *FileIterator) *ChunkIterator
func (*ChunkIterator) Close ¶
func (c *ChunkIterator) Close()
func (*ChunkIterator) Next ¶
func (c *ChunkIterator) Next() bool
func (*ChunkIterator) WithLog ¶
func (c *ChunkIterator) WithLog(log *Log.Logger)
type ChunkIterators ¶
type ChunkIterators struct {
// contains filtered or unexported fields
}
func (*ChunkIterators) Close ¶
func (c *ChunkIterators) Close()
func (*ChunkIterators) Len ¶
func (c *ChunkIterators) Len() int
func (*ChunkIterators) Less ¶
func (c *ChunkIterators) Less(i, j int) bool
func (*ChunkIterators) Pop ¶
func (c *ChunkIterators) Pop() interface{}
func (*ChunkIterators) Push ¶
func (c *ChunkIterators) Push(v interface{})
func (*ChunkIterators) Swap ¶
func (c *ChunkIterators) Swap(i, j int)
func (*ChunkIterators) WithLog ¶
func (c *ChunkIterators) WithLog(log *Log.Logger)
type ChunkMeta ¶
type ChunkMeta struct {
// contains filtered or unexported fields
}
func (*ChunkMeta) MinMaxTime ¶
func (*ChunkMeta) Rows ¶
func (m *ChunkMeta) Rows(ab PreAggBuilder) int
func (*ChunkMeta) TimeMeta ¶
func (m *ChunkMeta) TimeMeta() *ColumnMeta
type CoderContext ¶
type CoderContext struct {
// contains filtered or unexported fields
}
func NewCoderContext ¶
func NewCoderContext() *CoderContext
func (*CoderContext) Release ¶
func (ctx *CoderContext) Release()
type ColumnBuilder ¶
type ColumnBuilder struct {
// contains filtered or unexported fields
}
func NewColumnBuilder ¶
func NewColumnBuilder() *ColumnBuilder
type ColumnMeta ¶
type ColumnMeta struct {
// contains filtered or unexported fields
}
func (*ColumnMeta) RowCount ¶
func (m *ColumnMeta) RowCount(ref *record.Field, decs *ReadContext) (int64, error)
type ColumnReader ¶
type CompactGroup ¶
type CompactGroup struct {
// contains filtered or unexported fields
}
func NewCompactGroup ¶
func NewCompactGroup(name string, toLevle uint16, count int) *CompactGroup
type CompactedFileInfo ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) MaxRowsPerSegment ¶
func (*Config) SetFilesLimit ¶
func (*Config) SetMaxRowsPerSegment ¶
func (*Config) SetMaxSegmentLimit ¶
type DiskFileReader ¶
type FileIterator ¶
type FileIterator struct {
// contains filtered or unexported fields
}
func NewFileIterator ¶
func NewFileIterator(r TSSPFile, log *Log.Logger) *FileIterator
func (*FileIterator) Close ¶
func (itr *FileIterator) Close()
func (*FileIterator) NextChunkMeta ¶
func (itr *FileIterator) NextChunkMeta() bool
func (*FileIterator) WithLog ¶
func (itr *FileIterator) WithLog(log *Log.Logger)
type FileIterators ¶
type FileIterators []*FileIterator
func (FileIterators) AverageRows ¶
func (i FileIterators) AverageRows() int
func (FileIterators) Close ¶
func (i FileIterators) Close()
func (FileIterators) MaxChunkRows ¶
func (i FileIterators) MaxChunkRows() int
func (FileIterators) MaxColumns ¶
func (i FileIterators) MaxColumns() int
type FileWriter ¶
type FilterOptions ¶
type FilterOptions struct {
// contains filtered or unexported fields
}
func NewFilterOpts ¶
type Float ¶
type Float struct {
// contains filtered or unexported fields
}
func GetFloatCoder ¶
func GetFloatCoder() *Float
func (*Float) SetEncodingType ¶
type FloatPreAgg ¶
type FloatPreAgg struct {
// contains filtered or unexported fields
}
FloatPreAgg If you change the order of the elements in the structure, remember to modify marshal() and unmarshal() as well.
func NewFloatPreAgg ¶
func NewFloatPreAgg() *FloatPreAgg
type IdTimePairs ¶
func GetIDTimePairs ¶
func GetIDTimePairs(name string) *IdTimePairs
func (*IdTimePairs) Add ¶
func (p *IdTimePairs) Add(id uint64, tm int64)
func (*IdTimePairs) AddRowCounts ¶
func (p *IdTimePairs) AddRowCounts(rowCounts int64)
func (*IdTimePairs) Len ¶
func (p *IdTimePairs) Len() int
func (*IdTimePairs) Marshal ¶
func (p *IdTimePairs) Marshal(isOrder bool, dst []byte, ctx *CoderContext) []byte
func (*IdTimePairs) Reset ¶
func (p *IdTimePairs) Reset(name string)
type InMerge ¶
type InMerge struct {
// contains filtered or unexported fields
}
func NewInMerge ¶
func NewInMerge() *InMerge
type Integer ¶
type Integer struct {
// contains filtered or unexported fields
}
func GetInterCoder ¶
func GetInterCoder() *Integer
func (*Integer) SetEncodingType ¶
type IntegerPreAgg ¶
type IntegerPreAgg struct {
// contains filtered or unexported fields
}
IntegerPreAgg If you change the order of the elements in the structure, remember to modify marshal() and unmarshal() as well.
func NewIntegerPreAgg ¶
func NewIntegerPreAgg() *IntegerPreAgg
type LimitWriter ¶
type LimitWriter struct {
// contains filtered or unexported fields
}
func (*LimitWriter) Close ¶
func (w *LimitWriter) Close() error
func (*LimitWriter) Name ¶
func (w *LimitWriter) Name() string
type Limiter ¶
type Limiter interface { SetBurst(newBurst int) SetLimit(newLimit rate.Limit) WaitN(ctx context.Context, n int) (err error) Limit() rate.Limit Burst() int }
func NewLimiter ¶
type Location ¶
type Location struct {
// contains filtered or unexported fields
}
func NewLocation ¶
func NewLocation(r TSSPFile, decs *ReadContext) *Location
func (*Location) GetChunkMeta ¶
type LocationCursor ¶
type LocationCursor struct {
// contains filtered or unexported fields
}
func NewLocationCursor ¶
func NewLocationCursor(n int) *LocationCursor
func (*LocationCursor) AddLocation ¶
func (l *LocationCursor) AddLocation(loc *Location)
func (*LocationCursor) AddRef ¶
func (l *LocationCursor) AddRef()
func (LocationCursor) Len ¶
func (l LocationCursor) Len() int
func (LocationCursor) Less ¶
func (l LocationCursor) Less(i, j int) bool
func (*LocationCursor) ReadData ¶
func (l *LocationCursor) ReadData(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
func (*LocationCursor) ReadMeta ¶
func (l *LocationCursor) ReadMeta(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
func (*LocationCursor) ReadOutOfOrderMeta ¶
func (l *LocationCursor) ReadOutOfOrderMeta(filterOpts *FilterOptions, dst *record.Record) (*record.Record, error)
func (LocationCursor) Reverse ¶
func (l LocationCursor) Reverse()
func (LocationCursor) Swap ¶
func (l LocationCursor) Swap(i, j int)
func (*LocationCursor) Unref ¶
func (l *LocationCursor) Unref()
type MemBlock ¶
type MemBlock struct {
// contains filtered or unexported fields
}
func (*MemBlock) AppendDataBlock ¶
func (*MemBlock) CopyBlocks ¶
func (mb *MemBlock) CopyBlocks(src MemoryReader)
func (*MemBlock) DataBlocks ¶
func (*MemBlock) DataInMemory ¶
func (*MemBlock) FreeMemory ¶
func (*MemBlock) LoadIntoMemory ¶
func (mb *MemBlock) LoadIntoMemory(dr DiskFileReader, tr *Trailer, metaIndexItems []MetaIndex) error
func (*MemBlock) MetaBlocks ¶
func (*MemBlock) MetaInMemory ¶
func (*MemBlock) ReadChunkMetaBlock ¶
func (*MemBlock) ReadDataBlock ¶
func (*MemBlock) ReserveDataBlock ¶
func (*MemBlock) ReserveMetaBlock ¶
func (*MemBlock) SetMetaBlocks ¶
type MemoryReader ¶
type MemoryReader interface { AppendDataBlock(srcData []byte) ReadChunkMetaBlock(metaIdx int, sid uint64, count uint32) []byte ReadDataBlock(offset int64, size uint32, dstPtr *[]byte) ([]byte, error) CopyBlocks(src MemoryReader) LoadIntoMemory(dr DiskFileReader, tr *Trailer, metaIndexItems []MetaIndex) error FreeMemory() int64 DataInMemory() bool MetaInMemory() bool ReserveMetaBlock(n int) ReserveDataBlock(n int) DataBlocks() [][]byte MetaBlocks() [][]byte SetMetaBlocks(blocks [][]byte) Size() int64 Reset() }
func NewMemReader ¶
func NewMemReader() MemoryReader
func NewMemoryReader ¶
func NewMemoryReader(blkSize int) MemoryReader
type MetaIndex ¶
type MetaIndex struct {
// contains filtered or unexported fields
}
MetaIndex If you change the order of the elements in the structure, remember to modify marshal() and unmarshal() as well.
type MmsIdTime ¶
type MmsIdTime struct {
// contains filtered or unexported fields
}
func NewMmsIdTime ¶
func NewMmsIdTime() *MmsIdTime
type MmsReaders ¶
type MmsReaders struct { Orders TableReaders OutOfOrders TableReaders }
type MmsTables ¶
type MmsTables struct { Order map[string]*TSSPFiles OutOfOrder map[string]*TSSPFiles Conf *Config // contains filtered or unexported fields }
func NewTableStore ¶
func (*MmsTables) AddRowCountsBySid ¶
func (*MmsTables) AddTSSPFiles ¶
func (*MmsTables) CompactDone ¶
func (*MmsTables) CompactionDisable ¶
func (m *MmsTables) CompactionDisable()
func (*MmsTables) CompactionEnable ¶
func (m *MmsTables) CompactionEnable()
func (*MmsTables) CompactionEnabled ¶
func (*MmsTables) DropMeasurement ¶
func (*MmsTables) FreeAllMemReader ¶
func (m *MmsTables) FreeAllMemReader()
func (*MmsTables) FullCompact ¶
func (*MmsTables) GetFilesRef ¶
func (*MmsTables) GetFilesRefByAscending ¶
func (m *MmsTables) GetFilesRefByAscending(measurement string, isOrder bool, ascending bool, tr record.TimeRange) []TSSPFile
Get files by time range and ascending. For example, we have files which time range are [1,3],[1,4],[2,5], [3,7] While ascending is true, we first compare minTime and then compare maxTime. So we got [1,4], [1,3],[2,5],[3,7]. Because minTime is equal, if we first init a bigger time range, While ascending is false, we first compare maxTime and the compare minTime. So we got [1,3],[1,4],[2,5],[3,7].
func (*MmsTables) GetLastFlushTimeBySid ¶
func (*MmsTables) GetMstFileStat ¶
func (m *MmsTables) GetMstFileStat() *statistics.FileStat
func (*MmsTables) GetOutOfOrderFileNum ¶
func (*MmsTables) GetRowCountsBySid ¶
func (*MmsTables) LevelPlan ¶
func (m *MmsTables) LevelPlan(level uint16) []*CompactGroup
func (*MmsTables) MergeDisable ¶
func (m *MmsTables) MergeDisable()
func (*MmsTables) MergeEnable ¶
func (m *MmsTables) MergeEnable()
func (*MmsTables) MergeEnabled ¶
func (*MmsTables) MergeOutOfOrder ¶
func (*MmsTables) NewChunkIterators ¶
func (m *MmsTables) NewChunkIterators(group FilesInfo) (*ChunkIterators, error)
func (*MmsTables) NewFileIterators ¶
func (m *MmsTables) NewFileIterators(group *CompactGroup) (FilesInfo, error)
func (*MmsTables) NewStreamIterators ¶
func (m *MmsTables) NewStreamIterators(group FilesInfo) (*StreamIterators, error)
func (*MmsTables) NextSequence ¶
func (*MmsTables) ReplaceFiles ¶
type MsBuilder ¶
type MsBuilder struct { Path string TableData Conf *Config MaxIds int Files []TSSPFile FileName TSSPFileName // contains filtered or unexported fields }
func AllocMsBuilder ¶
func GetMsBuilder ¶
func (*MsBuilder) FileVersion ¶
func (*MsBuilder) MaxRowsPerSegment ¶
type MsBuilderPool ¶
type MsBuilderPool struct {
// contains filtered or unexported fields
}
func NewMsBuilderPool ¶
func NewMsBuilderPool() *MsBuilderPool
type NameReadWriterCloser ¶
type NameReadWriterCloser interface { Name() string io.ReadWriteCloser }
func NewLimitWriter ¶
func NewLimitWriter(w NameReadWriterCloser, l Limiter) NameReadWriterCloser
type OutOfOrderMergeContext ¶
type OutOfOrderMergeContext struct { Seqs []uint64 Names []string OrderInfo // contains filtered or unexported fields }
func NewOutOfOrderMergeContext ¶
func NewOutOfOrderMergeContext() *OutOfOrderMergeContext
func (*OutOfOrderMergeContext) Add ¶
func (ctx *OutOfOrderMergeContext) Add(f TSSPFile) bool
func (*OutOfOrderMergeContext) Release ¶
func (ctx *OutOfOrderMergeContext) Release()
type PreAggBuilder ¶
type PreAggBuilder interface {
// contains filtered or unexported methods
}
type PreAggBuilders ¶
type PreAggBuilders struct {
// contains filtered or unexported fields
}
func (*PreAggBuilders) Release ¶
func (b *PreAggBuilders) Release()
type ReadContext ¶
type ReadContext struct { Ascending bool // contains filtered or unexported fields }
func NewReadContext ¶
func NewReadContext(ascending bool) *ReadContext
func (*ReadContext) GetOps ¶
func (d *ReadContext) GetOps() []*comm.CallOption
func (*ReadContext) InitPreAggBuilder ¶
func (d *ReadContext) InitPreAggBuilder()
func (*ReadContext) MatchPreAgg ¶
func (d *ReadContext) MatchPreAgg() bool
func (*ReadContext) Release ¶
func (d *ReadContext) Release()
func (*ReadContext) Reset ¶
func (d *ReadContext) Reset()
func (*ReadContext) Set ¶
func (d *ReadContext) Set(ascending bool, tr record.TimeRange, onlyFirstOrLast bool, ops []*comm.CallOption)
func (*ReadContext) SetOps ¶
func (d *ReadContext) SetOps(c []*comm.CallOption)
func (*ReadContext) SetTr ¶
func (d *ReadContext) SetTr(tr record.TimeRange)
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
Segment offset/size/minT/maxT
type SegmentRange ¶
type SegmentRange [2]int64 // min/max
type Sequencer ¶
type Sequencer struct {
// contains filtered or unexported fields
}
func NewSequencer ¶
func NewSequencer() *Sequencer
func (*Sequencer) AddRowCounts ¶
func (*Sequencer) BatchUpdate ¶
func (s *Sequencer) BatchUpdate(p *IdTimePairs)
func (*Sequencer) BatchUpdateCheckTime ¶
func (s *Sequencer) BatchUpdateCheckTime(p *IdTimePairs)
type StreamIterator ¶
type StreamIterator struct { *FileIterator // contains filtered or unexported fields }
func NewStreamStreamIterator ¶
func NewStreamStreamIterator(fi *FileIterator) *StreamIterator
type StreamIterators ¶
func (*StreamIterators) Close ¶
func (c *StreamIterators) Close()
func (*StreamIterators) FileVersion ¶
func (c *StreamIterators) FileVersion() uint64
func (*StreamIterators) Flush ¶
func (c *StreamIterators) Flush() error
func (*StreamIterators) Init ¶
func (c *StreamIterators) Init(id uint64, chunkDataOffset int64, schema record.Schemas)
func (*StreamIterators) Len ¶
func (c *StreamIterators) Len() int
func (*StreamIterators) Less ¶
func (c *StreamIterators) Less(i, j int) bool
func (*StreamIterators) NewFile ¶
func (c *StreamIterators) NewFile(addFileExt bool) error
func (*StreamIterators) NewTSSPFile ¶
func (c *StreamIterators) NewTSSPFile(tmp bool) (TSSPFile, error)
func (*StreamIterators) Pop ¶
func (c *StreamIterators) Pop() interface{}
func (*StreamIterators) Push ¶
func (c *StreamIterators) Push(v interface{})
func (*StreamIterators) Size ¶
func (c *StreamIterators) Size() int64
func (*StreamIterators) Swap ¶
func (c *StreamIterators) Swap(i, j int)
func (*StreamIterators) WithLog ¶
func (c *StreamIterators) WithLog(log *Log.Logger)
type StreamIteratorsPool ¶
type StreamIteratorsPool struct {
// contains filtered or unexported fields
}
func NewStreamIteratorsPool ¶
func NewStreamIteratorsPool(n int) *StreamIteratorsPool
type String ¶
type String struct {
// contains filtered or unexported fields
}
func GetStringCoder ¶
func GetStringCoder() *String
func (*String) MaxEncodedLen ¶
func (*String) SetEncodingType ¶
type StringPreAgg ¶
type StringPreAgg struct {
// contains filtered or unexported fields
}
StringPreAgg If you change the order of the elements in the structure, remember to modify marshal() and unmarshal() as well.
func NewStringPreAgg ¶
func NewStringPreAgg() *StringPreAgg
type TSSPFile ¶
type TSSPFile interface { Path() string Name() string LevelAndSequence() (uint16, uint64) FileNameMerge() uint16 FileNameExtend() uint16 IsOrder() bool Ref() Unref() Stop() Inuse() bool MetaIndexAt(idx int) (*MetaIndex, error) MetaIndex(id uint64, tr record.TimeRange) (int, *MetaIndex, error) ChunkMeta(id uint64, offset int64, size, itemCount uint32, metaIdx int, dst *ChunkMeta) (*ChunkMeta, error) Read(id uint64, tr record.TimeRange, dst *record.Record) (*record.Record, error) ReadAt(cm *ChunkMeta, segment int, dst *record.Record, decs *ReadContext) (*record.Record, error) ChunkAt(index int) (*ChunkMeta, error) ReadData(offset int64, size uint32, dst *[]byte) ([]byte, error) ReadChunkMetaData(metaIdx int, m *MetaIndex, dst []ChunkMeta) ([]ChunkMeta, error) CreateTime() int64 FileStat() *Trailer // FileSize get the size of the disk occupied by file FileSize() int64 // InMemSize get the size of the memory occupied by file InMemSize() int64 Contains(id uint64) (bool, error) ContainsByTime(tr record.TimeRange) (bool, error) ContainsValue(id uint64, tr record.TimeRange) (bool, error) MinMaxTime() (int64, int64, error) Delete(ids []int64) error DeleteRange(ids []int64, min, max int64) error HasTombstones() bool TombstoneFiles() []TombstoneFile Open() error Close() error LoadIntoMemory() error LoadIndex() error LoadIdTimes(p *IdTimePairs) error Rename(newName string) error Remove() error FreeMemory(evictLock bool) int64 Version() uint64 AverageChunkRows() int MaxChunkRows() int AddToEvictList(level uint16) RemoveFromEvictList(level uint16) }
type TSSPFileName ¶
type TSSPFileName struct {
// contains filtered or unexported fields
}
func NewTSSPFileName ¶
func NewTSSPFileName(seq uint64, level, merge, extent uint16, order bool) TSSPFileName
func (*TSSPFileName) Equal ¶
func (n *TSSPFileName) Equal(other *TSSPFileName) bool
func (*TSSPFileName) ParseFileName ¶
func (n *TSSPFileName) ParseFileName(name string) error
func (*TSSPFileName) SetExtend ¶
func (n *TSSPFileName) SetExtend(extend uint16)
func (*TSSPFileName) SetLevel ¶
func (n *TSSPFileName) SetLevel(l uint16)
func (*TSSPFileName) SetMerge ¶
func (n *TSSPFileName) SetMerge(merge uint16)
func (*TSSPFileName) SetOrder ¶
func (n *TSSPFileName) SetOrder(v bool)
func (*TSSPFileName) SetSeq ¶
func (n *TSSPFileName) SetSeq(seq uint64)
func (*TSSPFileName) String ¶
func (n *TSSPFileName) String() string
func (*TSSPFileName) TmpPath ¶
func (n *TSSPFileName) TmpPath(dir string) string
type TSSPFileReader ¶
type TSSPFileReader struct {
// contains filtered or unexported fields
}
func CreateTSSPFileReader ¶
func NewTSSPFileReader ¶
func NewTSSPFileReader(name string) (*TSSPFileReader, error)
func (*TSSPFileReader) AverageChunkRows ¶
func (r *TSSPFileReader) AverageChunkRows() int
func (*TSSPFileReader) BlockHeader ¶
func (*TSSPFileReader) ChunkMetaAt ¶
func (r *TSSPFileReader) ChunkMetaAt(index int) (*ChunkMeta, error)
func (*TSSPFileReader) Close ¶
func (r *TSSPFileReader) Close() error
func (*TSSPFileReader) Contains ¶
func (r *TSSPFileReader) Contains(id uint64, tm record.TimeRange) bool
func (*TSSPFileReader) ContainsId ¶
func (r *TSSPFileReader) ContainsId(id uint64) bool
func (*TSSPFileReader) ContainsTime ¶
func (r *TSSPFileReader) ContainsTime(tm record.TimeRange) bool
func (*TSSPFileReader) CreateTime ¶
func (r *TSSPFileReader) CreateTime() int64
func (*TSSPFileReader) FileName ¶
func (r *TSSPFileReader) FileName() string
func (*TSSPFileReader) FileSize ¶
func (r *TSSPFileReader) FileSize() int64
func (*TSSPFileReader) FreeMemory ¶
func (r *TSSPFileReader) FreeMemory() int64
func (*TSSPFileReader) GetTSSPFileBytes ¶
func (*TSSPFileReader) InMemSize ¶
func (r *TSSPFileReader) InMemSize() int64
func (*TSSPFileReader) LoadIndex ¶
func (r *TSSPFileReader) LoadIndex() error
func (*TSSPFileReader) LoadIntoMemory ¶
func (r *TSSPFileReader) LoadIntoMemory() error
func (*TSSPFileReader) MaxChunkRows ¶
func (r *TSSPFileReader) MaxChunkRows() int
func (*TSSPFileReader) MetaIndexAt ¶
func (r *TSSPFileReader) MetaIndexAt(idx int) (*MetaIndex, error)
func (*TSSPFileReader) MinMaxSeriesID ¶
func (r *TSSPFileReader) MinMaxSeriesID() (min, max uint64, err error)
func (*TSSPFileReader) MinMaxTime ¶
func (r *TSSPFileReader) MinMaxTime() (min, max int64, err error)
func (*TSSPFileReader) Name ¶
func (r *TSSPFileReader) Name() string
func (*TSSPFileReader) Open ¶
func (r *TSSPFileReader) Open() error
func (*TSSPFileReader) ReadChunkMetaData ¶
func (*TSSPFileReader) ReadData ¶
func (r *TSSPFileReader) ReadData(cm *ChunkMeta, segment int, dst *record.Record, decs *ReadContext) (*record.Record, error)
func (*TSSPFileReader) ReadDataBlock ¶
func (*TSSPFileReader) ReadMetaBlock ¶
func (*TSSPFileReader) Rename ¶
func (r *TSSPFileReader) Rename(newName string) error
func (*TSSPFileReader) Stat ¶
func (r *TSSPFileReader) Stat() *Trailer
func (*TSSPFileReader) Version ¶
func (r *TSSPFileReader) Version() uint64
type TSSPFiles ¶
type TSSPFiles struct {
// contains filtered or unexported fields
}
func NewTSSPFiles ¶
func NewTSSPFiles() *TSSPFiles
type TableReader ¶
type TableReader interface { Open() error Close() error ReadData(cm *ChunkMeta, segment int, dst *record.Record, decs *ReadContext) (*record.Record, error) MetaIndexAt(idx int) (*MetaIndex, error) MetaIndex(id uint64, tr record.TimeRange) (int, *MetaIndex, error) ChunkMeta(id uint64, offset int64, size, itemCount uint32, metaIdx int, dst *ChunkMeta) (*ChunkMeta, error) ChunkMetaAt(index int) (*ChunkMeta, error) ReadMetaBlock(metaIdx int, id uint64, offset int64, size uint32, count uint32, dst *[]byte) ([]byte, error) ReadDataBlock(offset int64, size uint32, dst *[]byte) ([]byte, error) Read(offset int64, size uint32, dst *[]byte) ([]byte, error) ReadChunkMetaData(metaIdx int, m *MetaIndex, dst []ChunkMeta) ([]ChunkMeta, error) BlockHeader(meta *ChunkMeta, dst []record.Field) ([]record.Field, error) Stat() *Trailer MinMaxSeriesID() (min, max uint64, err error) MinMaxTime() (min, max int64, err error) Contains(id uint64, tm record.TimeRange) bool ContainsTime(tm record.TimeRange) bool ContainsId(id uint64) bool CreateTime() int64 Name() string FileName() string Rename(newName string) error FileSize() int64 InMemSize() int64 Version() uint64 FreeMemory() int64 LoadIntoMemory() error LoadIndex() error AverageChunkRows() int MaxChunkRows() int }
type TableReaders ¶
type TableReaders []TSSPFile
func (TableReaders) Len ¶
func (tables TableReaders) Len() int
func (TableReaders) Less ¶
func (tables TableReaders) Less(i, j int) bool
func (TableReaders) Swap ¶
func (tables TableReaders) Swap(i, j int)
type TableStoreGC ¶
type TableStoreGC struct {
// contains filtered or unexported fields
}
func (*TableStoreGC) Add ¶
func (sgc *TableStoreGC) Add(free bool, files ...TSSPFile)
func (*TableStoreGC) GC ¶
func (sgc *TableStoreGC) GC()
type TablesGC ¶
func NewTableStoreGC ¶
func NewTableStoreGC() TablesGC
type TablesStore ¶
type TablesStore interface { Open() (int64, int64, error) Close() error AddTable(ms *MsBuilder, isOrder bool, tmp bool) AddTSSPFiles(name string, isOrder bool, f ...TSSPFile) FreeAllMemReader() ReplaceFiles(name string, oldFiles, newFiles []TSSPFile, isOrder bool, log *Log.Logger) error GetFilesRef(measurement string, isOrder bool) []TSSPFile GetFilesRefByAscending(measurement string, isOrder bool, ascending bool, tr record.TimeRange) []TSSPFile NextSequence() uint64 Sequencer() *Sequencer Tier() uint64 File(name string, namePath string, isOrder bool) TSSPFile CompactDone(seq []string) CompactionEnable() CompactionDisable() MergeEnable() MergeDisable() CompactionEnabled() bool MergeEnabled() bool MergeOutOfOrder(shId uint64) error LevelCompact(level uint16, shid uint64) error FullCompact(shid uint64) error GetLastFlushTimeBySid(measurement string, sid uint64) int64 GetRowCountsBySid(measurement string, sid uint64) int64 AddRowCountsBySid(measurement string, sid uint64, rowCounts int64) GetOutOfOrderFileNum() int GetMstFileStat() *stats.FileStat DropMeasurement(ctx context.Context, name string) error }
type Time ¶
type Time struct {
// contains filtered or unexported fields
}
func GetTimeCoder ¶
func GetTimeCoder() *Time
func (*Time) SetEncodingType ¶
type TimePreAgg ¶
type TimePreAgg struct {
// contains filtered or unexported fields
}
func NewTimePreAgg ¶
func NewTimePreAgg() *TimePreAgg
type TombstoneFile ¶
type TombstoneFile struct {
// contains filtered or unexported fields
}
func (*TombstoneFile) Path ¶
func (t *TombstoneFile) Path() string
func (*TombstoneFile) TombstonesCount ¶
func (t *TombstoneFile) TombstonesCount() int