Documentation
¶
Index ¶
- Constants
- Variables
- func CompareInterface(a, b interface{}) int64
- func FilenameFromTmpfile(tmpFile string) (fname string, err error)
- func GetGlobalSeqNum() uint64
- func IsBlockFile(name string) bool
- func IsSegmentFile(name string) bool
- func IsTBlockFile(name string) bool
- func IsTempFile(name string) bool
- func MakeBitSlicedIndexFileName(version, tid, sid uint64, col uint16) string
- func MakeBlockBitSlicedIndexFileName(version, tid, sid, bid uint64, col uint16) string
- func MakeBlockFileName(dirname, name string, tableID uint64, isTmp bool) string
- func MakeDataDir(dirname string) string
- func MakeFilename(dirname string, ft FileT, name string, isTmp bool) string
- func MakeLockFileName(dirname, name string) string
- func MakeMetaDir(dirname string) string
- func MakeSegmentFileName(dirname, name string, tableID uint64, isTmp bool) string
- func MakeSpillDir(dirname string) string
- func MakeTBlockFileName(dirname, name string, isTmp bool) string
- func MakeTempDir(dirname string) string
- func NextGlobalSeqNum() uint64
- func ParseBitSlicedIndexFileName(filename string) (name string, ok bool)
- func ParseBitSlicedIndexFileNameToInfo(filename string) (version, tblID, segID uint64, colIdx uint16, ok bool)
- func ParseBlockBitSlicedIndexFileName(filename string) (name string, ok bool)
- func ParseBlockBitSlicedIndexFileNameToInfo(filename string) (version, tblID, segID, blkID uint64, colIdx uint16, ok bool)
- func ParseBlockfileName(filename string) (name string, ok bool)
- func ParseSegmentFileName(filename string) (name string, ok bool)
- func ParseTBlockfileName(filename string) (name string, ok bool)
- func ToH(size uint64) string
- type BaseMvcc
- type FileInfo
- type FileT
- type FileType
- type GetObjectFunc
- 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) IsTransient() bool
- func (id *ID) Next() *ID
- func (id *ID) NextBlock() ID
- func (id *ID) NextIter() ID
- func (id *ID) NextPart() ID
- func (id *ID) NextSegment() ID
- func (id *ID) SegmentString() string
- func (id *ID) String() string
- func (id *ID) TableString() string
- func (id *ID) ToBlockFileName() string
- func (id *ID) ToBlockFilePath() string
- func (id *ID) ToPartFileName() string
- func (id *ID) ToPartFilePath() string
- func (id *ID) ToSegmentFileName() string
- func (id *ID) ToSegmentFilePath() string
- func (id *ID) ToTBlockFileName(name string) string
- type IDAlloctor
- type IRef
- type ISLLNode
- type ISSLLNode
- type IVFile
- type MVCC
- type MemNode
- type Mempool
- type OnZeroCB
- type PinFunc
- 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 SLLNode
- type SSLLNode
- type UnpinFunc
Constants ¶
const ( MaxUint8 = ^uint8(0) MaxUint16 = ^uint16(0) MaxUint32 = ^uint32(0) MaxUint64 = ^uint64(0) )
const ( TmpSuffix = ".tmp" TBlkSuffix = ".tblk" BlkSuffix = ".blk" SegSuffix = ".seg" LockSuffix = ".lock" NodeSuffix = ".nod" BSISuffix = ".bsi" BBSISuffix = ".bbsi" SpillDirName = "spill" TempDirName = "temp" DataDirName = "data" MetaDirName = "meta" )
const ( K uint64 = 1024 M uint64 = 1024 * 1024 G = K * M )
const (
TRANSIENT_TABLE_START_ID uint64 = ^(uint64(0)) / 2
)
const (
UNLIMIT uint64 = ^uint64(0)
)
Variables ¶
var ( ErrParseBlockFileName = errors.New("aoe: parse block file name") ErrParseTBlockFileName = errors.New("aoe: parse tblock file name") ErrParseSegmentFileName = errors.New("aoe: parse segment file name") )
var ( ErrRangeNotContinous = errors.New("aoe: range not continuous") ErrRangeInvalid = errors.New("aoe: invalid range") )
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, } )
Here we defined different page sizes, and each size has a certain pool managing all pages in that size.
Functions ¶
func CompareInterface ¶
func CompareInterface(a, b interface{}) int64
func FilenameFromTmpfile ¶
func GetGlobalSeqNum ¶
func GetGlobalSeqNum() uint64
func IsBlockFile ¶
func IsSegmentFile ¶
func IsTBlockFile ¶
func IsTempFile ¶
func MakeBlockFileName ¶
func MakeDataDir ¶
func MakeLockFileName ¶
func MakeMetaDir ¶
func MakeSegmentFileName ¶
func MakeSpillDir ¶
func MakeTBlockFileName ¶
func MakeTempDir ¶
func NextGlobalSeqNum ¶
func NextGlobalSeqNum() uint64
func ParseBlockfileName ¶
func ParseSegmentFileName ¶
func ParseTBlockfileName ¶
Types ¶
type BaseMvcc ¶
type BaseMvcc struct { PrevVer *interface{} NextVer *interface{} Pin PinFunc Unpin UnpinFunc GetObject GetObjectFunc }
func (*BaseMvcc) GetNextVersion ¶
func (mvcc *BaseMvcc) GetNextVersion() interface{}
func (*BaseMvcc) GetPrevVersion ¶
func (mvcc *BaseMvcc) GetPrevVersion() interface{}
func (*BaseMvcc) OnVersionStale ¶
func (mvcc *BaseMvcc) OnVersionStale()
func (*BaseMvcc) SetNextVersion ¶
func (mvcc *BaseMvcc) SetNextVersion(next interface{})
func (*BaseMvcc) SetPrevVersion ¶
func (mvcc *BaseMvcc) SetPrevVersion(prev interface{})
type GetObjectFunc ¶
type GetObjectFunc func() interface{}
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 NewTransientID ¶
func NewTransientID() *ID
func ParseBlkNameToID ¶
func ParseSegmentNameToID ¶
func (*ID) AsSegmentID ¶
func (*ID) BlockString ¶
func (*ID) IsSameBlock ¶
func (*ID) IsSameSegment ¶
func (*ID) IsTransient ¶
func (*ID) NextSegment ¶
func (*ID) SegmentString ¶
func (*ID) TableString ¶
func (*ID) ToBlockFileName ¶
func (*ID) ToBlockFilePath ¶
func (*ID) ToPartFileName ¶
func (*ID) ToPartFilePath ¶
func (*ID) ToSegmentFileName ¶
func (*ID) ToSegmentFilePath ¶
func (*ID) ToTBlockFileName ¶
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 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 MVCC ¶
type MVCC interface { GetPrevVersion() interface{} SetPrevVersion(interface{}) GetNextVersion() interface{} SetNextVersion(interface{}) Object() interface{} }
MVCC offers some basic methods related to MVCC. Every type expected to have multiple physical versions should implement this.
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 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