aboutsummaryrefslogtreecommitdiff
path: root/go/replication
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/replication
parentbd278337db4e3c1937f2d7cd1623ee9627c77619 (diff)
downloadseaweedfs-db8e27be6ec7daa1a188f90f61e385c04cb6b008.tar.xz
seaweedfs-db8e27be6ec7daa1a188f90f61e385c04cb6b008.zip
add lots of error checking by GThomas
Diffstat (limited to 'go/replication')
-rw-r--r--go/replication/volume_growth.go6
-rw-r--r--go/replication/volume_growth_test.go9
2 files changed, 9 insertions, 6 deletions
diff --git a/go/replication/volume_growth.go b/go/replication/volume_growth.go
index 747e07642..1f266f73f 100644
--- a/go/replication/volume_growth.go
+++ b/go/replication/volume_growth.go
@@ -1,12 +1,12 @@
package replication
import (
- "errors"
- "fmt"
- "math/rand"
"code.google.com/p/weed-fs/go/operation"
"code.google.com/p/weed-fs/go/storage"
"code.google.com/p/weed-fs/go/topology"
+ "errors"
+ "fmt"
+ "math/rand"
"sync"
)
diff --git a/go/replication/volume_growth_test.go b/go/replication/volume_growth_test.go
index e35dbc707..3fbeebc9e 100644
--- a/go/replication/volume_growth_test.go
+++ b/go/replication/volume_growth_test.go
@@ -1,11 +1,11 @@
package replication
import (
+ "code.google.com/p/weed-fs/go/storage"
+ "code.google.com/p/weed-fs/go/topology"
"encoding/json"
"fmt"
"math/rand"
- "code.google.com/p/weed-fs/go/storage"
- "code.google.com/p/weed-fs/go/topology"
"testing"
"time"
)
@@ -96,7 +96,10 @@ func setup(topologyLayout string) *topology.Topology {
rack.LinkChildNode(server)
for _, v := range serverMap["volumes"].([]interface{}) {
m := v.(map[string]interface{})
- vi := storage.VolumeInfo{Id: storage.VolumeId(int64(m["id"].(float64))), Size: int64(m["size"].(float64)), Version: storage.CurrentVersion}
+ vi := storage.VolumeInfo{
+ Id: storage.VolumeId(int64(m["id"].(float64))),
+ Size: uint64(m["size"].(float64)),
+ Version: storage.CurrentVersion}
server.AddOrUpdateVolume(vi)
}
server.UpAdjustMaxVolumeCountDelta(int(serverMap["limit"].(float64)))