Documentation
¶
Index ¶
Constants ¶
const LocationSize = 8 + 8 + 4 + TrailerSize
LocationSize is the physical storage of a single item (8 for the key, 8 for the wal offset, 4 for the len)
const TrailerSize = 4
Variables ¶
This section is empty.
Functions ¶
func ReadTrailers ¶ added in v0.9.0
func WriteIndex ¶
WriteIndex is a convenience function to write the contents of `idx` to `path`.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index is an in-memory representation of the batch index as b-tree structure.
func FromVlog ¶
FromVlog produces an index from the data in the value log. It's main use is to re-generate the index in case the index file is damaged or broken in some way. The resulting index is likely not the same as before, but will include items that were popped already.
func (*Index) Len ¶
Len returns the number of items in the WAL. (Not the number of locations or batches!)
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader gives access to a single index on disk
type Trailer ¶
func ReadTrailer ¶
ReadTrailer reads the trailer of the index log. It contains the number of entries in the index.