block

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Appender

type Appender interface {
	block.Appender

	Stop(ctx context.Context)
	Delete(ctx context.Context)
	Bootstrap(ctx context.Context, blocks []Peer) error
	Status() ClusterStatus
}

type ClusterStatus

type ClusterStatus struct {
	Leader vanus.ID
	Term   uint64
}

type Engine

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

func (*Engine) Close

func (e *Engine) Close(ctx context.Context)

func (*Engine) Init

func (e *Engine) Init(dir string, localAddr string, opts ...Option) *Engine

func (*Engine) NewAppender

func (e *Engine) NewAppender(ctx context.Context, raw block.Raw) (Appender, error)

func (*Engine) Recover

func (e *Engine) Recover(ctx context.Context, raws map[vanus.ID]block.Raw) (map[vanus.ID]Appender, error)

func (*Engine) RegisterNodeRecord

func (e *Engine) RegisterNodeRecord(id uint64, val string) error

func (*Engine) RegisterServer

func (e *Engine) RegisterServer(srv *grpc.Server)

func (*Engine) Start

func (e *Engine) Start()

type EntryAppendedListener

type EntryAppendedListener = func(block vanus.ID)

type LeaderChangedListener

type LeaderChangedListener = func(block, leader vanus.ID, term uint64)

type Option

type Option func(*config)

func WithAppendExecutorParallel

func WithAppendExecutorParallel(parallel int) Option

func WithApplyExecutorParallel

func WithApplyExecutorParallel(parallel int) Option

func WithCommitExecutorParallel

func WithCommitExecutorParallel(parallel int) Option

func WithEntryAppendedListener

func WithEntryAppendedListener(lis EntryAppendedListener) Option

func WithHintStore

func WithHintStore(hintStore *meta.AsyncStore) Option

func WithLeaderChangedListener

func WithLeaderChangedListener(lis LeaderChangedListener) Option

func WithPersistExecutorParallel

func WithPersistExecutorParallel(parallel int) Option

func WithRaftExecutorParallel

func WithRaftExecutorParallel(parallel int) Option

func WithStateStore

func WithStateStore(stateStore *meta.SyncStore) Option

func WithTransportExecutorParallel

func WithTransportExecutorParallel(parallel int) Option

func WithWALOptions

func WithWALOptions(opts ...walog.Option) Option

type Peer

type Peer struct {
	ID       vanus.ID
	Endpoint string
}

Jump to

Keyboard shortcuts

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