colstore

package
v1.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PKMetaPrefixSize = util.Uint64SizeBytes*2 + util.Uint32SizeBytes*2
	CRCLen           = 4
)
View Source
const (
	CoarseIndexFragment        int    = 8
	MinRowsForSeek             int    = 0
	IndexFileSuffix            string = ".idx"
	MinMaxIndexFileSuffix      string = ".mm"
	SetIndexFileSuffix         string = ".set"
	BloomFilterIndexFileSuffix string = ".bf"
	TextIndexDataFileSuffix    string = ".pos" // posting list
	TextIndexHeadFileSuffix    string = ".bh"  // block header
	TextIndexPartFileSuffix    string = ".ph"  // part header
	DefaultTCLocation          int8   = -1
	TCLocationUsed             int8   = 1

	SeriesID          uint64 = 1
	DefaultTCDuration        = time.Hour
	MinTCDuration            = time.Minute * 10
)
View Source
const (
	TextIndexData = iota
	TextIndexHead
	TextIndexPart
	TextIndexMax
	DefaultFileType
)

Variables

This section is empty.

Functions

func AppendPKIndexSuffix added in v1.2.0

func AppendPKIndexSuffix(dataPath string) string

func AppendSecondaryIndexSuffix added in v1.3.0

func AppendSecondaryIndexSuffix(dataPath string, fieldName string, indexType index.IndexType, fileType int) string

func BuildPkRecord added in v1.5.0

func BuildPkRecord(dec *codec.BinaryDecoder, rec *record.Record, buf []byte)

func ColValBytesAtRow added in v1.5.0

func ColValBytesAtRow(cv *record.ColVal, i int, typ int) ([]byte, bool)

func FetchKeyAtRow added in v1.5.0

func FetchKeyAtRow(dst []byte, cols []*record.ColVal, schema record.Schemas, rowNum int, tcDuration int64) []byte

func InitDecFunctions

func InitDecFunctions()

func MarshalPkMetaBlock added in v1.3.0

func MarshalPkMetaBlock(startId, endId uint64, offset, size uint32, meta, colsOffset []byte) []byte

func OnlySortByTime added in v1.5.0

func OnlySortByTime(sk record.Schemas) bool

Types

type ChunkBuilder

type ChunkBuilder struct {
	// contains filtered or unexported fields
}

func NewChunkBuilder

func NewChunkBuilder() *ChunkBuilder

func (*ChunkBuilder) EncodeChunk

func (b *ChunkBuilder) EncodeChunk(rec *record.Record, dst []byte, offset []byte, offsetStart uint32) ([]byte, error)

type ClusterIndex added in v1.5.0

type ClusterIndex interface {
	Query(expr influxql.Expr) (*roaring.Bitmap, error)
}

type ColValPicker added in v1.5.0

type ColValPicker interface {
	Pick(src *record.ColVal, typ, start, end int) (*record.ColVal, *record.ColVal)
	IteratorSegment(maxRowsPreSeg int, fn func(start, end int) bool)
}

func NewColValPicker added in v1.5.0

func NewColValPicker(oks *OffsetKeySorter, unique bool) ColValPicker

type ColumnBuilder

type ColumnBuilder struct {
	// contains filtered or unexported fields
}

func NewColumnBuilder

func NewColumnBuilder() *ColumnBuilder

func (*ColumnBuilder) EncodeColumn

func (b *ColumnBuilder) EncodeColumn(ref *record.Field, col *record.ColVal) ([]byte, error)

type DetachedPKData added in v1.2.0

type DetachedPKData struct {
	Offset int64 // temporary variable, used for sorting
	Data   *record.Record
}

func (*DetachedPKData) Unmarshal added in v1.2.0

func (m *DetachedPKData) Unmarshal(src []byte, meta *DetachedPKMeta, info *DetachedPKMetaInfo) ([]byte, error)

type DetachedPKInfo added in v1.2.0

type DetachedPKInfo struct {
	StartBlockId uint64
	EndBlockId   uint64
	TcLocation   int8
	Data         *record.Record
}

func GetPKInfoByPKMetaData added in v1.2.0

func GetPKInfoByPKMetaData(meta *DetachedPKMeta, data *DetachedPKData, tcLocation int8) *DetachedPKInfo

func (*DetachedPKInfo) GetEndBlockId added in v1.3.0

func (d *DetachedPKInfo) GetEndBlockId() uint64

func (*DetachedPKInfo) GetStartBlockId added in v1.3.0

func (d *DetachedPKInfo) GetStartBlockId() uint64

func (*DetachedPKInfo) IsBlockExist added in v1.3.0

func (d *DetachedPKInfo) IsBlockExist(start, end uint64) bool

type DetachedPKMeta added in v1.2.0

type DetachedPKMeta struct {
	StartBlockId uint64
	EndBlockId   uint64
	Offset       uint32
	Length       uint32
	ColOffset    []byte
}

func (*DetachedPKMeta) Size added in v1.2.0

func (m *DetachedPKMeta) Size() int

func (*DetachedPKMeta) Unmarshal added in v1.2.0

func (m *DetachedPKMeta) Unmarshal(src []byte) ([]byte, error)

type DetachedPKMetaInfo added in v1.2.0

type DetachedPKMetaInfo struct {
	Schema     record.Schemas
	TCLocation int8
	Offset     int64
}

func (*DetachedPKMetaInfo) Size added in v1.2.0

func (m *DetachedPKMetaInfo) Size() int

func (*DetachedPKMetaInfo) Unmarshal added in v1.2.0

func (m *DetachedPKMetaInfo) Unmarshal(src []byte) ([]byte, error)

func (*DetachedPKMetaInfo) UnmarshalPublicSize added in v1.2.0

func (m *DetachedPKMetaInfo) UnmarshalPublicSize(src []byte) ([]byte, error)

type IndexBuilder

type IndexBuilder struct {
	// contains filtered or unexported fields
}

func NewIndexBuilder

func NewIndexBuilder(lockPath *string, filePath string) *IndexBuilder

func NewIndexBuilderByFd added in v1.2.0

func NewIndexBuilderByFd(lockPath *string, fd fileops.File, firstFlush bool) *IndexBuilder

func (*IndexBuilder) GetEncodeChunkSize added in v1.2.0

func (b *IndexBuilder) GetEncodeChunkSize() uint32

func (*IndexBuilder) Reset

func (b *IndexBuilder) Reset()

func (*IndexBuilder) WriteData

func (b *IndexBuilder) WriteData(rec *record.Record, tcLocation int8) error

func (*IndexBuilder) WriteDetachedData added in v1.2.0

func (b *IndexBuilder) WriteDetachedData(rec *record.Record, tcLocation int8) error

func (*IndexBuilder) WriteDetachedMeta added in v1.2.0

func (b *IndexBuilder) WriteDetachedMeta(startId, endId uint64, offset, size uint32, fd fileops.File) error

type IndexWriter added in v1.3.0

type IndexWriter struct {
	// contains filtered or unexported fields
}

func NewIndexWriter added in v1.3.0

func NewIndexWriter(lockPath *string, filePath string) (*IndexWriter, error)

func (*IndexWriter) FileName added in v1.5.0

func (b *IndexWriter) FileName() string

func (*IndexWriter) Reset added in v1.3.0

func (b *IndexWriter) Reset()

func (*IndexWriter) WriteData added in v1.3.0

func (b *IndexWriter) WriteData(data []byte) error

type KeySorter added in v1.5.0

type KeySorter struct {
	Keys [][]byte
	// contains filtered or unexported fields
}

func (*KeySorter) Add added in v1.5.0

func (ks *KeySorter) Add(key []byte)

func (*KeySorter) Len added in v1.5.0

func (ks *KeySorter) Len() int

func (*KeySorter) Less added in v1.5.0

func (ks *KeySorter) Less(i, j int) bool

func (*KeySorter) Reset added in v1.5.0

func (ks *KeySorter) Reset()

func (*KeySorter) SetDesc added in v1.5.0

func (ks *KeySorter) SetDesc(v bool)

func (*KeySorter) Swap added in v1.5.0

func (ks *KeySorter) Swap(i, j int)

type LinePicker added in v1.5.0

type LinePicker struct {
	// contains filtered or unexported fields
}

func (*LinePicker) IteratorSegment added in v1.5.0

func (p *LinePicker) IteratorSegment(maxRowsPreSeg int, fn func(start, end int) bool)

func (*LinePicker) Pick added in v1.5.0

func (p *LinePicker) Pick(src *record.ColVal, typ, start, end int) (*record.ColVal, *record.ColVal)

type Measurement added in v1.5.0

type Measurement struct {
	// contains filtered or unexported fields
}

func (*Measurement) BuildPKMap added in v1.5.0

func (m *Measurement) BuildPKMap() map[string]struct{}

func (*Measurement) ColStoreInfo added in v1.5.0

func (m *Measurement) ColStoreInfo() *meta.ColStoreInfo

func (*Measurement) IndexRelation added in v1.5.0

func (m *Measurement) IndexRelation() *influxql.IndexRelation

func (*Measurement) IsUniqueEnabled added in v1.5.0

func (m *Measurement) IsUniqueEnabled() bool

func (*Measurement) MeasurementInfo added in v1.5.0

func (m *Measurement) MeasurementInfo() *meta.MeasurementInfo

func (*Measurement) PrimaryKey added in v1.5.0

func (m *Measurement) PrimaryKey() []record.Field

func (*Measurement) SortKey added in v1.5.0

func (m *Measurement) SortKey() []record.Field

func (*Measurement) TCDuration added in v1.5.0

func (m *Measurement) TCDuration() int64

func (*Measurement) TCLocation added in v1.5.0

func (m *Measurement) TCLocation() int8

type MeasurementIdent added in v1.5.0

type MeasurementIdent struct {
	DB   string
	RP   string
	Name string
}

func NewMeasurementIdent added in v1.5.0

func NewMeasurementIdent(db, rp string) MeasurementIdent

func (*MeasurementIdent) SetName added in v1.5.0

func (t *MeasurementIdent) SetName(name string)

func (*MeasurementIdent) SetSafeName added in v1.5.0

func (t *MeasurementIdent) SetSafeName(name string)

func (*MeasurementIdent) String added in v1.5.0

func (t *MeasurementIdent) String() string

type MstManager added in v1.5.0

type MstManager struct {
	// contains filtered or unexported fields
}

func MstManagerIns added in v1.5.0

func MstManagerIns() *MstManager

func (*MstManager) Add added in v1.5.0

func (m *MstManager) Add(ident MeasurementIdent, mi *meta.MeasurementInfo)

func (*MstManager) Clear added in v1.5.0

func (m *MstManager) Clear()

func (*MstManager) Del added in v1.5.0

func (m *MstManager) Del(ident MeasurementIdent)

func (*MstManager) DelAll added in v1.5.0

func (m *MstManager) DelAll(db, rp string)

func (*MstManager) Exists added in v1.5.0

func (m *MstManager) Exists(ident MeasurementIdent) bool

func (*MstManager) Get added in v1.5.0

func (m *MstManager) Get(db, rp, name string) (*Measurement, bool)

func (*MstManager) GetByIdent added in v1.5.0

func (m *MstManager) GetByIdent(ident MeasurementIdent) (*Measurement, bool)

type OffsetKeySorter added in v1.5.0

type OffsetKeySorter struct {
	KeySorter
	Times   []int64
	Offsets []int64
	// contains filtered or unexported fields
}

func (*OffsetKeySorter) Append added in v1.5.0

func (oks *OffsetKeySorter) Append(other *OffsetKeySorter)

func (*OffsetKeySorter) IteratorFragment added in v1.5.0

func (oks *OffsetKeySorter) IteratorFragment(fn func(int, int) bool)

func (*OffsetKeySorter) Len added in v1.5.0

func (oks *OffsetKeySorter) Len() int

func (*OffsetKeySorter) Less added in v1.5.0

func (oks *OffsetKeySorter) Less(i, j int) bool

func (*OffsetKeySorter) Swap added in v1.5.0

func (oks *OffsetKeySorter) Swap(i, j int)

type Offsets added in v1.5.0

type Offsets struct {
	// contains filtered or unexported fields
}

func (*Offsets) Add added in v1.5.0

func (o *Offsets) Add(v int64)

func (*Offsets) AppendTo added in v1.5.0

func (o *Offsets) AppendTo(dst []int64) []int64

type OffsetsMap added in v1.5.0

type OffsetsMap struct {
	// contains filtered or unexported fields
}

func NewOffsetsMap added in v1.5.0

func NewOffsetsMap() *OffsetsMap

func (*OffsetsMap) Add added in v1.5.0

func (o *OffsetsMap) Add(key string, ofs int64) bool

func (*OffsetsMap) AppendToIfExists added in v1.5.0

func (o *OffsetsMap) AppendToIfExists(key string, dst []int64) []int64

type PKInfo

type PKInfo struct {
	// contains filtered or unexported fields
}

func NewPKInfo added in v1.5.0

func NewPKInfo(rec *record.Record, mark fragment.IndexFragment, pkType string, tcLocation int8) *PKInfo

func (*PKInfo) BuildColumnMap added in v1.5.0

func (p *PKInfo) BuildColumnMap()

func (*PKInfo) GetClusterIndex added in v1.5.0

func (p *PKInfo) GetClusterIndex() ClusterIndex

func (*PKInfo) GetColumnMap added in v1.5.0

func (p *PKInfo) GetColumnMap() map[string]int

func (*PKInfo) GetMark

func (p *PKInfo) GetMark() fragment.IndexFragment

func (*PKInfo) GetPkType added in v1.5.0

func (p *PKInfo) GetPkType() string

func (*PKInfo) GetRec

func (p *PKInfo) GetRec() *record.Record

func (*PKInfo) GetTCLocation added in v1.1.1

func (p *PKInfo) GetTCLocation() int8

func (*PKInfo) IsClusterIndex added in v1.5.0

func (p *PKInfo) IsClusterIndex() bool

func (*PKInfo) SetClusterIndex added in v1.5.0

func (p *PKInfo) SetClusterIndex(ci ClusterIndex)

func (*PKInfo) SetPkType added in v1.5.0

func (p *PKInfo) SetPkType(typ string)

func (*PKInfo) SetRec added in v1.5.0

func (p *PKInfo) SetRec(rec *record.Record)

type PkMetaBlock added in v1.3.0

type PkMetaBlock struct {
	StartBlockId uint64
	EndBlockId   uint64
	Offset       uint32
	Size         uint32
}

func UnmarshalPkMetaBlock added in v1.3.0

func UnmarshalPkMetaBlock(src []byte) (*PkMetaBlock, error)

type PrimaryKeyFetcher added in v1.5.0

type PrimaryKeyFetcher struct {
	// contains filtered or unexported fields
}

func (*PrimaryKeyFetcher) Fetch added in v1.5.0

func (pke *PrimaryKeyFetcher) Fetch(rec *record.Record, pk []record.Field, tcDuration int64) (*record.Record, *OffsetsMap, [][]byte)

type PrimaryKeyReader

type PrimaryKeyReader struct {
	// contains filtered or unexported fields
}

func NewPrimaryKeyReader

func NewPrimaryKeyReader(name string, lockPath *string) (*PrimaryKeyReader, error)

func (*PrimaryKeyReader) Close

func (r *PrimaryKeyReader) Close() error

func (*PrimaryKeyReader) FileSize

func (r *PrimaryKeyReader) FileSize() int64

func (*PrimaryKeyReader) Open

func (r *PrimaryKeyReader) Open() error

func (*PrimaryKeyReader) Read

func (r *PrimaryKeyReader) Read(offset int64, size uint32, dst *[]byte) ([]byte, error)

func (*PrimaryKeyReader) ReadData

func (r *PrimaryKeyReader) ReadData() (*record.Record, int8, error)

func (*PrimaryKeyReader) Version

func (r *PrimaryKeyReader) Version() uint32

type SkipIndexInfo added in v1.5.0

type SkipIndexInfo struct {
	// contains filtered or unexported fields
}

func NewSkipIndexInfo added in v1.5.0

func NewSkipIndexInfo(name string) *SkipIndexInfo

func (*SkipIndexInfo) MustRemove added in v1.5.0

func (si *SkipIndexInfo) MustRemove(lock fileops.FileLockOption)

func (*SkipIndexInfo) Name added in v1.5.0

func (si *SkipIndexInfo) Name() string

func (*SkipIndexInfo) Rename added in v1.5.0

func (si *SkipIndexInfo) Rename(to string, lock fileops.FileLockOption) error

type UniquePicker added in v1.5.0

type UniquePicker struct {
	LinePicker
	// contains filtered or unexported fields
}

func (*UniquePicker) IteratorSegment added in v1.5.0

func (p *UniquePicker) IteratorSegment(maxRowsPreSeg int, fn func(start, end int) bool)

func (*UniquePicker) MarkDuplicates added in v1.5.0

func (p *UniquePicker) MarkDuplicates()

func (*UniquePicker) Pick added in v1.5.0

func (p *UniquePicker) Pick(src *record.ColVal, typ, start, end int) (*record.ColVal, *record.ColVal)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL