vlog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PageSize int64 = 4096

Functions

This section is empty.

Types

type Iter

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

NOTE: There is quite some performance potential hidden here, if we manage to fit Iter in a single cache line:

Possible ideas to get down from 104 to 64:

  • Use only one len field. -> -8
  • Always pass Item out on Next() as out param. -> -32 -> Not possible, because the item might not be consumed directly as we might realize that another iter has more priority.
  • Do not use exhausted, set len to 0. -> Does not work, as currLen is zero before last call to Next()
  • continueOnErr can be part of Log. -8 (if exhausted goes away too)
  • error could be returned on Next() directly.

func (*Iter) CurrentLocation

func (li *Iter) CurrentLocation() item.Location

CurrentLocation returns the location of the current entry. It is not valid before Next() has been called.

func (*Iter) Err

func (li *Iter) Err() error

func (*Iter) Exhausted

func (li *Iter) Exhausted() bool

func (*Iter) FirstKey

func (li *Iter) FirstKey() item.Key

Key returns the key this iterator was created with This is not the current key of the item!

func (*Iter) Item

func (li *Iter) Item() item.Item

Item returns the current item. It is not valid before Next() has been called.

func (*Iter) Next

func (li *Iter) Next() bool

type Iters

type Iters []Iter

func (*Iters) Fix

func (is *Iters) Fix(i int)

func (*Iters) Len

func (is *Iters) Len() int

func (*Iters) Push

func (is *Iters) Push(i Iter)

type Log

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

func Open

func Open(path string, syncOnWrite bool) (*Log, error)

func (*Log) At

func (l *Log) At(loc item.Location, continueOnErr bool) Iter

func (*Log) Close

func (l *Log) Close() error

func (*Log) IsEmpty

func (l *Log) IsEmpty() bool

func (*Log) Push

func (l *Log) Push(items item.Items) (loc item.Location, err error)

func (*Log) Sync

func (l *Log) Sync(force bool) error

Jump to

Keyboard shortcuts

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