Documentation ¶
Index ¶
- Constants
- Variables
- func CloseChain(fn ...writeClose) error
- func Get() []byte
- func LastSequenceFile(dir string) (string, error)
- func NewListPostings(chks []TimeChunk) *chunkSet
- func NextSequenceFile(dir string) (string, int, error)
- func SequenceFiles(dir string) ([]string, error)
- type Builder
- type ChunkMeta
- type ChunkMetaIndex
- type DiskLogIterator
- type IndexReader
- type IndexW
- func (tw *IndexW) AddSeries(isSeries bool, lset labels.Labels, chunks ...ChunkMeta) (uint64, error)
- func (tw *IndexW) AppendKey(key []byte, ref uint64) error
- func (tw *IndexW) Close() error
- func (tw *IndexW) FinishTag() error
- func (tw *IndexW) GetSeries(lset labels.Labels) (uint64, bool)
- func (tw *IndexW) GetValueOffset() uint64
- func (tw *IndexW) SetBaseTimeStamp(timeStamp int64)
- func (tw *IndexW) SetTagName(tagName []byte)
- func (tw *IndexW) WriteChunks(b [][]byte) (uint64, error)
- func (tw *IndexW) WritePostings(ref ...[]uint64) (uint64, error)
- type IndexWriter
- type IteratorLabel
- type LogIterator
- type LogReader
- type LogW
- type LogWriter
- type MergeLabelIterator
- type MergeLogIterator
- type MergeWriterIterator
- type MergedIterator
- type TableOps
- func (d *TableOps) CreateIndexFrom(dir string) (*IndexW, error)
- func (t *TableOps) CreateIndexReader(dir string, ulid ulid.ULID, skiplistLevel int) *IndexReader
- func (d *TableOps) CreateLogFrom(dir string) *LogW
- func (t *TableOps) CreateLogReader(dir string, uid ulid.ULID, offset []uint64) *LogReader
- func (t *TableOps) RemoveIndexReader(dir string, ulid ulid.ULID) error
- type TimeChunk
- type WriterIterator
Constants ¶
View Source
const ( KiB = 1024 MiB = KiB * 1024 GiB = MiB * 10240 )
View Source
const ( INDEX = iota DATA )
View Source
const ( LogMaxSize = 512 * MiB //100 KB DefaultBlockCacheCapacity = 8 * MiB )
Variables ¶
View Source
var ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Functions ¶
func CloseChain ¶
func CloseChain(fn ...writeClose) error
func LastSequenceFile ¶
func NewListPostings ¶
func NewListPostings(chks []TimeChunk) *chunkSet
func SequenceFiles ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *Builder
type ChunkMetaIndex ¶
type DiskLogIterator ¶
type DiskLogIterator struct {
// contains filtered or unexported fields
}
func (*DiskLogIterator) Next ¶
func (t *DiskLogIterator) Next() bool
func (*DiskLogIterator) Value ¶
func (t *DiskLogIterator) Value() []byte
type IndexReader ¶
type IndexReader struct { MsgTagName string // contains filtered or unexported fields }
func NewIndexReader ¶
func NewIndexReader(dir string, skipListlevel int, bcache, mcache *cache.NamespaceGetter) *IndexReader
缺乏错误处理
func (*IndexReader) ChunkReader ¶
func (r *IndexReader) ChunkReader() chunks.ChunkReader
func (*IndexReader) Close ¶
func (r *IndexReader) Close() error
func (*IndexReader) Iterator ¶
func (r *IndexReader) Iterator() IteratorLabel
func (*IndexReader) MaxDoc ¶
func (r *IndexReader) MaxDoc() float64
type IndexW ¶
type IndexW struct {
// contains filtered or unexported fields
}
写文件
func CreateIndexFrom ¶
func (*IndexW) GetValueOffset ¶
func (*IndexW) SetBaseTimeStamp ¶
func (*IndexW) SetTagName ¶
type IndexWriter ¶
type IndexWriter interface { SetTagName([]byte) AppendKey([]byte, uint64) error Close() error FinishTag() error AddSeries(bool, labels.Labels, ...ChunkMeta) (uint64, error) WritePostings(ref ...[]uint64) (uint64, error) WriteChunks([][]byte) (uint64, error) GetSeries(labels.Labels) (uint64, bool) SetBaseTimeStamp(int64) }
type IteratorLabel ¶
type IteratorLabel interface { iterator.SingleIterator Iter() WriterIterator }
type LogIterator ¶
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
func NewLogReader ¶
func NewLogReader(dir string, logOffset []uint64, lcache *cache.NamespaceGetter) *LogReader
func (*LogReader) Iterator ¶
func (cr *LogReader) Iterator() LogIterator
type LogW ¶
type LogW struct {
// contains filtered or unexported fields
}
chunk writer
func CreateLogFrom ¶
func (*LogW) WriteBytes ¶
func (*LogW) WriteIndex ¶
type MergeLabelIterator ¶
type MergeLabelIterator struct { MergedIterator // contains filtered or unexported fields }
func NewMergeLabelIterator ¶
func NewMergeLabelIterator(iters ...IteratorLabel) *MergeLabelIterator
func (*MergeLabelIterator) Iters ¶
func (t *MergeLabelIterator) Iters() []WriterIterator
返回同一个label的块
type MergeLogIterator ¶
type MergeLogIterator struct {
// contains filtered or unexported fields
}
func NewMergeLogIterator ¶
func NewMergeLogIterator(iters ...LogIterator) *MergeLogIterator
func (*MergeLogIterator) Next ¶
func (t *MergeLogIterator) Next() bool
type MergeWriterIterator ¶
type MergeWriterIterator struct { MergedIterator // contains filtered or unexported fields }
func NewMergeWriterIterator ¶
func NewMergeWriterIterator(segmentNum []uint64, baseTime []int64, msgTagName string, iters ...WriterIterator) *MergeWriterIterator
func (*MergeWriterIterator) Write ¶
func (m *MergeWriterIterator) Write(labelName string, w IndexWriter) error
type MergedIterator ¶
type MergedIterator struct {
// contains filtered or unexported fields
}
多路归并排序
func NewMergedIterator ¶
func NewMergedIterator(iters ...iterator.SingleIterator) *MergedIterator
func (*MergedIterator) First ¶
func (m *MergedIterator) First() bool
func (*MergedIterator) Key ¶
func (m *MergedIterator) Key() []byte
func (*MergedIterator) Next ¶
func (m *MergedIterator) Next() bool
func (*MergedIterator) Values ¶
func (m *MergedIterator) Values() [][]byte
type TableOps ¶
type TableOps struct {
// contains filtered or unexported fields
}
磁盘数据
func NewTableOps ¶
func NewTableOps() *TableOps
func (*TableOps) CreateIndexReader ¶
func (*TableOps) CreateLogFrom ¶
func (*TableOps) CreateLogReader ¶
type WriterIterator ¶
Click to show internal directories.
Click to hide internal directories.