wal

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentEntriesRec = WALRecordEntriesV3

The current type of Entries that this distribution writes. Loki can read in a backwards compatible manner, but will write the newest variant. TODO: Change to WALRecordEntriesV3?

Variables

This section is empty.

Functions

func DecodeEntries

func DecodeEntries(b []byte, version RecordType, rec *Record) error

func DecodeRecord

func DecodeRecord(b []byte, walRec *Record) (err error)

Types

type Record

type Record struct {
	UserID string
	Series []record.RefSeries

	RefEntries []RefEntries
	// contains filtered or unexported fields
}

Record is a struct combining the series and samples record.

func (*Record) AddEntries

func (r *Record) AddEntries(fp uint64, counter int64, entries ...logproto.Entry)

func (*Record) EncodeEntries

func (r *Record) EncodeEntries(version RecordType, b []byte) []byte

func (*Record) EncodeSeries

func (r *Record) EncodeSeries(b []byte) []byte

func (*Record) IsEmpty

func (r *Record) IsEmpty() bool

func (*Record) Reset

func (r *Record) Reset()

type RecordType

type RecordType byte

RecordType represents the type of the WAL/Checkpoint record.

const (

	// WALRecordSeries is the type for the WAL record for series.
	WALRecordSeries RecordType = iota
	// WALRecordEntriesV1 is the type for the WAL record for samples.
	WALRecordEntriesV1
	// CheckpointRecord is the type for the Checkpoint record based on protos.
	CheckpointRecord
	// WALRecordEntriesV2 is the type for the WAL record for samples with an
	// additional counter value for use in replaying without the ordering constraint.
	WALRecordEntriesV2
	// WALRecordEntriesV3 is the type for the WAL record for samples with structured metadata.
	WALRecordEntriesV3
)

type RefEntries

type RefEntries struct {
	Counter int64
	Ref     chunks.HeadSeriesRef
	Entries []logproto.Entry
}

type ResettingPool

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

func NewRecordPool

func NewRecordPool() *ResettingPool

func (*ResettingPool) GetBytes

func (p *ResettingPool) GetBytes() *[]byte

func (*ResettingPool) GetRecord

func (p *ResettingPool) GetRecord() *Record

func (*ResettingPool) PutBytes

func (p *ResettingPool) PutBytes(b *[]byte)

func (*ResettingPool) PutRecord

func (p *ResettingPool) PutRecord(r *Record)

Jump to

Keyboard shortcuts

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