prealloctableid

package
v0.0.0-...-503c688 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator interface {
	GetGlobalID() (int64, error)
	AdvanceGlobalIDs(n int) (int64, error)
}

Allocator is the interface needed to allocate table IDs.

type PreallocIDs

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

PreallocIDs mantains the state of preallocated table IDs.

func New

func New(tables []*metautil.Table) *PreallocIDs

New collects the requirement of prealloc IDs and return a not-yet-allocated PreallocIDs.

func (*PreallocIDs) Alloc

func (p *PreallocIDs) Alloc(m Allocator) error

preallocTableIDs peralloc the id for [start, end)

func (*PreallocIDs) Prealloced

func (p *PreallocIDs) Prealloced(tid int64) bool

Prealloced checks whether a table ID has been successfully allocated.

func (*PreallocIDs) PreallocedFor

func (p *PreallocIDs) PreallocedFor(ti *model.TableInfo) bool

func (*PreallocIDs) String

func (p *PreallocIDs) String() string

String implements fmt.Stringer.

Jump to

Keyboard shortcuts

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