common

package
v0.0.0-...-4430401 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 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 | NOT_ABORABLE_TXN_FEATURE //| COMMIT_ABORT_HANDLE_INFO | NOT_ABORABLE_TXN_FEATURE | DEBUGGING | RDB_OP_FUNC_CALL // | DEBUG_INFO  //| BUFFER_INTERNAL_STATE //| DEBUGGING | DEBUG_INFO //| PIN_COUNT_ASSERT //DEBUG_INFO_DETAIL  //DEBUGGING
	KernelThreadNum      = 24
	MaxTxnThreadNum      = KernelThreadNum * 1
)
View Source
const (
	DEBUG_INFO_DETAIL        LogLevel = 1
	DEBUG_INFO                        = 2
	CACHE_OUT_IN_INFO                 = 2 << 1
	RDB_OP_FUNC_CALL                  = 2 << 2 // print several info at core functions (ex: CRUD at TableHeap and SkipList/SkipListBlockPage)
	BUFFER_INTERNAL_STATE             = 2 << 3 // print internal state of buffer of BufferPoolManager
	PIN_COUNT_ASSERT                  = 2 << 4
	COMMIT_ABORT_HANDLE_INFO          = 2 << 5
	NOT_ABORABLE_TXN_FEATURE          = 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 SH_Assert

func SH_Assert(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 SH_Mutex

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

func NewSH_Mutex

func NewSH_Mutex() *SH_Mutex

func (*SH_Mutex) Lock

func (m *SH_Mutex) Lock()

func (*SH_Mutex) Unlock

func (m *SH_Mutex) 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