2020-05-07 12:26:55 +02:00
|
|
|
package cluster
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/memberlist"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2020-05-07 14:33:29 +02:00
|
|
|
// NotifyConflict implements the memberlist deletage interface
|
2020-05-07 12:26:55 +02:00
|
|
|
func (c *Cluster) NotifyConflict(node, other *memberlist.Node) {
|
|
|
|
logrus.Errorf("node name conflict detected: %s", other.Name)
|
|
|
|
}
|
|
|
|
|
2020-05-07 14:33:29 +02:00
|
|
|
// NodeMeta implements the memberlist deletage interface
|
|
|
|
// Metadata is provided by the local node settings, encoding is handled
|
|
|
|
// by the node implementation directly
|
2020-05-07 12:26:55 +02:00
|
|
|
func (c *Cluster) NodeMeta(limit int) []byte {
|
|
|
|
encoded, err := c.localNode.Encode(limit)
|
|
|
|
if err != nil {
|
|
|
|
logrus.Errorf("failed to encode local node: %s", err)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return encoded
|
|
|
|
}
|
|
|
|
|
2020-05-07 14:33:29 +02:00
|
|
|
// NotifyMsg implements the memberlist deletage interface
|
|
|
|
func (c *Cluster) NotifyMsg([]byte) {}
|
|
|
|
|
|
|
|
// GetBroadcasts implements the memberlist deletage interface
|
2020-05-07 12:26:55 +02:00
|
|
|
func (c *Cluster) GetBroadcasts(overhead, limit int) [][]byte { return nil }
|
2020-05-07 14:33:29 +02:00
|
|
|
|
|
|
|
// LocalState implements the memberlist deletage interface
|
|
|
|
func (c *Cluster) LocalState(join bool) []byte { return nil }
|
|
|
|
|
|
|
|
// MergeRemoteState implements the memberlist deletage interface
|
|
|
|
func (c *Cluster) MergeRemoteState(buf []byte, join bool) {}
|