updates

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: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareAppendNode added in v0.6.0

func CompareAppendNode(e, o txnif.MVCCNode) int

func NewEmptyAppendNode added in v0.6.0

func NewEmptyAppendNode() txnif.MVCCNode

func NewEmptyDeleteNode added in v0.6.0

func NewEmptyDeleteNode() txnif.MVCCNode

Types

type AppendNode

type AppendNode struct {
	*txnbase.TxnMVCCNode
	// contains filtered or unexported fields
}

func MockAppendNode

func MockAppendNode(ts types.TS, startRow, maxRow uint32, mvcc *MVCCHandle) *AppendNode

func NewAppendNode

func NewAppendNode(
	txn txnif.AsyncTxn,
	startRow, maxRow uint32,
	mvcc *MVCCHandle) *AppendNode

func NewCommittedAppendNode

func NewCommittedAppendNode(
	ts types.TS,
	startRow, maxRow uint32,
	mvcc *MVCCHandle) *AppendNode

func (*AppendNode) ApplyCommit

func (node *AppendNode) ApplyCommit(index *wal.Index) error

func (*AppendNode) ApplyRollback

func (node *AppendNode) ApplyRollback(index *wal.Index) (err error)

func (*AppendNode) CloneAll added in v0.6.0

func (node *AppendNode) CloneAll() txnif.MVCCNode

func (*AppendNode) CloneData added in v0.6.0

func (node *AppendNode) CloneData() txnif.MVCCNode

func (*AppendNode) Close added in v0.7.0

func (node *AppendNode) Close()

func (*AppendNode) GeneralDesc

func (node *AppendNode) GeneralDesc() string

func (*AppendNode) GeneralString

func (node *AppendNode) GeneralString() string

func (*AppendNode) GeneralVerboseString

func (node *AppendNode) GeneralVerboseString() string

func (*AppendNode) GetCommitTS

func (node *AppendNode) GetCommitTS() types.TS

func (*AppendNode) GetID

func (node *AppendNode) GetID() *common.ID

func (*AppendNode) GetMaxRow

func (node *AppendNode) GetMaxRow() uint32

func (*AppendNode) GetStartRow added in v0.6.0

func (node *AppendNode) GetStartRow() uint32

func (*AppendNode) Is1PC added in v0.6.0

func (node *AppendNode) Is1PC() bool

func (*AppendNode) MakeCommand

func (node *AppendNode) MakeCommand(id uint32) (cmd txnif.TxnCmd, err error)

func (*AppendNode) PrepareCommit

func (node *AppendNode) PrepareCommit() error

func (*AppendNode) PrepareRollback

func (node *AppendNode) PrepareRollback() (err error)

func (*AppendNode) ReadFrom

func (node *AppendNode) ReadFrom(r io.Reader) (n int64, err error)

func (*AppendNode) Set1PC added in v0.6.0

func (node *AppendNode) Set1PC()

func (*AppendNode) SetLogIndex

func (node *AppendNode) SetLogIndex(idx *wal.Index)

func (*AppendNode) SetMaxRow

func (node *AppendNode) SetMaxRow(row uint32)

func (*AppendNode) String added in v0.6.0

func (node *AppendNode) String() string

func (*AppendNode) Update added in v0.6.0

func (node *AppendNode) Update(txnif.MVCCNode)

func (*AppendNode) WriteTo

func (node *AppendNode) WriteTo(w io.Writer) (n int64, err error)

type DeleteChain

type DeleteChain struct {
	*sync.RWMutex
	*txnbase.MVCCChain
	// contains filtered or unexported fields
}

func NewDeleteChain

func NewDeleteChain(rwlocker *sync.RWMutex, mvcc *MVCCHandle) *DeleteChain

func (*DeleteChain) AddDeleteCnt

func (chain *DeleteChain) AddDeleteCnt(cnt uint32)

func (*DeleteChain) AddMergeNode

func (chain *DeleteChain) AddMergeNode() txnif.DeleteNode

func (*DeleteChain) AddNodeLocked

func (chain *DeleteChain) AddNodeLocked(txn txnif.AsyncTxn, deleteType handle.DeleteType) txnif.DeleteNode

func (*DeleteChain) Close added in v0.7.0

func (chain *DeleteChain) Close()

func (*DeleteChain) CollectDeletesInRange

func (chain *DeleteChain) CollectDeletesInRange(
	startTs, endTs types.TS,
	rwlocker *sync.RWMutex) (mask *roaring.Bitmap, indexes []*wal.Index, err error)

CollectDeletesInRange collects [startTs, endTs)

func (*DeleteChain) CollectDeletesLocked

func (chain *DeleteChain) CollectDeletesLocked(
	ts types.TS,
	collectIndex bool,
	rwlocker *sync.RWMutex) (txnif.DeleteNode, error)

func (*DeleteChain) DeleteInDeleteView added in v0.6.0

func (chain *DeleteChain) DeleteInDeleteView(deleteNode *DeleteNode)

func (*DeleteChain) DepthLocked

func (chain *DeleteChain) DepthLocked() int

func (*DeleteChain) GetController

func (chain *DeleteChain) GetController() *MVCCHandle

func (*DeleteChain) GetDeleteCnt

func (chain *DeleteChain) GetDeleteCnt() uint32

func (*DeleteChain) GetDeleteNodeByRow added in v0.6.0

func (chain *DeleteChain) GetDeleteNodeByRow(row uint32) (n *DeleteNode)

func (*DeleteChain) HasDeleteIntentsPreparedInLocked added in v0.6.0

func (chain *DeleteChain) HasDeleteIntentsPreparedInLocked(from, to types.TS) (found bool)

any uncommited node, return true any committed node with prepare ts within [from, to], return true

func (*DeleteChain) InsertInDeleteView added in v0.6.0

func (chain *DeleteChain) InsertInDeleteView(row uint32, deleteNode *DeleteNode)

func (*DeleteChain) IsDeleted

func (chain *DeleteChain) IsDeleted(row uint32, ts types.TS, rwlocker *sync.RWMutex) (deleted bool, err error)

func (*DeleteChain) OnReplayNode

func (chain *DeleteChain) OnReplayNode(deleteNode *DeleteNode)

func (*DeleteChain) PrepareRangeDelete

func (chain *DeleteChain) PrepareRangeDelete(start, end uint32, ts types.TS) (err error)

func (*DeleteChain) RemoveNodeLocked

func (chain *DeleteChain) RemoveNodeLocked(node txnif.DeleteNode)

func (*DeleteChain) StringLocked

func (chain *DeleteChain) StringLocked() string

func (*DeleteChain) UpdateLocked

func (chain *DeleteChain) UpdateLocked(node *DeleteNode)

type DeleteNode

type DeleteNode struct {
	*common.GenericDLNode[txnif.MVCCNode]
	*txnbase.TxnMVCCNode
	// contains filtered or unexported fields
}

func NewDeleteNode

func NewDeleteNode(txn txnif.AsyncTxn, dt handle.DeleteType) *DeleteNode

func NewMergedNode

func NewMergedNode(commitTs types.TS) *DeleteNode

func (*DeleteNode) AddLogIndexLocked

func (node *DeleteNode) AddLogIndexLocked(index *wal.Index)

func (*DeleteNode) AddLogIndexesLocked

func (node *DeleteNode) AddLogIndexesLocked(indexes []*wal.Index)

func (*DeleteNode) ApplyCommit

func (node *DeleteNode) ApplyCommit(index *wal.Index) (err error)

func (*DeleteNode) ApplyRollback

func (node *DeleteNode) ApplyRollback(index *wal.Index) (err error)

func (*DeleteNode) AttachTo

func (node *DeleteNode) AttachTo(chain *DeleteChain)

func (*DeleteNode) CloneAll added in v0.6.0

func (node *DeleteNode) CloneAll() txnif.MVCCNode

func (*DeleteNode) CloneData added in v0.6.0

func (node *DeleteNode) CloneData() txnif.MVCCNode

func (*DeleteNode) DeletedRows added in v0.6.0

func (node *DeleteNode) DeletedRows() (rows []uint32)

func (*DeleteNode) GeneralDesc

func (node *DeleteNode) GeneralDesc() string

func (*DeleteNode) GeneralString

func (node *DeleteNode) GeneralString() string

func (*DeleteNode) GeneralVerboseString

func (node *DeleteNode) GeneralVerboseString() string

func (*DeleteNode) GetCardinalityLocked

func (node *DeleteNode) GetCardinalityLocked() uint32

func (*DeleteNode) GetChain

func (node *DeleteNode) GetChain() txnif.DeleteChain

func (*DeleteNode) GetCommitTSLocked

func (node *DeleteNode) GetCommitTSLocked() types.TS

func (*DeleteNode) GetDeleteMaskLocked

func (node *DeleteNode) GetDeleteMaskLocked() *roaring.Bitmap

func (*DeleteNode) GetID

func (node *DeleteNode) GetID() *common.ID

func (*DeleteNode) GetPrepareTS added in v0.6.0

func (node *DeleteNode) GetPrepareTS() types.TS

func (*DeleteNode) GetRowMaskRefLocked

func (node *DeleteNode) GetRowMaskRefLocked() *roaring.Bitmap

func (*DeleteNode) GetStartTS

func (node *DeleteNode) GetStartTS() types.TS

func (*DeleteNode) HasOverlapLocked

func (node *DeleteNode) HasOverlapLocked(start, end uint32) bool

func (*DeleteNode) Is1PC added in v0.6.0

func (node *DeleteNode) Is1PC() bool

func (*DeleteNode) IsDeletedLocked

func (node *DeleteNode) IsDeletedLocked(row uint32) bool

func (*DeleteNode) IsMerged

func (node *DeleteNode) IsMerged() bool

func (*DeleteNode) MakeCommand

func (node *DeleteNode) MakeCommand(id uint32) (cmd txnif.TxnCmd, err error)

func (*DeleteNode) MergeLocked

func (node *DeleteNode) MergeLocked(o *DeleteNode, collectIndex bool)

func (*DeleteNode) OnApply

func (node *DeleteNode) OnApply() (err error)

func (*DeleteNode) PrepareCommit

func (node *DeleteNode) PrepareCommit() (err error)

func (*DeleteNode) PrepareRollback

func (node *DeleteNode) PrepareRollback() (err error)

func (*DeleteNode) RangeDeleteLocked

func (node *DeleteNode) RangeDeleteLocked(start, end uint32)

func (*DeleteNode) ReadFrom

func (node *DeleteNode) ReadFrom(r io.Reader) (n int64, err error)

func (*DeleteNode) Set1PC added in v0.6.0

func (node *DeleteNode) Set1PC()

func (*DeleteNode) SetDeletes

func (node *DeleteNode) SetDeletes(mask *roaring.Bitmap)

func (*DeleteNode) SetLogIndex

func (node *DeleteNode) SetLogIndex(idx *wal.Index)

func (*DeleteNode) StringLocked

func (node *DeleteNode) StringLocked() string

func (*DeleteNode) Update added in v0.6.0

func (node *DeleteNode) Update(txnif.MVCCNode)

func (*DeleteNode) WriteTo

func (node *DeleteNode) WriteTo(w io.Writer) (n int64, err error)

type MVCCHandle

type MVCCHandle struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

func NewMVCCHandle

func NewMVCCHandle(meta *catalog.BlockEntry) *MVCCHandle

func (*MVCCHandle) AddAppendNodeLocked

func (n *MVCCHandle) AddAppendNodeLocked(
	txn txnif.AsyncTxn,
	startRow uint32,
	maxRow uint32) (an *AppendNode, created bool)

func (*MVCCHandle) AppendCommitted added in v0.6.0

func (n *MVCCHandle) AppendCommitted() bool

func (*MVCCHandle) CheckNotDeleted

func (n *MVCCHandle) CheckNotDeleted(start, end uint32, ts types.TS) error

func (*MVCCHandle) Close added in v0.7.0

func (n *MVCCHandle) Close()

func (*MVCCHandle) CollectAppendLocked added in v0.7.0

func (n *MVCCHandle) CollectAppendLocked(
	start, end types.TS) (
	minRow, maxRow uint32,
	commitTSVec, abortVec containers.Vector,
	abortedBitmap *roaring.Bitmap)

func (*MVCCHandle) CollectAppendLogIndexesLocked

func (n *MVCCHandle) CollectAppendLogIndexesLocked(startTs, endTs types.TS) (indexes []*wal.Index, err error)

func (*MVCCHandle) CollectDelete added in v0.6.0

func (n *MVCCHandle) CollectDelete(start, end types.TS) (rowIDVec, commitTSVec, abortVec containers.Vector, abortedBitmap *roaring.Bitmap)

func (*MVCCHandle) CollectUncommittedANodesPreparedBefore added in v0.6.0

func (n *MVCCHandle) CollectUncommittedANodesPreparedBefore(
	ts types.TS,
	fn func(*AppendNode)) (anyWaitable bool)
  1         2        3       4      5       6
[----] [---------] [----][------][-----] [-----]

-----------+------------------+---------------------->

start               end

func (*MVCCHandle) CreateDeleteNode

func (n *MVCCHandle) CreateDeleteNode(txn txnif.AsyncTxn, deleteType handle.DeleteType) txnif.DeleteNode

func (*MVCCHandle) DeleteAppendNodeLocked added in v0.6.0

func (n *MVCCHandle) DeleteAppendNodeLocked(node *AppendNode)

func (*MVCCHandle) ExistDeleteInRange added in v0.6.0

func (n *MVCCHandle) ExistDeleteInRange(start, end types.TS) (exist bool)

func (*MVCCHandle) GetAppendListener added in v0.6.0

func (n *MVCCHandle) GetAppendListener() func(txnif.AppendNode) error

func (*MVCCHandle) GetAppendNodeByRow added in v0.6.0

func (n *MVCCHandle) GetAppendNodeByRow(row uint32) (an *AppendNode)

func (*MVCCHandle) GetChangeNodeCnt

func (n *MVCCHandle) GetChangeNodeCnt() uint32

func (*MVCCHandle) GetDeleteChain

func (n *MVCCHandle) GetDeleteChain() *DeleteChain

func (*MVCCHandle) GetDeleteCnt

func (n *MVCCHandle) GetDeleteCnt() uint32

func (*MVCCHandle) GetDeleteNodeByRow added in v0.6.0

func (n *MVCCHandle) GetDeleteNodeByRow(row uint32) (an *DeleteNode)

func (*MVCCHandle) GetDeletesListener

func (n *MVCCHandle) GetDeletesListener() func(uint64, common.RowGen, types.TS) error

func (*MVCCHandle) GetEntry added in v0.6.0

func (n *MVCCHandle) GetEntry() *catalog.BlockEntry

func (*MVCCHandle) GetID

func (n *MVCCHandle) GetID() *common.ID

func (*MVCCHandle) GetTotalRow

func (n *MVCCHandle) GetTotalRow() uint32

GetTotalRow is only for replay

func (*MVCCHandle) GetVisibleRowLocked added in v0.6.0

func (n *MVCCHandle) GetVisibleRowLocked(ts types.TS) (maxrow uint32, visible bool, holes *roaring.Bitmap, err error)

func (*MVCCHandle) HasActiveAppendNode

func (n *MVCCHandle) HasActiveAppendNode() bool

func (*MVCCHandle) IncChangeNodeCnt

func (n *MVCCHandle) IncChangeNodeCnt()

func (*MVCCHandle) IsDeletedLocked

func (n *MVCCHandle) IsDeletedLocked(row uint32, ts types.TS, rwlocker *sync.RWMutex) (bool, error)

func (*MVCCHandle) IsVisibleLocked

func (n *MVCCHandle) IsVisibleLocked(row uint32, ts types.TS) (bool, error)

func (*MVCCHandle) OnReplayAppendNode

func (n *MVCCHandle) OnReplayAppendNode(an *AppendNode)

func (*MVCCHandle) OnReplayDeleteNode

func (n *MVCCHandle) OnReplayDeleteNode(deleteNode txnif.DeleteNode)

func (*MVCCHandle) SetAppendListener added in v0.6.0

func (n *MVCCHandle) SetAppendListener(l func(txnif.AppendNode) error)

func (*MVCCHandle) SetDeletesListener

func (n *MVCCHandle) SetDeletesListener(l func(uint64, common.RowGen, types.TS) error)

func (*MVCCHandle) StringLocked

func (n *MVCCHandle) StringLocked() string

type NodeType

type NodeType int8
const (
	NT_Normal NodeType = iota
	NT_Merge
)

type UpdateCmd

type UpdateCmd struct {
	*txnbase.BaseCustomizedCmd
	// contains filtered or unexported fields
}

func NewAppendCmd

func NewAppendCmd(id uint32, app *AppendNode) *UpdateCmd

func NewDeleteCmd

func NewDeleteCmd(id uint32, del *DeleteNode) *UpdateCmd

func NewEmptyCmd

func NewEmptyCmd(cmdType int16) *UpdateCmd

func (*UpdateCmd) ApplyCommit added in v0.6.0

func (c *UpdateCmd) ApplyCommit()

func (*UpdateCmd) ApplyRollback added in v0.6.0

func (c *UpdateCmd) ApplyRollback()

func (*UpdateCmd) Desc

func (c *UpdateCmd) Desc() string

func (*UpdateCmd) GetAppendNode

func (c *UpdateCmd) GetAppendNode() *AppendNode

func (*UpdateCmd) GetDBID

func (c *UpdateCmd) GetDBID() uint64

func (*UpdateCmd) GetDeleteNode

func (c *UpdateCmd) GetDeleteNode() *DeleteNode

func (*UpdateCmd) GetDest

func (c *UpdateCmd) GetDest() *common.ID

func (*UpdateCmd) GetType

func (c *UpdateCmd) GetType() int16

func (*UpdateCmd) Marshal

func (c *UpdateCmd) Marshal() (buf []byte, err error)

func (*UpdateCmd) ReadFrom

func (c *UpdateCmd) ReadFrom(r io.Reader) (n int64, err error)

func (*UpdateCmd) SetReplayTxn added in v0.6.0

func (c *UpdateCmd) SetReplayTxn(txn txnif.AsyncTxn)

func (*UpdateCmd) String

func (c *UpdateCmd) String() string

func (*UpdateCmd) Unmarshal

func (c *UpdateCmd) Unmarshal(buf []byte) error

func (*UpdateCmd) VerboseString

func (c *UpdateCmd) VerboseString() string

func (*UpdateCmd) WriteTo

func (c *UpdateCmd) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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