command

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	// WriteBatch returns the write batch for write application's data, it's only used in write command handle.
	WriteBatch() *util.WriteBatch
	// LogIndex log index, the raft log index of the current command, it's only used in write command handle.
	LogIndex() uint64
	// Offset is the index in the current command batch
	Offset() int
	// BatchSize number of the current command batch
	BatchSize() int
	// Attrs returns a map to store attrs
	Attrs() map[string]interface{}
	// ByteBuf returns the bytebuf
	ByteBuf() *buf.ByteBuf
	// DataStorage returns data storage
	DataStorage() storage.DataStorage
	// StoreID returns store id
	StoreID() uint64
}

Context apply context.

type LocalCommandFunc

type LocalCommandFunc func(bhmetapb.Shard, *raftcmdpb.Request) (*raftcmdpb.Response, error)

LocalCommandFunc directly exec on local func

type ReadCommandFunc

type ReadCommandFunc func(bhmetapb.Shard, *raftcmdpb.Request, Context) (resp *raftcmdpb.Response, readedBytes uint64)

ReadCommandFunc the read command handler func

type WriteCommandFunc

type WriteCommandFunc func(bhmetapb.Shard, *raftcmdpb.Request, Context) (writeBytes uint64, diffBytes int64, resp *raftcmdpb.Response)

WriteCommandFunc the write command handler func, returns write bytes and the diff bytes that used to modify the size of the current shard

Jump to

Keyboard shortcuts

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