aboutsummaryrefslogtreecommitdiff
path: root/go/topology/data_node.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2015-01-18 17:03:38 -0800
committerChris Lu <chris.lu@gmail.com>2015-01-18 17:03:38 -0800
commit7b4a53b2c1195a459198e2ee9217b1b8b958e727 (patch)
tree5a8af9c4a936000b3629b2a046f8637c9589fb0e /go/topology/data_node.go
parent7b10d62096272d165727c9e30ed748b5561e8769 (diff)
downloadseaweedfs-7b4a53b2c1195a459198e2ee9217b1b8b958e727.tar.xz
seaweedfs-7b4a53b2c1195a459198e2ee9217b1b8b958e727.zip
Add optional admin port to volume server, to seperate admin operations from normal file operations.
Diffstat (limited to 'go/topology/data_node.go')
-rw-r--r--go/topology/data_node.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/go/topology/data_node.go b/go/topology/data_node.go
index 09b9fac6c..2d0a093cc 100644
--- a/go/topology/data_node.go
+++ b/go/topology/data_node.go
@@ -13,6 +13,7 @@ type DataNode struct {
volumes map[storage.VolumeId]storage.VolumeInfo
Ip string
Port int
+ AdminPort int
PublicUrl string
LastSeen int64 // unix time in seconds
Dead bool
@@ -28,7 +29,7 @@ func NewDataNode(id string) *DataNode {
}
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)
+ return fmt.Sprintf("Node:%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) {
@@ -89,6 +90,10 @@ func (dn *DataNode) Url() string {
return dn.Ip + ":" + strconv.Itoa(dn.Port)
}
+func (dn *DataNode) AdminUrl() string {
+ return dn.Ip + ":" + strconv.Itoa(dn.AdminPort)
+}
+
func (dn *DataNode) ToMap() interface{} {
ret := make(map[string]interface{})
ret["Url"] = dn.Url()