package storage
import (
"math"
"unsafe"
"github.com/daviszhen/plan/pkg/util"
)
const (
SECTOR_SIZE uint64 = 4096
BLOCK_HEADER_SIZE uint64 = uint64(unsafe.Sizeof(uint64(0)))
BLOCK_ALLOC_SIZE uint64 = 1 << 18
BLOCK_SIZE uint64 = BLOCK_ALLOC_SIZE - BLOCK_HEADER_SIZE
MAX_BLOCK BlockID = 4611686018427388000
UNDO_ENTRY_HEADER_SIZE = 8
MAX_ROW_ID RowType = 4611686018427388000
COLUMN_IDENTIFIER_ROW_ID IdxType = math.MaxUint64
TRANSACTION_ID_START uint64 = 4611686018427388000
FILE_HEADER_SIZE uint64 = 4096
BLOCK_START = FILE_HEADER_SIZE * 3
BlockIDSize = uint64(8)
MAXIMUM_QUERY_ID uint64 = math.MaxUint64
)
type BlockID int64
func AllocSize(sz uint64) uint64 {
return util.AlignValue(sz+BLOCK_HEADER_SIZE, SECTOR_SIZE)
}
type TxnType uint64
type RowType int64
type IdxType uint64