Unexport NewTopology

This commit is contained in:
Cody Soyland 2018-07-05 21:48:59 -05:00
parent 4aa8a41fa0
commit 2031345c86
2 changed files with 5 additions and 5 deletions

View file

@ -1403,7 +1403,7 @@ type Topology struct {
nodeStates map[string]string
}
func NewTopology() *Topology {
func newTopology() *Topology {
return &Topology{
nodeStates: make(map[string]string),
}
@ -1472,7 +1472,7 @@ func (t *Topology) Encode() *internal.Topology {
func (c *cluster) loadTopology() error {
buf, err := ioutil.ReadFile(filepath.Join(c.Path, ".topology"))
if os.IsNotExist(err) {
c.Topology = NewTopology()
c.Topology = newTopology()
return nil
} else if err != nil {
return errors.Wrap(err, "reading file")
@ -1784,7 +1784,7 @@ func decodeTopology(topology *internal.Topology) (*Topology, error) {
return nil, nil
}
t := NewTopology()
t := newTopology()
t.ClusterID = topology.ClusterID
t.NodeIDs = topology.NodeIDs
sort.Slice(t.NodeIDs,

View file

@ -37,7 +37,7 @@ func NewTestCluster(n int) *cluster {
c.ReplicaN = 1
c.Hasher = NewTestModHasher()
c.Path = path
c.Topology = NewTopology()
c.Topology = newTopology()
for i := 0; i < n; i++ {
c.Nodes = append(c.Nodes, &Node{
@ -225,7 +225,7 @@ func (t *ClusterCluster) addCluster(i int, saveTopology bool) (*cluster, error)
c.ReplicaN = 1
c.Hasher = NewTestModHasher()
c.Path = path
c.Topology = NewTopology()
c.Topology = newTopology()
c.holder = h
c.Node = node
c.Coordinator = t.common.Nodes[0].ID // the first node is the coordinator