segment

package
v0.0.0-...-ee19457 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Segment

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

Segment represents a segment of the log

func NewSegment

func NewSegment(directory string, baseOffset uint64, config index.Config) (*Segment, error)

NewSegment creates a new segment

func (*Segment) Close

func (segment *Segment) Close() error

Close closes the segment

func (*Segment) GetBaseOffset

func (segment *Segment) GetBaseOffset() uint64

GetBaseOffset returns the base offset of the segment

func (*Segment) GetNextOffset

func (segment *Segment) GetNextOffset() uint64

GetNextOffset returns the next offset of the segment

func (*Segment) GetStore

func (segment *Segment) GetStore() *store.Store

GetStore returns the store of the segment

func (*Segment) IsMaxed

func (segment *Segment) IsMaxed() bool

IsMaxed returns true if the segment is maxed out

func (*Segment) Read

func (segment *Segment) Read(offset uint64) (*proto.Data, error)

Read reads a record from the segment

func (*Segment) Remove

func (segment *Segment) Remove() error

Remove removes the segment

func (*Segment) Write

func (segment *Segment) Write(record *proto.Data) (offset uint64, err error)

Write writes a record to the segment

Jump to

Keyboard shortcuts

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