store

package
v1.2.3-hotfix-20241101 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	ErrGroupNotFount = moerr.NewInternalErrorNoCtx("group not found")
	ErrLsnNotFount   = moerr.NewInternalErrorNoCtx("lsn not found")
	ErrTimeOut       = moerr.NewInternalErrorNoCtx("retry timeout")
	ErrLsnTooSmall   = moerr.NewInternalErrorNoCtx("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 Store

type Store interface {
	Append(gid uint32, entry entry.Entry) (lsn uint64, 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
	sm.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) Close added in v0.6.0

func (w *StoreImpl) Close() 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