diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2016-08-09 18:03:57 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-09 18:03:57 -0700 |
| commit | fa8198f44b63db436dc0ba0b431aa96104664e7a (patch) | |
| tree | 1e4c27307b63ac0798bb0cecb864b621c347de04 /weed/topology/data_node.go | |
| parent | d5b0538f7be5e4106e8d42062d08258d98172607 (diff) | |
| parent | f04d8fcbcc7baea562e2afb526328a467cd37ab9 (diff) | |
| download | seaweedfs-fa8198f44b63db436dc0ba0b431aa96104664e7a.tar.xz seaweedfs-fa8198f44b63db436dc0ba0b431aa96104664e7a.zip | |
Merge pull request #354 from hxiaodon/master
if replicated volume has one copy in readonly mode at one node,it sho…
Diffstat (limited to 'weed/topology/data_node.go')
| -rw-r--r-- | weed/topology/data_node.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/weed/topology/data_node.go b/weed/topology/data_node.go index 1404d4aa8..da6ed2895 100644 --- a/weed/topology/data_node.go +++ b/weed/topology/data_node.go @@ -79,6 +79,17 @@ func (dn *DataNode) GetVolumes() (ret []storage.VolumeInfo) { return ret } +func (dn *DataNode) GetVolumesById(id storage.VolumeId) (storage.VolumeInfo, error) { + dn.RLock() + defer dn.RUnlock() + v_info, ok := dn.volumes[id] + if ok { + return v_info, nil + } else { + return storage.VolumeInfo{}, fmt.Errorf("volumeInfo not found") + } +} + func (dn *DataNode) GetDataCenter() *DataCenter { return dn.Parent().Parent().(*NodeImpl).value.(*DataCenter) } |
