common

package
v0.0.0-...-a1d2aad Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// invalid page id
	InvalidPageID = -1
	// invalid transaction id
	InvalidTxnID = -1
	// invalid log sequence number
	InvalidLSN = -1
	// the header page id
	HeaderPageID = 0
	// size of a data page in byte
	PageSize                     = 4096 //4096 //1024  //512
	BufferPoolMaxFrameNumForTest = 32
	// number for calculate log buffer size (number of page size)
	LogBufferSizeBase = 128
	// size of a log buffer in byte
	LogBufferSize = (LogBufferSizeBase + 1) * PageSize
	// size of hash bucket
	BucketSizeOfHashIndex = 10
	// probability used for determin node level on SkipList
	SkipListProb         = 0.5                          //0.25
	ActiveLogKindSetting = INFO | NotAborableTxnFeature //| CommitAbortHandleInfo | NotAborableTxnFeature | DEBUGGING | RDBOpFuncCall // | DebugInfo  //| BufferInternalState //| DEBUGGING | DebugInfo //| PinCountAssert //DebugInfoDetail  //DEBUGGING
	KernelThreadNum      = 24
	MaxTxnThreadNum      = KernelThreadNum * 1
)
View Source
const (
	DebugInfoDetail       LogLevel = 1
	DebugInfo                      = 2
	CacheOutInInfo                 = 2 << 1
	RDBOpFuncCall                  = 2 << 2 // print several info at core functions (ex: CRUD at TableHeap and SkipList/SkipListBlockPage)
	BufferInternalState            = 2 << 3 // print internal state of buffer of BufferPoolManager
	PinCountAssert                 = 2 << 4
	CommitAbortHandleInfo          = 2 << 5
	NotAborableTxnFeature          = 2 << 6
	DEBUGGING                      = 2 << 7 // print debug info for a debugging period (not permanently used)
	INFO                           = 2 << 8
	WARN                           = 2 << 9
	ERROR                          = 2 << 10
	FATAL                          = 2 << 11
)
View Source
const EnableDebug bool = false //true
View Source
const EnableOnMemStorage = true

use on memory virtual storage or not

View Source
const (
	MaxReaders = math.MaxUint32
)

Variables

View Source
var LogTimeout time.Duration
View Source
var NewRIDAtNormal = false

TODO: for debugging

View Source
var NewRIDAtRollback = false
View Source
var TempSuppressOnMemStorage = false

when this is true, virtual storage use is suppressed for test case which can't work with virtual storage

View Source
var TempSuppressOnMemStorageMutex sync.Mutex

Functions

func SHAssert

func SHAssert(condition bool, msg string)

func ShPrintf

func ShPrintf(logLevel LogLevel, fmtStl string, a ...interface{})

Types

type LogLevel

type LogLevel int32

type ReaderWriterLatch

type ReaderWriterLatch interface {
	WLock()
	WUnlock()
	RLock()
	RUnlock()
	PrintDebugInfo()
}

func NewRWLatch

func NewRWLatch() ReaderWriterLatch

func NewRWLatchDebug

func NewRWLatchDebug() ReaderWriterLatch

func NewRWLatchDummy

func NewRWLatchDummy() ReaderWriterLatch

type SHMutex

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

func NewSHMutex

func NewSHMutex() *SHMutex

func (*SHMutex) Lock

func (m *SHMutex) Lock()

func (*SHMutex) Unlock

func (m *SHMutex) Unlock()

type SlotOffset

type SlotOffset uintptr // slot offset type

type TxnID

type TxnID int32 // transaction id type

Jump to

Keyboard shortcuts

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