Documentation
¶
Index ¶
- Constants
- Variables
- func IsCheckpointed(gid uint32, lsn uint64, ckps map[uint32]*checkpointInfo) bool
- func MakeVersionFile(dir, name string, version uint64) string
- func NewBaseStore(dir, name string, cfg *StoreCfg) (*baseStore, error)
- func OpenRotateFile(dir, name string, mu *sync.RWMutex, rotateChecker RotateChecker, ...) (*rotateFile, error)
- func ParseVersion(name, prefix, suffix string) (int, error)
- type ApplyHandle
- type File
- type FileAppender
- type FileReader
- type History
- type HistoryFactory
- type MaxSizeRotateChecker
- type ReplayHandle
- type ReplayObserver
- type RotateChecker
- type Store
- type StoreCfg
- type VFile
- type VFileAddress
- type VFileUncommitInfo
- type VGroup
Constants ¶
View Source
const (
DefaultRotateCheckerMaxSize = int(common.M) * 64
)
Variables ¶
View Source
var ( DefaultMaxBatchSize = 500 DefaultMaxSyncSize = 10 DefaultMaxCommitSize = 10 DefaultBatchPerSync = 100 DefaultSyncDuration = time.Millisecond * 2 FlushEntry entry.Entry )
View Source
var ( ErrGroupNotExist = errors.New("group not existed") ErrLsnNotExist = errors.New("lsn not existed") ErrVFileVersionTimeOut = errors.New("get vfile version timeout") )
View Source
var ( ErrVFileGroupNotExist = errors.New("vfile: group not existed") ErrVFileLsnNotExist = errors.New("vfile: lsn not existed") ErrVFileOffsetTimeOut = errors.New("get vfile offset timeout") ErrReadMetaFailed = errors.New("read meta failed") )
View Source
var ( DefaultHistoryFactory = func() History { return newHistory(nil) } )
View Source
var (
HistoryEntryNotFoundErr = errors.New("tae: history not found")
)
View Source
var Metasize = 2
Functions ¶
func IsCheckpointed ¶
func MakeVersionFile ¶
func NewBaseStore ¶
func OpenRotateFile ¶
func OpenRotateFile(dir, name string, mu *sync.RWMutex, rotateChecker RotateChecker, historyFactory HistoryFactory, bsInfo *storeInfo, postCommitFunc func(VFile)) (*rotateFile, error)
func ParseVersion ¶
Types ¶
type ApplyHandle ¶
type File ¶
type File interface {
io.Closer
sync.Locker
RLock()
RUnlock()
FileReader
GetEntryByVersion(version int) (VFile, error)
Sync() error
GetAppender() FileAppender
Replay(*replayer, ReplayObserver) error
GetHistory() History
TryTruncate(int64) error
Load(ver int, groupId uint32, lsn uint64) (entry.Entry, error)
}
type FileAppender ¶
type FileReader ¶
type FileReader any
type HistoryFactory ¶
type HistoryFactory func() History
type MaxSizeRotateChecker ¶
type MaxSizeRotateChecker struct {
MaxSize int
}
func NewMaxSizeRotateChecker ¶
func NewMaxSizeRotateChecker(size int) *MaxSizeRotateChecker
func (*MaxSizeRotateChecker) PrepareAppend ¶
func (c *MaxSizeRotateChecker) PrepareAppend(vfile VFile, delta int) (needRot bool, err error)
type ReplayHandle ¶
type ReplayHandle = func(VFile, ReplayObserver) error
type ReplayObserver ¶
type Store ¶
type Store interface {
io.Closer
Sync() error
Replay(ApplyHandle) error
GetCheckpointed(uint32) uint64
GetSynced(uint32) uint64
GetPenddingCnt(uint32) uint64
GetCurrSeqNum(uint32) uint64
AppendEntry(groupId uint32, e entry.Entry) (uint64, error)
TryCompact() error
TryTruncate(int64) error
Load(groupId uint32, lsn uint64) (entry.Entry, error)
}
type StoreCfg ¶
type StoreCfg struct {
RotateChecker RotateChecker
HistoryFactory HistoryFactory
}
type VFile ¶
type VFile interface {
sync.Locker
RLock()
RUnlock()
SizeLocked() int
Destroy() error
Id() int
Name() string
String() string
IsToDelete(c *compactor) (toDelete bool)
PrepareCompactor(c *compactor)
// InCheckpoint(map[uint32]*common.ClosedIntervals) bool
// InCommits(map[uint32]*common.ClosedIntervals) bool
// InTxnCommits(map[uint32]map[uint64]uint64, map[uint32]*common.ClosedIntervals) bool
// MergeCheckpoint(map[uint32]*common.ClosedIntervals)
// MergeTidCidMap(map[uint32]map[uint64]uint64)
Replay(*replayer, ReplayObserver) error
ReplayCWithCkp(*replayer, ReplayObserver) error
ReplayUCWithCkp(*replayer, ReplayObserver) error
GetAddrs() (map[uint32]map[uint64]int, *sync.RWMutex)
OnReplayCommitted()
GetUncommitGidTid(lsn uint64) *entry.Tid
Load(groupId uint32, lsn uint64) (entry.Entry, error)
LoadByOffset(offset int) (entry.Entry, error)
LoadMeta() error
FreeMeta()
OnReplay(r *replayer)
}
type VFileUncommitInfo ¶
type VFileUncommitInfo struct {
Index *roaring64.Bitmap
Addr *VFileAddress
}
Click to show internal directories.
Click to hide internal directories.