Documentation
¶
Index ¶
- Constants
- func PutBufferWriterToPool(fw *BufferWriter)
- type BufferWriter
- func (fw *BufferWriter) AddPadding(size int) error
- func (fw *BufferWriter) Buffer() ([]byte, io.Closer, error)
- func (fw *BufferWriter) Close() error
- func (fw *BufferWriter) Flush() error
- func (fw *BufferWriter) Pos() uint64
- func (fw *BufferWriter) Read(buf []byte) (int, error)
- func (fw *BufferWriter) ReadFrom(r io.Reader) (int64, error)
- func (fw *BufferWriter) Remove() error
- func (fw *BufferWriter) Reset()
- func (fw *BufferWriter) Write(bufs ...[]byte) error
- func (fw *BufferWriter) WriteAt(buf []byte, pos uint64) error
- type ByteSlice
- type Metadata
- type RealByteSlice
- type StringIter
- type Symbols
- type TOC
- type Writer
Constants ¶
const ( // MagicIndex 4 bytes at the head of an index file. MagicIndex = 0xBAAAD700 // HeaderLen represents number of bytes reserved of index for header. HeaderLen = 5 // FormatV2 represents the index file format version. FormatV2 = 2 IndexFilename = "index" SegmentsIndexWriterBufSize = 2 * 0x1000 // small for segments BlocksIndexWriterBufSize = 1 << 22 // large for blocks )
Variables ¶
This section is empty.
Functions ¶
func PutBufferWriterToPool ¶
func PutBufferWriterToPool(fw *BufferWriter)
Types ¶
type BufferWriter ¶
type BufferWriter struct {
// contains filtered or unexported fields
}
func GetBufferWriterFromPool ¶
func GetBufferWriterFromPool() *BufferWriter
func NewBufferWriter ¶
func NewBufferWriter() *BufferWriter
NewBufferWriter returns a new BufferWriter. todo: pooling memory
func (*BufferWriter) AddPadding ¶
func (fw *BufferWriter) AddPadding(size int) error
func (*BufferWriter) Close ¶
func (fw *BufferWriter) Close() error
func (*BufferWriter) Flush ¶
func (fw *BufferWriter) Flush() error
func (*BufferWriter) Pos ¶
func (fw *BufferWriter) Pos() uint64
func (*BufferWriter) Remove ¶
func (fw *BufferWriter) Remove() error
func (*BufferWriter) Reset ¶
func (fw *BufferWriter) Reset()
func (*BufferWriter) Write ¶
func (fw *BufferWriter) Write(bufs ...[]byte) error
type RealByteSlice ¶
type RealByteSlice []byte
func (RealByteSlice) Len ¶
func (b RealByteSlice) Len() int
func (RealByteSlice) Range ¶
func (b RealByteSlice) Range(start, end int) []byte
func (RealByteSlice) Sub ¶
func (b RealByteSlice) Sub(start, end int) ByteSlice
type StringIter ¶
type StringIter interface {
// Next advances the iterator and returns true if another value was found.
Next() bool
// At returns the value at the current iterator position.
At() string
// Err returns the last error of the iterator.
Err() error
}
StringIter iterates over a sorted list of strings.
type Symbols ¶
type Symbols struct {
// contains filtered or unexported fields
}
func NewSymbols ¶
NewSymbols returns a Symbols object for symbol lookups.
type TOC ¶
type TOC struct {
Symbols uint64
Series uint64
LabelIndices uint64
LabelIndicesTable uint64
Postings uint64
PostingsTable uint64
FingerprintOffsets uint64
Metadata Metadata
}
TOC represents index Table Of Content that states where each section of index starts.
type Writer ¶
type Writer struct {
Version int
// contains filtered or unexported fields
}
Writer implements the IndexWriter interface for the standard serialization format.
func NewWriter ¶
NewWriter returns a new Writer to the given filename. It serializes data in format version 2.
func (*Writer) AddSeries ¶
func (w *Writer) AddSeries(ref storage.SeriesRef, lset phlaremodel.Labels, fp model.Fingerprint, chunks ...index.ChunkMeta) error
AddSeries adds the series one at a time along with its chunks. Requires a specific fingerprint to be passed in the case where the "desired" fingerprint differs from what labels.Hash() produces. For example, multitenant TSDBs embed a tenant label, but the actual series has no such label and so the derived fingerprint differs.
func (*Writer) ReleaseIndexBuffer ¶
func (w *Writer) ReleaseIndexBuffer() *BufferWriter
todo better name, nicer api