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/data_node.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/data_node.go')
| -rw-r--r-- | go/topology/data_node.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/go/topology/data_node.go b/go/topology/data_node.go index 109bd037f..09b9fac6c 100644 --- a/go/topology/data_node.go +++ b/go/topology/data_node.go @@ -1,6 +1,7 @@ package topology import ( + "fmt" "strconv" "github.com/chrislusf/weed-fs/go/glog" @@ -26,6 +27,10 @@ func NewDataNode(id string) *DataNode { return s } +func (dn *DataNode) String() string { + return fmt.Sprintf("NodeImpl:%s ,volumes:%v, Ip:%s, Port:%d, PublicUrl:%s, Dead:%v", dn.NodeImpl.String(), dn.volumes, dn.Ip, dn.Port, dn.PublicUrl, dn.Dead) +} + func (dn *DataNode) AddOrUpdateVolume(v storage.VolumeInfo) { if _, ok := dn.volumes[v.Id]; !ok { dn.volumes[v.Id] = v |
