diff options
Diffstat (limited to 'go/topology')
| -rw-r--r-- | go/topology/node_list_test.go | 3 | ||||
| -rw-r--r-- | go/topology/topo_test.go | 3 | ||||
| -rw-r--r-- | go/topology/topology.go | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/go/topology/node_list_test.go b/go/topology/node_list_test.go index c7b165ea6..c526f55f8 100644 --- a/go/topology/node_list_test.go +++ b/go/topology/node_list_test.go @@ -1,13 +1,14 @@ package topology import ( + "code.google.com/p/weed-fs/go/sequence" _ "fmt" "strconv" "testing" ) func TestXYZ(t *testing.T) { - topo, err := NewTopology("topo", "/etc/weed.conf", "/tmp", "test", 234, 5) + topo, err := NewTopology("topo", "/etc/weed.conf", sequence.NewMemorySequencer(), 234, 5) if err != nil { t.Error("cannot create new topology:", err) t.FailNow() diff --git a/go/topology/topo_test.go b/go/topology/topo_test.go index d5ea08086..36f4963db 100644 --- a/go/topology/topo_test.go +++ b/go/topology/topo_test.go @@ -1,6 +1,7 @@ package topology import ( + "code.google.com/p/weed-fs/go/sequence" "code.google.com/p/weed-fs/go/storage" "encoding/json" "fmt" @@ -78,7 +79,7 @@ func setup(topologyLayout string) *Topology { } //need to connect all nodes first before server adding volumes - topo, err := NewTopology("mynetwork", "/etc/weed.conf", "/tmp", "test", 234, 5) + topo, err := NewTopology("mynetwork", "/etc/weed.conf", sequence.NewMemorySequencer(), 234, 5) if err != nil { fmt.Println("error:", err) } diff --git a/go/topology/topology.go b/go/topology/topology.go index d0e9fb42b..b21601210 100644 --- a/go/topology/topology.go +++ b/go/topology/topology.go @@ -28,7 +28,7 @@ type Topology struct { configuration *Configuration } -func NewTopology(id string, confFile string, dirname string, sequenceFilename string, volumeSizeLimit uint64, pulse int) (*Topology, error) { +func NewTopology(id string, confFile string, seq sequence.Sequencer, volumeSizeLimit uint64, pulse int) (*Topology, error) { t := &Topology{} t.id = NodeId(id) t.nodeType = "Topology" @@ -38,7 +38,7 @@ func NewTopology(id string, confFile string, dirname string, sequenceFilename st t.pulse = int64(pulse) t.volumeSizeLimit = volumeSizeLimit - t.sequence = sequence.NewSequencer(dirname, sequenceFilename) + t.sequence = seq t.chanDeadDataNodes = make(chan *DataNode) t.chanRecoveredDataNodes = make(chan *DataNode) |
