aboutsummaryrefslogtreecommitdiff
path: root/go/topology/topology.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-02-26 22:54:22 -0800
committerChris Lu <chris.lu@gmail.com>2013-02-26 22:54:22 -0800
commitdb8e27be6ec7daa1a188f90f61e385c04cb6b008 (patch)
tree33e53b6ec51157709bc6121adeb8b19fe668c79b /go/topology/topology.go
parentbd278337db4e3c1937f2d7cd1623ee9627c77619 (diff)
downloadseaweedfs-db8e27be6ec7daa1a188f90f61e385c04cb6b008.tar.xz
seaweedfs-db8e27be6ec7daa1a188f90f61e385c04cb6b008.zip
add lots of error checking by GThomas
Diffstat (limited to 'go/topology/topology.go')
-rw-r--r--go/topology/topology.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/go/topology/topology.go b/go/topology/topology.go
index 70a1ad268..74dc1cd09 100644
--- a/go/topology/topology.go
+++ b/go/topology/topology.go
@@ -1,12 +1,12 @@
package topology
import (
- "errors"
- "io/ioutil"
- "math/rand"
"code.google.com/p/weed-fs/go/directory"
"code.google.com/p/weed-fs/go/sequence"
"code.google.com/p/weed-fs/go/storage"
+ "errors"
+ "io/ioutil"
+ "math/rand"
)
type Topology struct {
@@ -28,7 +28,7 @@ type Topology struct {
configuration *Configuration
}
-func NewTopology(id string, confFile string, dirname string, sequenceFilename string, volumeSizeLimit uint64, pulse int) *Topology {
+func NewTopology(id string, confFile string, dirname string, sequenceFilename string, volumeSizeLimit uint64, pulse int) (*Topology, error) {
t := &Topology{}
t.id = NodeId(id)
t.nodeType = "Topology"
@@ -44,9 +44,9 @@ func NewTopology(id string, confFile string, dirname string, sequenceFilename st
t.chanRecoveredDataNodes = make(chan *DataNode)
t.chanFullVolumes = make(chan storage.VolumeInfo)
- t.loadConfiguration(confFile)
+ err := t.loadConfiguration(confFile)
- return t
+ return t, err
}
func (t *Topology) loadConfiguration(configurationFile string) error {