aboutsummaryrefslogtreecommitdiff
path: root/go/topology/volume_layout.go
diff options
context:
space:
mode:
authoryourchanges <yourchanges@gmail.com>2015-01-10 02:51:26 +0800
committeryourchanges <yourchanges@gmail.com>2015-01-10 02:51:26 +0800
commit9601880e323bbdf9540f2c79fb21d66374245b50 (patch)
tree14fd3b36a89955ec6e0be6d51186031e978b519d /go/topology/volume_layout.go
parentf7bcd8e958ef185baeca0c455a397d49fcb62256 (diff)
parent2c1a846279c172bcae457e70efa142c29a18892e (diff)
downloadseaweedfs-9601880e323bbdf9540f2c79fb21d66374245b50.tar.xz
seaweedfs-9601880e323bbdf9540f2c79fb21d66374245b50.zip
Merge pull request #2 from chrislusf/master
merge
Diffstat (limited to 'go/topology/volume_layout.go')
-rw-r--r--go/topology/volume_layout.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/go/topology/volume_layout.go b/go/topology/volume_layout.go
index 7bb0cf7e3..4b1d3dad9 100644
--- a/go/topology/volume_layout.go
+++ b/go/topology/volume_layout.go
@@ -1,11 +1,13 @@
package topology
import (
- "github.com/chrislusf/weed-fs/go/glog"
- "github.com/chrislusf/weed-fs/go/storage"
"errors"
+ "fmt"
"math/rand"
"sync"
+
+ "github.com/chrislusf/weed-fs/go/glog"
+ "github.com/chrislusf/weed-fs/go/storage"
)
// mapping from volume to its locations, inverted from server to volume
@@ -28,6 +30,10 @@ func NewVolumeLayout(rp *storage.ReplicaPlacement, ttl *storage.TTL, volumeSizeL
}
}
+func (vl *VolumeLayout) String() string {
+ return fmt.Sprintf("rp:%v, ttl:%v, vid2location:%v, writables:%v, volumeSizeLimit:%v", vl.rp, vl.ttl, vl.vid2location, vl.writables, vl.volumeSizeLimit)
+}
+
func (vl *VolumeLayout) RegisterVolume(v *storage.VolumeInfo, dn *DataNode) {
vl.accessLock.Lock()
defer vl.accessLock.Unlock()