diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-04-18 21:43:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-04-18 21:43:36 -0700 |
| commit | e5506152c0a27d38fa334b2e338d82ee02669ab9 (patch) | |
| tree | 1f589cbbf7244cbe5dbfe84ca89f5996e4ca9ff3 /weed/topology/node.go | |
| parent | 33c92b819a334b5709e6f1cbe304e4b8855c1238 (diff) | |
| download | seaweedfs-e5506152c0a27d38fa334b2e338d82ee02669ab9.tar.xz seaweedfs-e5506152c0a27d38fa334b2e338d82ee02669ab9.zip | |
refactoring
Diffstat (limited to 'weed/topology/node.go')
| -rw-r--r-- | weed/topology/node.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/weed/topology/node.go b/weed/topology/node.go index db70c9734..a115c8480 100644 --- a/weed/topology/node.go +++ b/weed/topology/node.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "github.com/chrislusf/seaweedfs/weed/glog" - "github.com/chrislusf/seaweedfs/weed/storage" + "github.com/chrislusf/seaweedfs/weed/storage/needle" ) type NodeId string @@ -20,12 +20,12 @@ type Node interface { UpAdjustMaxVolumeCountDelta(maxVolumeCountDelta int64) UpAdjustVolumeCountDelta(volumeCountDelta int64) UpAdjustActiveVolumeCountDelta(activeVolumeCountDelta int64) - UpAdjustMaxVolumeId(vid storage.VolumeId) + UpAdjustMaxVolumeId(vid needle.VolumeId) GetVolumeCount() int64 GetActiveVolumeCount() int64 GetMaxVolumeCount() int64 - GetMaxVolumeId() storage.VolumeId + GetMaxVolumeId() needle.VolumeId SetParent(Node) LinkChildNode(node Node) UnlinkChildNode(nodeId NodeId) @@ -46,8 +46,8 @@ type NodeImpl struct { maxVolumeCount int64 parent Node sync.RWMutex // lock children - children map[NodeId]Node - maxVolumeId storage.VolumeId + children map[NodeId]Node + maxVolumeId needle.VolumeId //for rack, data center, topology nodeType string @@ -190,7 +190,7 @@ func (n *NodeImpl) UpAdjustActiveVolumeCountDelta(activeVolumeCountDelta int64) n.parent.UpAdjustActiveVolumeCountDelta(activeVolumeCountDelta) } } -func (n *NodeImpl) UpAdjustMaxVolumeId(vid storage.VolumeId) { //can be negative +func (n *NodeImpl) UpAdjustMaxVolumeId(vid needle.VolumeId) { //can be negative if n.maxVolumeId < vid { n.maxVolumeId = vid if n.parent != nil { @@ -198,7 +198,7 @@ func (n *NodeImpl) UpAdjustMaxVolumeId(vid storage.VolumeId) { //can be negative } } } -func (n *NodeImpl) GetMaxVolumeId() storage.VolumeId { +func (n *NodeImpl) GetMaxVolumeId() needle.VolumeId { return n.maxVolumeId } func (n *NodeImpl) GetVolumeCount() int64 { |
