entry

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 9 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
	GTUncommit
	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) GetMetaBuf

func (desc Base) GetMetaBuf() []byte

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) 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) 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 *common.MemNode, 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)
	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)

	Unmarshal([]byte) error
	UnmarshalFromNode(*common.MemNode, bool) error
	ReadFrom(io.Reader) (int64, error)
	WriteTo(io.Writer) (int64, error)

	WaitDone() error
	DoneWithErr(error)
	GetError() error

	Free()

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

type Info

type Info struct {
	Group uint32
	// CommitId    uint64 //0 for RollBack
	TxnId       uint64 //0 for entrys not in txn
	Checkpoints []CkpRanges
	Uncommits   []Tid

	GroupLSN uint64

	PostCommitVersion int
	Info              any
}

func Unmarshal

func Unmarshal(buf []byte) *Info

func (*Info) Marshal

func (info *Info) Marshal() []byte

func (*Info) ToString

func (info *Info) ToString() string

type Tid

type Tid struct {
	Group uint32
	Tid   uint64
}

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