entry

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PayloadSizeOffset = int(unsafe.Sizeof(ETInvalid))
	InfoSizeOffset    = int(unsafe.Sizeof(ETInvalid) + unsafe.Sizeof(uint32(0)))
	DescriptorSize    = int(unsafe.Sizeof(ETInvalid) + 2*unsafe.Sizeof(uint32(0)))
)
View Source
const (
	GTInvalid uint32 = iota
	GTNoop
	GTCKp
	GTInternal
	GTCustomizedStart
)

Variables

This section is empty.

Functions

This section is empty.

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) IsCheckpoint

func (desc Base) IsCheckpoint() bool

func (Base) IsFlush

func (desc Base) IsFlush() bool

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) 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) 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
	IsFlush() bool
	IsCheckpoint() bool
}

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)
	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
	TxnId       string
	Checkpoints []*CkpRanges
	Uncommits   string

	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
const (
	ETInvalid Type = iota
	ETNoop
	ETFlush
	ETCheckpoint
	ETUncommitted
	ETTxn
	ETPostCommit
	ETMeta
	ETCustomizedStart
)

Jump to

Keyboard shortcuts

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