log

package
v0.0.0-...-78ea4e3 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Segment struct {
		MaxStoreBytes uint64
		MaxIndexBytes uint64
		InitialOffset uint64
	}
}

type Log

type Log struct {
	Dir    string
	Config Config
	// contains filtered or unexported fields
}

func NewLog

func NewLog(dir string, c Config) (*Log, error)

func (*Log) Append

func (l *Log) Append(record *api.Record) (off uint64, err error)

func (*Log) Close

func (l *Log) Close() error

func (*Log) HighestOffset

func (l *Log) HighestOffset() (uint64, error)

func (*Log) LowestOffset

func (l *Log) LowestOffset() (uint64, error)

func (*Log) Read

func (l *Log) Read(off uint64) (*api.Record, error)

func (*Log) Reader

func (l *Log) Reader() io.Reader

read whole log, needed for implementation coordinate consensus

func (*Log) Remove

func (l *Log) Remove() error

func (*Log) Reset

func (l *Log) Reset() error

func (*Log) Truncate

func (l *Log) Truncate(lowest uint64) error

for saving disk space and removing old segments

type Replicator

type Replicator struct {
	DialOptions []grpc.DialOption
	LocalServer api.LogClient
	// contains filtered or unexported fields
}

func (*Replicator) Close

func (r *Replicator) Close() error

func (*Replicator) Join

func (r *Replicator) Join(name, addr string) error

func (*Replicator) Leave

func (r *Replicator) Leave(name string) error

Jump to

Keyboard shortcuts

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