Documentation
¶
Index ¶
- type Executor
- func (ch *Executor) IsReady() bool
- func (ch *Executor) Join(uuid string, record, replay bool) error
- func (ch *Executor) JoinN(uuids []string, record bool) error
- func (ch *Executor) Leave(uuid string, record, replay bool) error
- func (ch *Executor) List() ([]string, error)
- func (ch *Executor) Map(key string, record, replay bool) (string, error)
- func (ch *Executor) PromoteToLeader(leader string)
- func (ch *Executor) ReplayOpLogs()
- func (ch *Executor) Start()
- func (ch *Executor) Stop()
- func (ch *Executor) TellLeader(leader string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor implements consistent-hashing algorithm inspired by "Consistent Hashing and Random Trees: Distributed Caching Protocols for Relieving Hot Spots on the World Wide Web".
func NewExecutor ¶
func NewExecutor(workerID string, cfg *conf.ConsistentHashing) *Executor
NewExecutor returns a new Executor instance.
func (*Executor) PromoteToLeader ¶
PromoteToLeader marks the current worker as leader.
func (*Executor) ReplayOpLogs ¶
func (ch *Executor) ReplayOpLogs()
ReplayOpLogs calls oplogger's ReplayOpLogs method.
func (*Executor) TellLeader ¶
TellLeader tell who is the current leader.
Click to show internal directories.
Click to hide internal directories.