Documentation
¶
Index ¶
- Constants
- Variables
- func BM32Window(bm *roaring.Bitmap, start, end int) *roaring.Bitmap
- func BM64Window(bm *roaring64.Bitmap, start, end int) *roaring64.Bitmap
- func ContextField(format string, a ...any) zap.Field
- func CountField(val int) zap.Field
- func DoRetry(op RetryOp, ctx context.Context) (err error)
- func DurationField(val time.Duration) zap.Field
- func EntityField(val any) zap.Field
- func ErrorField(val error) zap.Field
- func ExceptionField(val any) zap.Field
- func FormatFiled(key string, format string, a ...any) zap.Field
- func GetGlobalSeqNum() uint64
- func IDArraryString(ids []ID) string
- func IDField(val int) zap.Field
- func LoopDLink(head *DLNode, fn func(node *DLNode) bool, reverse bool)
- func MakeFilename(dirname string, ft FileT, name string, isTmp bool) string
- func MakeLockFileName(dirname, name string) string
- func MockRWFile() *rwFile
- func NameSpaceField(val string) zap.Field
- func NextGlobalSeqNum() uint64
- func OperandField(val any) zap.Field
- func OperandNameSpace() zap.Field
- func OperationField(val string) zap.Field
- func ReadString(r io.Reader) (str string, n int64, err error)
- func ReasonField(val string) zap.Field
- func RepeatStr(str string, times int) string
- func ReprerField(key string, val Reprer) zap.Field
- func TimestampField(val any) zap.Field
- func ToH(size uint64) string
- func WriteString(str string, w io.Writer) (n int64, err error)
- type Closable
- type ClosedInterval
- func (i *ClosedInterval) Append(id uint64) error
- func (i *ClosedInterval) AtomicUpdateEnd(v uint64)
- func (i *ClosedInterval) Contains(o ClosedInterval) bool
- func (i *ClosedInterval) GT(o *ClosedInterval) bool
- func (i *ClosedInterval) IsCoveredByInt(idx uint64) bool
- func (i *ClosedInterval) LT(o *ClosedInterval) bool
- func (i *ClosedInterval) String() string
- func (i *ClosedInterval) TryMerge(o ClosedInterval) bool
- type ClosedIntervals
- func NewClosedIntervals() *ClosedIntervals
- func NewClosedIntervalsByInt(i uint64) *ClosedIntervals
- func NewClosedIntervalsByInterval(i *ClosedInterval) *ClosedIntervals
- func NewClosedIntervalsByIntervals(i *ClosedIntervals) *ClosedIntervals
- func NewClosedIntervalsBySlice(array []uint64) *ClosedIntervals
- func (intervals *ClosedIntervals) Contains(o ClosedIntervals) bool
- func (intervals *ClosedIntervals) ContainsInterval(oIntervals ClosedInterval) bool
- func (intervals *ClosedIntervals) Equal(o *ClosedIntervals) bool
- func (intervals *ClosedIntervals) GetCardinality() int
- func (intervals *ClosedIntervals) IsCoveredByInt(i uint64) bool
- func (intervals *ClosedIntervals) ReadFrom(r io.Reader) (n int64, err error)
- func (intervals *ClosedIntervals) TryMerge(o ClosedIntervals)
- func (intervals *ClosedIntervals) WriteTo(w io.Writer) (n int64, err error)
- type ClosedState
- type DLNode
- type FileInfo
- type FileT
- type FileType
- type ID
- func (id *ID) AsBlockID() ID
- func (id *ID) AsSegmentID() ID
- func (id *ID) BlockString() string
- func (id *ID) IsSameBlock(o ID) bool
- func (id *ID) IsSameSegment(o ID) bool
- func (id *ID) NextBlock() ID
- func (id *ID) NextSegment() ID
- func (id *ID) SegmentString() string
- func (id *ID) String() string
- func (id *ID) TableString() string
- type IRWFile
- type IRef
- type ISLLNode
- type ISSLLNode
- type IVFile
- type IdAllocator
- type IdAlloctor
- type Link
- type LinkIt
- type MemNode
- type Mempool
- type NodePayload
- type OnZeroCB
- type PPLevel
- type Range
- func (r *Range) Append(right uint64) error
- func (r *Range) CanCover(o *Range) bool
- func (r *Range) ClosedIn(id uint64) bool
- func (r *Range) CommitLeft(left uint64) bool
- func (r *Range) GT(id uint64) bool
- func (r *Range) LT(id uint64) bool
- func (r *Range) String() string
- func (r *Range) Union(o *Range) error
- func (r *Range) Valid() bool
- type RefHelper
- type Reprer
- type RetryOp
- type RowGen
- type SLLNode
- type SSLLNode
Constants ¶
const ( MAX_UINT8 = ^uint8(0) MAX_UINT16 = ^uint16(0) MAX_UINT32 = ^uint32(0) MAX_UINT64 = ^uint64(0) )
const ( TmpSuffix = ".tmp" LockSuffix = ".lock" )
const ( K uint64 = 1024 M uint64 = 1024 * 1024 G = K * M )
const (
UNLIMIT uint64 = ^uint64(0)
)
Variables ¶
var ( ErrIntervalNotContinous = errors.New("interval not continuous") ErrIntervalInvalid = errors.New("invalid interval") )
var ( ErrRangeNotContinous = errors.New("tae: range not continuous") ErrRangeInvalid = errors.New("tae: invalid range") )
var AnyField = zap.Any
var (
ErrClose = errors.New("closed")
)
var (
GlobalSeqNum uint64 = 0
)
var ( PageSizes = []uint64{ 64, 128, 256, 512, 1 * K, 4 * K, 8 * K, 16 * K, 32 * K, 64 * K, 128 * K, 256 * K, 512 * K, M, 2 * M, 4 * M, } )
Here we defined different page sizes, and each size has a certain pool managing all pages in that size.
var StringerField = zap.Stringer
Functions ¶
func CountField ¶
func EntityField ¶
func ErrorField ¶
func ExceptionField ¶
func GetGlobalSeqNum ¶
func GetGlobalSeqNum() uint64
func IDArraryString ¶
func MakeLockFileName ¶
func MockRWFile ¶
func MockRWFile() *rwFile
func NameSpaceField ¶
func NextGlobalSeqNum ¶
func NextGlobalSeqNum() uint64
func OperandField ¶
func OperandNameSpace ¶
func OperationField ¶
func ReasonField ¶
func TimestampField ¶
Types ¶
type ClosedInterval ¶
type ClosedInterval struct {
Start, End uint64
}
func (*ClosedInterval) Append ¶
func (i *ClosedInterval) Append(id uint64) error
func (*ClosedInterval) AtomicUpdateEnd ¶
func (i *ClosedInterval) AtomicUpdateEnd(v uint64)
func (*ClosedInterval) Contains ¶
func (i *ClosedInterval) Contains(o ClosedInterval) bool
func (*ClosedInterval) GT ¶
func (i *ClosedInterval) GT(o *ClosedInterval) bool
func (*ClosedInterval) IsCoveredByInt ¶
func (i *ClosedInterval) IsCoveredByInt(idx uint64) bool
func (*ClosedInterval) LT ¶
func (i *ClosedInterval) LT(o *ClosedInterval) bool
func (*ClosedInterval) String ¶
func (i *ClosedInterval) String() string
func (*ClosedInterval) TryMerge ¶
func (i *ClosedInterval) TryMerge(o ClosedInterval) bool
type ClosedIntervals ¶
type ClosedIntervals struct {
Intervals []*ClosedInterval
}
func NewClosedIntervals ¶
func NewClosedIntervals() *ClosedIntervals
func NewClosedIntervalsByInt ¶
func NewClosedIntervalsByInt(i uint64) *ClosedIntervals
func NewClosedIntervalsByInterval ¶
func NewClosedIntervalsByInterval(i *ClosedInterval) *ClosedIntervals
func NewClosedIntervalsByIntervals ¶
func NewClosedIntervalsByIntervals(i *ClosedIntervals) *ClosedIntervals
func NewClosedIntervalsBySlice ¶
func NewClosedIntervalsBySlice(array []uint64) *ClosedIntervals
func (*ClosedIntervals) Contains ¶
func (intervals *ClosedIntervals) Contains(o ClosedIntervals) bool
func (*ClosedIntervals) ContainsInterval ¶
func (intervals *ClosedIntervals) ContainsInterval(oIntervals ClosedInterval) bool
func (*ClosedIntervals) Equal ¶
func (intervals *ClosedIntervals) Equal(o *ClosedIntervals) bool
Equal is for test
func (*ClosedIntervals) GetCardinality ¶
func (intervals *ClosedIntervals) GetCardinality() int
func (*ClosedIntervals) IsCoveredByInt ¶
func (intervals *ClosedIntervals) IsCoveredByInt(i uint64) bool
func (*ClosedIntervals) ReadFrom ¶
func (intervals *ClosedIntervals) ReadFrom(r io.Reader) (n int64, err error)
func (*ClosedIntervals) TryMerge ¶
func (intervals *ClosedIntervals) TryMerge(o ClosedIntervals)
type ClosedState ¶
type ClosedState struct {
// contains filtered or unexported fields
}
func (*ClosedState) IsClosed ¶
func (c *ClosedState) IsClosed() bool
func (*ClosedState) TryClose ¶
func (c *ClosedState) TryClose() bool
type DLNode ¶
type DLNode struct {
// contains filtered or unexported fields
}
func InsertDLNode ¶
func InsertDLNode(payload NodePayload, head *DLNode) (node, nhead, ntail *DLNode)
func (*DLNode) GetPayload ¶
func (l *DLNode) GetPayload() NodePayload
type ID ¶
type ID struct {
// Internal table id
TableID uint64
// Internal segment id
SegmentID uint64
// Internal block id
BlockID uint64
// Internal column part id
PartID uint32
// Column index for the column part above
Idx uint16
// Iter is used for MVCC
Iter uint8
}
ID is the general identifier type shared by different types like table, segment, block, etc.
We could wrap info from upper level via ID, for instance, get the table id, segment id, and the block id for one block by ID.AsBlockID, which made the resource management easier.
func (*ID) AsSegmentID ¶
func (*ID) BlockString ¶
func (*ID) IsSameBlock ¶
func (*ID) IsSameSegment ¶
func (*ID) NextSegment ¶
func (*ID) SegmentString ¶
func (*ID) TableString ¶
type IRef ¶
type IRef interface {
RefCount() int64
Ref()
Unref()
}
IRef is the general representation of the resources that should be managed with a reference count. Once the reference count reached 0, the OnZeroCB would be called.
type IVFile ¶
type IVFile interface {
io.Reader
Ref()
Unref()
RefCount() int64
Stat() FileInfo
GetFileType() FileType
}
IVFile is the general in-memory representation of resources like segment, block, index, column part, etc. that managed by buffer manager.
func MockCompressedFile ¶
func NewMemFile ¶
type IdAllocator ¶
type IdAllocator struct {
// contains filtered or unexported fields
}
func (*IdAllocator) Alloc ¶
func (id *IdAllocator) Alloc() uint64
func (*IdAllocator) Get ¶
func (id *IdAllocator) Get() uint64
func (*IdAllocator) Set ¶
func (id *IdAllocator) Set(val uint64)
type IdAlloctor ¶
type IdAlloctor struct {
// contains filtered or unexported fields
}
func NewIdAlloctor ¶
func NewIdAlloctor(from uint64) *IdAlloctor
func (*IdAlloctor) Alloc ¶
func (alloc *IdAlloctor) Alloc() uint64
func (*IdAlloctor) Get ¶
func (alloc *IdAlloctor) Get() uint64
func (*IdAlloctor) SetStart ¶
func (alloc *IdAlloctor) SetStart(start uint64)
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) Insert ¶
func (l *Link) Insert(payload NodePayload) *DLNode
type Mempool ¶
type Mempool struct {
// contains filtered or unexported fields
}
Mempool wraps an easy-to-use memory pool for the AOE storage.
It manages memory through different granularity.
var ( // GPool is the global mem pool used by AOE storage. // It's initialized automatically during init phase. GPool *Mempool )
func NewMempool ¶
func (*Mempool) ApplyQuota ¶
type NodePayload ¶
type NodePayload interface {
Compare(NodePayload) int
}
type Range ¶
func (*Range) CommitLeft ¶
type SLLNode ¶
SLLNode represent a single node in linked list. It is thread-safe.
func NewSLLNode ¶
func (*SLLNode) GetNextNode ¶
func (*SLLNode) ReleaseNextNode ¶
func (l *SLLNode) ReleaseNextNode()
func (*SLLNode) SetNextNode ¶
func (*SLLNode) SetNextNodeNoLock ¶
type SSLLNode ¶
type SSLLNode struct {
// contains filtered or unexported fields
}
func NewSSLLNode ¶
func NewSSLLNode() *SSLLNode