package wal
Import Path
github.com/polarsignals/wal (on go.dev)
Dependency Relation
imports 16 packages, and imported by 2 packages
Package-Level Type Names (total 3)
LogStore is used to provide an interface for storing
and retrieving logs in a durable fashion.
( LogStore) Close() error
FirstIndex returns the first index written. 0 for no entries.
GetLog gets a log entry at a given index.
LastIndex returns the last index written. 0 for no entries.
StoreLogs stores multiple log entries.
TruncateBack truncates the back of the log by removing all entries that
are after the provided `index`. In other words the entry at `index`
becomes the last entry in the log.
TruncateFront truncates the front of the log by removing all entries that
are before the provided `index`. In other words the entry at
`index` becomes the first entry in the log.
*WAL
LogStore : github.com/polarsignals/wal/types.SegmentReader
LogStore : github.com/prometheus/common/expfmt.Closer
LogStore : io.Closer
Appends prometheus.Counter
BytesWritten prometheus.Counter
EntriesRead prometheus.Counter
EntriesTruncated *prometheus.CounterVec
EntriesWritten prometheus.Counter
EntryBytesRead prometheus.Counter
LastSegmentAgeSeconds prometheus.Gauge
SegmentRotations prometheus.Counter
Truncations *prometheus.CounterVec
func WithMetrics(m *Metrics) walOpt
func github.com/polarsignals/frostdb/wal.WithStoreMetrics(m *Metrics) wal.Option
WAL is a write-ahead log suitable for github.com/hashicorp/raft.
Close closes all open files related to the WAL. The WAL is in an invalid
state and should not be used again after this is called. It is safe (though a
no-op) to call it multiple times and concurrent reads and writes will either
complete safely or get ErrClosed returned depending on sequencing. Generally
reads and writes should be stopped before calling this to avoid propagating
errors to users during shutdown but it's safe from a data-race perspective.
FirstIndex returns the first index written. 0 for no entries.
GetLog gets a log entry at a given index.
LastIndex returns the last index written. 0 for no entries.
StoreLogs stores multiple log entries.
(*WAL) TruncateBack(index uint64) error
(*WAL) TruncateFront(index uint64) error
*WAL : LogStore
*WAL : github.com/polarsignals/wal/types.SegmentReader
*WAL : github.com/prometheus/common/expfmt.Closer
*WAL : io.Closer
func Open(dir string, opts ...walOpt) (*WAL, error)
Package-Level Functions (total 6)
Open attempts to open the WAL stored in dir. If there are no existing WAL
files a new WAL will be initialized there. The dir must already exist and be
readable and writable to the current process. If existing files are found,
recovery is attempted. If recovery is not possible an error is returned,
otherwise the returned *WAL is in a state ready for use.
WithLogger is an option that allows a custom logger to be used.
WithMetaStore is an option that allows a custom MetaStore to be provided to
the WAL. If not used the default MetaStore is used.
WithMetrics is an option that allows specifying a custom metrics object.
WithSegmentFiler is an option that allows a custom SegmentFiler (and hence
Segment Reader/Writer implementation) to be provided to the WAL. If not used
the default SegmentFiler is used.
WithSegmentSize is an option that allows a custom segmentSize to be set.
Package-Level Variables (total 6)
var ErrCorrupt error var ErrNotFound error var ErrOutOfRange error![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |