Documentation ¶
Index ¶
- func ParseFilename(filename string) (uuid.UUID, string, string, backend.Encoding, string, error)
- func ReplayWALAndGetRecords(file *os.File, enc backend.Encoding, handleObj func([]byte) error) ([]common.Record, error, error)
- type AppendBlock
- func (a *AppendBlock) Append(id common.ID, b []byte, start, end uint32) error
- func (a *AppendBlock) BlockID() uuid.UUID
- func (a *AppendBlock) Clear() error
- func (a *AppendBlock) DataLength() uint64
- func (a *AppendBlock) Find(id common.ID, combiner model.ObjectCombiner) ([]byte, error)
- func (a *AppendBlock) Iterator(combiner model.ObjectCombiner) (common.Iterator, error)
- func (a *AppendBlock) Meta() *backend.BlockMeta
- type Config
- type LocalBlock
- type RangeFunc
- type WAL
- func (w *WAL) ClearFolder(dir string) error
- func (w *WAL) GetFilepath() string
- func (w *WAL) LocalBackend() *local.Backend
- func (w *WAL) NewBlock(id uuid.UUID, tenantID string, dataEncoding string) (*AppendBlock, error)
- func (w *WAL) NewFile(blockid uuid.UUID, tenantid string, dir string) (*os.File, backend.Encoding, error)
- func (w *WAL) RescanBlocks(fn RangeFunc, additionalStartSlack time.Duration, log log.Logger) ([]*AppendBlock, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseFilename ¶ added in v1.2.0
ParseFilename returns (blockID, tenant, version, encoding, dataEncoding, error). Example: "00000000-0000-0000-0000-000000000000:1:v2:snappy:v1"
Types ¶
type AppendBlock ¶
type AppendBlock struct {
// contains filtered or unexported fields
}
AppendBlock is a block that is actively used to append new objects to. It stores all data in the appendFile in the order it was received and an in memory sorted index.
func (*AppendBlock) Append ¶ added in v1.2.0
Append adds an id and object to this wal block. start/end should indicate the time range associated with the past object. They are unix epoch seconds.
func (*AppendBlock) BlockID ¶ added in v0.7.0
func (a *AppendBlock) BlockID() uuid.UUID
func (*AppendBlock) Clear ¶
func (a *AppendBlock) Clear() error
func (*AppendBlock) DataLength ¶ added in v0.6.0
func (a *AppendBlock) DataLength() uint64
func (*AppendBlock) Find ¶
func (a *AppendBlock) Find(id common.ID, combiner model.ObjectCombiner) ([]byte, error)
func (*AppendBlock) Iterator ¶ added in v1.2.0
func (a *AppendBlock) Iterator(combiner model.ObjectCombiner) (common.Iterator, error)
func (*AppendBlock) Meta ¶ added in v0.7.0
func (a *AppendBlock) Meta() *backend.BlockMeta
type LocalBlock ¶ added in v0.7.0
type LocalBlock struct { common.BackendBlock // contains filtered or unexported fields }
LocalBlock is a block stored in a local storage. It can be searched and flushed to a remote backend, and permanently tracks the flushed time with a special file in the block
func NewLocalBlock ¶ added in v0.7.0
func NewLocalBlock(ctx context.Context, existingBlock common.BackendBlock, l *local.Backend) (*LocalBlock, error)
func (*LocalBlock) FindTraceByID ¶ added in v1.4.0
func (*LocalBlock) FlushedTime ¶ added in v0.7.0
func (c *LocalBlock) FlushedTime() time.Time
FlushedTime returns the time the block was flushed. Will return 0
if the block was never flushed
func (*LocalBlock) SetFlushed ¶ added in v0.7.0
func (c *LocalBlock) SetFlushed(ctx context.Context) error
type RangeFunc ¶ added in v1.4.0
extracts a time range from an object. start/end times returned are unix epoch seconds
type WAL ¶
type WAL struct {
// contains filtered or unexported fields
}
func (*WAL) ClearFolder ¶ added in v1.2.0
func (*WAL) GetFilepath ¶ added in v1.2.0
func (*WAL) LocalBackend ¶ added in v0.7.0
func (*WAL) RescanBlocks ¶ added in v1.0.0
func (w *WAL) RescanBlocks(fn RangeFunc, additionalStartSlack time.Duration, log log.Logger) ([]*AppendBlock, error)
RescanBlocks returns a slice of append blocks from the wal folder