entry

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

type uint16 version uint16 payload size uint32 info size uint32

View Source
const (
	IOET_WALEntry_V1              uint16 = 1
	IOET_WALEntry_Invalid         uint16 = 2000
	IOET_WALEntry_Checkpoint      uint16 = 2001
	IOET_WALEntry_PostCommit      uint16 = 2002
	IOET_WALEntry_Uncommitted     uint16 = 2003
	IOET_WALEntry_Txn             uint16 = 2004
	IOET_WALEntry_Test            uint16 = 2005
	IOET_WALEntry_CustomizedStart uint16 = 2006

	IOET_WALEntry_CurrVer = IOET_WALEntry_V1
)
View Source
const (
	GTInvalid uint32 = iota
	GTNoop
	GTCKp
	GTInternal
	GTCustomizedStart
)

Variables

This section is empty.

Functions

func UnmarshalEntry added in v0.8.0

func UnmarshalEntry(b []byte) (any, error)

Types

type Base

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

func GetBase

func GetBase() *Base

func (*Base) DoneWithErr

func (b *Base) DoneWithErr(err error)

func (*Base) Duration

func (b *Base) Duration() time.Duration

func (*Base) Free

func (b *Base) Free()

func (*Base) GetError

func (b *Base) GetError() error

func (*Base) GetInfo

func (b *Base) GetInfo() any

func (*Base) GetInfoBuf

func (b *Base) GetInfoBuf() []byte

func (Base) GetInfoSize

func (desc Base) GetInfoSize() int

func (*Base) GetLsn added in v0.6.0

func (b *Base) GetLsn() (gid uint32, lsn uint64)

func (Base) GetMetaBuf

func (desc Base) GetMetaBuf() []byte

func (Base) GetMetaSize added in v0.6.0

func (desc Base) GetMetaSize() int

func (*Base) GetPayload

func (b *Base) GetPayload() []byte

func (Base) GetPayloadSize

func (desc Base) GetPayloadSize() int

func (Base) GetType

func (desc Base) GetType() Type

func (Base) GetVersion added in v0.8.0

func (desc Base) GetVersion() uint16

func (*Base) IsPrintTime

func (b *Base) IsPrintTime() bool

func (*Base) Marshal added in v0.6.0

func (b *Base) Marshal() (buf []byte, err error)

func (*Base) PrepareWrite added in v0.6.0

func (b *Base) PrepareWrite()

func (*Base) PrintTime

func (b *Base) PrintTime()

func (*Base) ReadAt

func (b *Base) ReadAt(r *os.File, offset int) (int, error)

func (*Base) ReadFrom

func (b *Base) ReadFrom(r io.Reader) (int64, error)

func (Base) ReadMeta

func (desc Base) ReadMeta(r io.Reader) (int, error)

func (*Base) SetInfo

func (b *Base) SetInfo(info any)

func (*Base) SetInfoBuf

func (b *Base) SetInfoBuf(buf []byte)

func (Base) SetInfoSize

func (desc Base) SetInfoSize(size int)

func (*Base) SetPayload added in v0.6.0

func (b *Base) SetPayload(buf []byte) error

func (Base) SetPayloadSize

func (desc Base) SetPayloadSize(size int)

func (Base) SetType

func (desc Base) SetType(t Type)

func (Base) SetVersion added in v0.8.0

func (desc Base) SetVersion(t uint16)

func (*Base) StartTime

func (b *Base) StartTime()

func (Base) TotalSize

func (desc Base) TotalSize() int

func (Base) TotalSizeExpectMeta

func (desc Base) TotalSizeExpectMeta() int

func (*Base) Unmarshal

func (b *Base) Unmarshal(buf []byte) error

func (*Base) UnmarshalBinary added in v0.8.0

func (b *Base) UnmarshalBinary(buf []byte) (n int64, err error)

func (*Base) UnmarshalFromNode

func (b *Base) UnmarshalFromNode(n []byte, own bool) error

func (*Base) WaitDone

func (b *Base) WaitDone() error

func (*Base) WriteTo

func (b *Base) WriteTo(w io.Writer) (int64, error)

type CkpRanges

type CkpRanges struct {
	Group   uint32
	Ranges  *common.ClosedIntervals
	Command map[uint64]CommandInfo
}

func (CkpRanges) String

func (r CkpRanges) String() string

type CommandInfo

type CommandInfo struct {
	CommandIds []uint32
	Size       uint32
}

type Desc

type Desc interface {
	GetType() Type
	SetType(Type)
	GetPayloadSize() int
	SetPayloadSize(int)
	GetInfoSize() int
	SetInfoSize(int)
	GetMetaSize() int
	TotalSize() int
	GetMetaBuf() []byte
}

type Entry

type Entry interface {
	Desc
	GetPayload() []byte
	SetInfo(any)
	GetInfo() any
	GetInfoBuf() []byte
	SetInfoBuf(buf []byte)

	SetPayload([]byte) error
	UnmarshalFromNode([]byte, bool) error

	Unmarshal(buf []byte) error
	Marshal() (buf []byte, err error)
	ReadFrom(io.Reader) (int64, error)
	UnmarshalBinary(buf []byte) (n int64, err error)
	ReadAt(r *os.File, offset int) (int, error)
	WriteTo(io.Writer) (int64, error)
	PrepareWrite()

	GetLsn() (gid uint32, lsn uint64)
	WaitDone() error
	DoneWithErr(error)
	GetError() error

	Free()

	Duration() time.Duration
	StartTime()
	PrintTime()
	IsPrintTime() bool
}

type Info

type Info struct {
	Group       uint32
	Checkpoints []*CkpRanges
	GroupLSN    uint64

	TargetLsn uint64
	Info      any
}

func NewEmptyInfo added in v0.6.0

func NewEmptyInfo() *Info

func (*Info) Marshal

func (info *Info) Marshal() (buf []byte, err error)

func (*Info) ReadFrom added in v0.6.0

func (info *Info) ReadFrom(r io.Reader) (n int64, err error)

func (*Info) ToString

func (info *Info) ToString() string

func (*Info) Unmarshal added in v0.6.0

func (info *Info) Unmarshal(buf []byte) error

func (*Info) WriteTo added in v0.6.0

func (info *Info) WriteTo(w io.Writer) (n int64, err error)

type Type

type Type = uint16

Jump to

Keyboard shortcuts

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