diff options
| author | yanyiwu <i@yanyiwu.com> | 2015-01-08 15:54:50 +0800 |
|---|---|---|
| committer | yanyiwu <i@yanyiwu.com> | 2015-01-08 15:54:50 +0800 |
| commit | cacfc8586957220423210a496e3064d7eafab393 (patch) | |
| tree | ea9b9f8eeb0b7a2799842401192da94b14d5aa2d /go/topology/volume_layout.go | |
| parent | f2b07d605199282dc392c5c10b02218ada7eac56 (diff) | |
| download | seaweedfs-cacfc8586957220423210a496e3064d7eafab393.tar.xz seaweedfs-cacfc8586957220423210a496e3064d7eafab393.zip | |
add some String() to make codes easier to read and debug
Diffstat (limited to 'go/topology/volume_layout.go')
| -rw-r--r-- | go/topology/volume_layout.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/go/topology/volume_layout.go b/go/topology/volume_layout.go index de72bf895..4b1d3dad9 100644 --- a/go/topology/volume_layout.go +++ b/go/topology/volume_layout.go @@ -2,6 +2,7 @@ package topology import ( "errors" + "fmt" "math/rand" "sync" @@ -29,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() |
