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

@@ -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()