Documentation
¶
Index ¶
- type Backend
- func (d *Backend) AppliedIndex() uint64
- func (d *Backend) ApplyFuncRead(roLevel rkvApi.ConsistencyLevel, name string, args ...[]byte) (interface{}, error)
- func (d *Backend) ApplyFuncWrite(name string, args ...[]byte) (interface{}, error)
- func (d *Backend) Batch(commands []*dbApi.BatchEntry) (interface{}, error)
- func (d *Backend) Close() error
- func (d *Backend) CommittedIndex() uint64
- func (d *Backend) Delete(tab, key []byte) error
- func (d *Backend) Get(lvl rkvApi.ConsistencyLevel, tab, key []byte) ([]byte, error)
- func (d *Backend) IsLeader() bool
- func (d *Backend) Join(id string, tags map[string]string, local bool) error
- func (d *Backend) Leader() (string, string)
- func (d *Backend) Leave(id string, tags map[string]string, local bool) error
- func (d *Backend) Put(tab, key, val []byte) error
- func (d *Backend) RaftAddr() net.Addr
- func (d *Backend) Restarted() bool
- func (d *Backend) Servers() ([]*clusterApi.Server, error)
- func (d *Backend) WaitForLeader(timeout time.Duration) error
- type Config
- type StreamLayer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend ...
func (*Backend) AppliedIndex ¶
AppliedIndex returns the latest index applied to the FSM
func (*Backend) ApplyFuncRead ¶ added in v0.4.7
func (d *Backend) ApplyFuncRead( roLevel rkvApi.ConsistencyLevel, name string, args ...[]byte) (interface{}, error)
ApplyFuncRead calls 'name' function on raft cluster
func (*Backend) ApplyFuncWrite ¶ added in v0.4.7
ApplyFuncWrite calls 'name' function on raft cluster
func (*Backend) Batch ¶ added in v0.1.2
func (d *Backend) Batch(commands []*dbApi.BatchEntry) (interface{}, error)
Batch apply multiple put, delete operations
func (*Backend) CommittedIndex ¶
CommittedIndex returns the latest index committed to stable storage
func (*Backend) Join ¶
Join ... func (d *Backend) Join(id, raftAddr, rpcAddr string, local bool) error {
type Config ¶
type Config struct { Raft raft.Config RPCAddr string RaftAddr string // hostname for bootstrap by name, not ip StreamLayer *StreamLayer Bootstrap bool ApplyRegistrator rkvApi.ApplyRegistrator OnLeaderChangeFn func(isLeader bool) }
Config for distributed Db
type StreamLayer ¶
type StreamLayer struct {
// contains filtered or unexported fields
}
StreamLayer is the network service provided to Raft
func (*StreamLayer) Accept ¶
func (t *StreamLayer) Accept() (net.Conn, error)
Accept waits for the next connection.
func (*StreamLayer) Addr ¶
func (t *StreamLayer) Addr() net.Addr
Addr returns the binding address of the StreamLayer.
func (*StreamLayer) Dial ¶
func (t *StreamLayer) Dial( addr raft.ServerAddress, timeout time.Duration) (net.Conn, error)
Dial creates a new network connection.
Click to show internal directories.
Click to hide internal directories.