store

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GroupCKP      = entry.GTCKp
	GroupInternal = entry.GTInternal
)

Variables

View Source
var (
	ErrGroupNotFount = moerr.NewInternalError("group not found")
	ErrLsnNotFount   = moerr.NewInternalError("lsn not found")
	ErrTimeOut       = moerr.NewInternalError("retry timeout")
	ErrLsnTooSmall   = moerr.NewInternalError("lsn is too small")
)
View Source
var DefaultMaxBatchSize = 10000

Functions

This section is empty.

Types

type ApplyHandle

type ApplyHandle = func(group uint32, commitId uint64, payload []byte, typ uint16, info any)

type Index added in v0.6.0

type Index struct {
	LSN  uint64
	CSN  uint32
	Size uint32
}

func NewIndex added in v0.6.0

func NewIndex(lsn uint64, csn, size uint32) *Index

func (*Index) Clone added in v0.6.0

func (index *Index) Clone() *Index

func (*Index) Compare added in v0.6.0

func (index *Index) Compare(o *Index) int

func (*Index) ReadFrom added in v0.6.0

func (index *Index) ReadFrom(r io.Reader) (n int64, err error)

func (*Index) String added in v0.6.0

func (index *Index) String() string

func (*Index) WriteTo added in v0.6.0

func (index *Index) WriteTo(w io.Writer) (n int64, err error)

type Store

type Store interface {
	Append(gid uint32, entry entry.Entry) (lsn uint64, err error)
	FuzzyCheckpoint(gid uint32, idxes []*Index) (ckpEntry entry.Entry, err error)
	RangeCheckpoint(gid uint32, start, end uint64) (ckpEntry entry.Entry, err error)
	Load(gid uint32, lsn uint64) (entry.Entry, error)

	GetCurrSeqNum(gid uint32) (lsn uint64)
	GetSynced(gid uint32) (lsn uint64)
	GetPendding(gid uint32) (cnt uint64)
	GetCheckpointed(gid uint32) (lsn uint64)

	Replay(h ApplyHandle) error
	Close() error
}

func NewStoreWithBatchStoreDriver added in v0.6.0

func NewStoreWithBatchStoreDriver(dir, name string, cfg *batchstoredriver.StoreCfg) Store

func NewStoreWithLogserviceDriver added in v0.6.0

func NewStoreWithLogserviceDriver(factory logservicedriver.LogServiceClientFactory) Store

type StoreImpl added in v0.6.0

type StoreImpl struct {
	*StoreInfo
	common.ClosedState
	// contains filtered or unexported fields
}

func NewStore added in v0.6.0

func NewStore(driver driver.Driver) *StoreImpl

func (*StoreImpl) Append added in v0.6.0

func (w *StoreImpl) Append(gid uint32, e entry.Entry) (lsn uint64, err error)

func (*StoreImpl) CkpCkp added in v0.6.0

func (w *StoreImpl) CkpCkp()

func (*StoreImpl) Close added in v0.6.0

func (w *StoreImpl) Close() error

func (*StoreImpl) FuzzyCheckpoint added in v0.6.0

func (w *StoreImpl) FuzzyCheckpoint(gid uint32, indexes []*Index) (ckpEntry entry.Entry, err error)

func (*StoreImpl) Load added in v0.6.0

func (w *StoreImpl) Load(gid uint32, lsn uint64) (entry.Entry, error)

func (*StoreImpl) RangeCheckpoint added in v0.6.0

func (w *StoreImpl) RangeCheckpoint(gid uint32, start, end uint64) (ckpEntry entry.Entry, err error)

func (*StoreImpl) Replay added in v0.6.0

func (w *StoreImpl) Replay(h ApplyHandle) error

func (*StoreImpl) Start added in v0.6.0

func (w *StoreImpl) Start()

type StoreInfo added in v0.6.0

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

func (*StoreInfo) GetCheckpointed added in v0.6.0

func (w *StoreInfo) GetCheckpointed(gid uint32) (lsn uint64)

func (*StoreInfo) GetCurrSeqNum added in v0.6.0

func (w *StoreInfo) GetCurrSeqNum(gid uint32) (lsn uint64)

func (*StoreInfo) GetPendding added in v0.6.0

func (w *StoreInfo) GetPendding(gid uint32) (cnt uint64)

func (*StoreInfo) GetSynced added in v0.6.0

func (w *StoreInfo) GetSynced(gid uint32) (lsn uint64)

func (*StoreInfo) SetCheckpointed added in v0.6.0

func (w *StoreInfo) SetCheckpointed(gid uint32, lsn uint64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL