tail

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tailer

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

Tailer tails a write ahead log in a given directory.

func Tail

func Tail(ctx context.Context, dir string) (*Tailer, error)

Tail the prometheus/tsdb write ahead log in the given directory. Checkpoints are read before reading any WAL segments. Tailing may fail if we are racing with the DB itself in deleting obsolete checkpoints and segments. The caller should implement relevant logic to retry in those cases.

func (*Tailer) Close

func (t *Tailer) Close() error

Close all underlying resources of the tailer.

func (*Tailer) CurrentSegment

func (t *Tailer) CurrentSegment() int

CurrentSegment returns the index of the currently read segment. If no successful read has been performed yet, it may be negative.

func (*Tailer) Offset

func (t *Tailer) Offset() int

Offset returns the approximate current position of the tailer in the WAL with respect to Size().

func (*Tailer) Read

func (t *Tailer) Read(b []byte) (int, error)

func (*Tailer) Size

func (t *Tailer) Size() (int, error)

Size returns the total size of the WAL as indicated by its highest segment. It includes the size of any past segments that may no longer exist.

Jump to

Keyboard shortcuts

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