Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultMaxWalSize uint64 = 128 * 1024 * 1024 // 128mb
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
func (*Appender) AppendSync ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func NewWriteAheadLogOptions ¶
NewWriteAheadLogOptions handles WAL configurations, the minimal required option is the base path: wal.NewWriteAheadLogOptions(wal.BasePath("some_directory"))
type WriteAheadLog ¶
type WriteAheadLog struct { WriteAheadLogAppendI WriteAheadLogReplayI WriteAheadLogCleanI }
type WriteAheadLogAppendI ¶
type WriteAheadLogAppendI interface { recordio.CloseableI // Append a given record and does NOT execute fsync to guarantee the persistence of the record. Append(record []byte) error // AppendSync a given record and execute fsync to guarantee the persistence of the record. // Has considerably less throughput than Append. AppendSync(record []byte) error // Rotate - The WAL usually auto-rotates after a certain size - this method allows to force this rotation. // This can be useful in scenarios where you want to flush a memstore and rotate the WAL at the same time. // Therefore, this returns the path of the previous wal file that was closed through this operation. Rotate() (string, error) }
func NewAppender ¶
func NewAppender(walOpts *Options) (WriteAheadLogAppendI, error)
type WriteAheadLogCleanI ¶
type WriteAheadLogCleanI interface { // Clean Removes all WAL files and the directory it is contained in Clean() error }
func NewCleaner ¶
func NewCleaner(opts *Options) WriteAheadLogCleanI
type WriteAheadLogCompactI ¶
type WriteAheadLogCompactI interface { // Compact should compact the WAL, but isn't properly implemented just yet Compact() error }
type WriteAheadLogI ¶
type WriteAheadLogI interface { WriteAheadLogAppendI WriteAheadLogReplayI WriteAheadLogCleanI }
func NewWriteAheadLog ¶
func NewWriteAheadLog(opts *Options) (WriteAheadLogI, error)
NewWriteAheadLog creates a new WAL by supplying options, for example using a base path: wal.NewWriteAheadLogOptions(wal.BasePath("some_directory"))
type WriteAheadLogReplayI ¶
type WriteAheadLogReplayI interface { // Replay the whole WAL from start, calling the given process function // for each record in guaranteed order. Replay(process func(record []byte) error) error }
func NewReplayer ¶
func NewReplayer(walOpts *Options) (WriteAheadLogReplayI, error)
Click to show internal directories.
Click to hide internal directories.