logservicedriver

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReplayReadSize = mpool.MB * 64
	MaxReadSize    = mpool.MB * 64
)
View Source
const (
	IOET_WALRecord_V1 uint16 = 1
	IOET_WALRecord    uint16 = 1000

	IOET_WALRecord_CurrVer = IOET_WALRecord_V1
)

Variables

View Source
var DefaultReadMaxSize = uint64(10)
View Source
var ErrAllRecordsRead = moerr.NewInternalErrorNoCtx("driver read cache: all records are read")
View Source
var ErrClientPoolClosed = moerr.NewInternalErrorNoCtx("client pool closed")
View Source
var ErrDriverLsnNotFound = moerr.NewInternalErrorNoCtx("driver info: driver lsn not found")
View Source
var ErrNoClientAvailable = moerr.NewInternalErrorNoCtx("no client available")
View Source
var ErrRecordNotFound = moerr.NewInternalErrorNoCtx("driver read cache: lsn not found")
View Source
var ErrRetryTimeOut = moerr.NewInternalErrorNoCtx("driver info: retry time out")
View Source
var ErrTooMuchPenddings = moerr.NewInternalErrorNoCtx("too much penddings")

Functions

func RetryWithTimeout

func RetryWithTimeout(timeoutDuration time.Duration, fn func() (shouldReturn bool)) error

Types

type Config

type Config struct {
	ClientPoolMaxSize     int
	ClientPoolInitSize    int
	GetClientRetryTimeOut time.Duration

	RecordSize           int
	ReadCacheSize        int
	AppenderMaxCount     int
	ReadMaxSize          uint64
	NewRecordSize        int
	NewClientDuration    time.Duration
	ClientAppendDuration time.Duration
	TruncateDuration     time.Duration
	// AppendFrequency      time.Duration
	RetryTimeout        time.Duration
	GetTruncateDuration time.Duration
	ReadDuration        time.Duration

	ClientFactory LogServiceClientFactory
}

func NewDefaultConfig

func NewDefaultConfig(clientFactory LogServiceClientFactory) *Config

func NewTestConfig

func NewTestConfig(ccfg *logservice.ClientConfig) *Config

type LogServiceClientFactory

type LogServiceClientFactory logservice.ClientFactory

type LogServiceDriver

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

func NewLogServiceDriver

func NewLogServiceDriver(cfg *Config) *LogServiceDriver

func (*LogServiceDriver) Append

func (d *LogServiceDriver) Append(e *entry.Entry) error

func (*LogServiceDriver) Close

func (d *LogServiceDriver) Close() error

func (*LogServiceDriver) GetCurrSeqNum added in v0.7.0

func (d *LogServiceDriver) GetCurrSeqNum() uint64

func (*LogServiceDriver) GetTruncated

func (d *LogServiceDriver) GetTruncated() (lsn uint64, err error)

func (LogServiceDriver) IsReplaying

func (info LogServiceDriver) IsReplaying() bool

func (LogServiceDriver) PostReplay

func (info LogServiceDriver) PostReplay()

func (LogServiceDriver) PreReplay

func (info LogServiceDriver) PreReplay()

func (*LogServiceDriver) Read

func (d *LogServiceDriver) Read(drlsn uint64) (*entry.Entry, error)

func (*LogServiceDriver) Replay

func (*LogServiceDriver) Truncate

func (d *LogServiceDriver) Truncate(lsn uint64) error

driver lsn -> entry lsn

type MetaType

type MetaType uint8
const (
	TInvalid MetaType = iota
	TNormal
	TReplay
)

type ReplayCmd

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

func NewEmptyReplayCmd

func NewEmptyReplayCmd() *ReplayCmd

func NewReplayCmd

func NewReplayCmd(skipLsns map[uint64]uint64) *ReplayCmd

func (*ReplayCmd) Marshal

func (c *ReplayCmd) Marshal() (buf []byte, err error)

func (*ReplayCmd) ReadFrom

func (c *ReplayCmd) ReadFrom(r io.Reader) (n int64, err error)

func (*ReplayCmd) Unmarshal

func (c *ReplayCmd) Unmarshal(buf []byte) error

func (*ReplayCmd) WriteTo

func (c *ReplayCmd) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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