Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotLeader = fmt.Errorf("not leader")
ErrNotLeader represents this node is not leader
Functions ¶
This section is empty.
Types ¶
type Replicator ¶
type Replicator interface { Join(nodeID, addr string) error Propose(command *models.Command) error GetSnapshot() (store.Snapshot, error) IsLeader() bool Leader() string LeaderCh() <-chan bool Start(string, bool) error }
Replicator is storage engine replicated by raft algorithm
func NewReplicator ¶
func NewReplicator( store store.Store, snapshotStore snapshotstore.SnapshotStore, transport transport.Transport, logStore logstore.LogStore, stableStore stablestore.StableStore, serializer serializer.Serializer, snapshotter snapshotter.Snapshotter, handler handler.Handler, logger logger.Logger, ) (Replicator, error)
NewReplicator returns replicator implementation
Click to show internal directories.
Click to hide internal directories.