aboutsummaryrefslogtreecommitdiff
path: root/go/topology/collection.go
diff options
context:
space:
mode:
authoryanyiwu <i@yanyiwu.com>2015-01-08 15:54:50 +0800
committeryanyiwu <i@yanyiwu.com>2015-01-08 15:54:50 +0800
commitcacfc8586957220423210a496e3064d7eafab393 (patch)
treeea9b9f8eeb0b7a2799842401192da94b14d5aa2d /go/topology/collection.go
parentf2b07d605199282dc392c5c10b02218ada7eac56 (diff)
downloadseaweedfs-cacfc8586957220423210a496e3064d7eafab393.tar.xz
seaweedfs-cacfc8586957220423210a496e3064d7eafab393.zip
add some String() to make codes easier to read and debug
Diffstat (limited to 'go/topology/collection.go')
-rw-r--r--go/topology/collection.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/go/topology/collection.go b/go/topology/collection.go
index 4b47ae88a..5437ffd79 100644
--- a/go/topology/collection.go
+++ b/go/topology/collection.go
@@ -1,6 +1,8 @@
package topology
import (
+ "fmt"
+
"github.com/chrislusf/weed-fs/go/storage"
"github.com/chrislusf/weed-fs/go/util"
)
@@ -17,6 +19,10 @@ func NewCollection(name string, volumeSizeLimit uint64) *Collection {
return c
}
+func (c *Collection) String() string {
+ return fmt.Sprintf("Name:%s, volumeSizeLimit:%d, storageType2VolumeLayout:%v", c.Name, c.volumeSizeLimit, c.storageType2VolumeLayout)
+}
+
func (c *Collection) GetOrCreateVolumeLayout(rp *storage.ReplicaPlacement, ttl *storage.TTL) *VolumeLayout {
keyString := rp.String()
if ttl != nil {