add some String() to make codes easier to read and debug

This commit is contained in:
yanyiwu
2015-01-08 15:54:50 +08:00
parent f2b07d6051
commit cacfc85869
8 changed files with 41 additions and 2 deletions

View File

@@ -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 {