Remote leaderCh

Not used
pull/3372/head
Jason Wilder 2015-07-17 12:04:45 -06:00
parent b86fecfd80
commit 80248f9b53
2 changed files with 0 additions and 18 deletions

View File

@ -21,7 +21,6 @@ type raftState interface {
initialize() error
leader() string
isLeader() bool
leaderCh() <-chan bool
raftEnabled() bool
sync(index uint64, timeout time.Duration) error
setPeers(addrs []string) error
@ -185,13 +184,6 @@ func (r *localRaft) isLeader() bool {
return r.store.raft.State() == raft.Leader
}
func (r *localRaft) leaderCh() <-chan bool {
r.store.mu.RLock()
defer r.store.mu.RUnlock()
assert(r.store.raft != nil, "cannot retrieve leadership channel when closed")
return r.store.raft.LeaderCh()
}
// remoteRaft is a consensus strategy that uses a remote raft cluster for
// consensus operations.
type remoteRaft struct {
@ -202,10 +194,6 @@ func (r *remoteRaft) raftEnabled() bool {
return false
}
func (r *remoteRaft) leaderCh() <-chan bool {
panic("cannot retrieve leadership channel using remote raft")
}
func (r *remoteRaft) updateMetaData(ms *Data) {
if ms == nil {
return

View File

@ -440,12 +440,6 @@ func (s *Store) Leader() string {
return s.raftState.leader()
}
// LeaderCh returns a channel that notifies on leadership change.
// Panics when the store has not been opened yet.
func (s *Store) LeaderCh() <-chan bool {
return s.raftState.leaderCh()
}
// SetPeers sets a list of peers in the cluster.
func (s *Store) SetPeers(addrs []string) error {
return s.raftState.setPeers(addrs)