added Join method to Static Nodeset so that Status is calculated with the local node

This commit is contained in:
Michael Baird 2017-04-24 13:57:35 -05:00
parent 5857438d8b
commit acc4b022d7
2 changed files with 6 additions and 0 deletions

View file

@ -34,6 +34,11 @@ func (s *StaticNodeSet) Open() error {
return nil
}
func (s *StaticNodeSet) Join(nodes []*Node) error {
s.nodes = nodes
return nil
}
// Broadcaster is an interface for broadcasting messages.
type Broadcaster interface {
SendSync(pb proto.Message) error

View file

@ -163,6 +163,7 @@ func (m *Command) SetupServer() error {
m.Server.Broadcaster = pilosa.NopBroadcaster
m.Server.Cluster.NodeSet = pilosa.NewStaticNodeSet()
m.Server.BroadcastReceiver = pilosa.NopBroadcastReceiver
m.Server.Cluster.NodeSet.(*pilosa.StaticNodeSet).Join(m.Server.Cluster.Nodes)
default:
return fmt.Errorf("'%v' is not a supported value for broadcaster type.", m.Config.Cluster.Type)
}