aboutsummaryrefslogtreecommitdiff
path: root/go/topology/collection.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2016-05-30 12:30:26 -0700
committerChris Lu <chris.lu@gmail.com>2016-05-30 12:30:26 -0700
commit6df18a918103634fd4e5e3297e9d2b1597ec5b73 (patch)
tree7d0e918cd4a04348eb2edf67f7951835ca20011d /go/topology/collection.go
parent46a89a7d61a269dbf8cfb1d113d328f138ac5361 (diff)
downloadseaweedfs-6df18a918103634fd4e5e3297e9d2b1597ec5b73.tar.xz
seaweedfs-6df18a918103634fd4e5e3297e9d2b1597ec5b73.zip
rwlock concurrent read map
Diffstat (limited to 'go/topology/collection.go')
-rw-r--r--go/topology/collection.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/go/topology/collection.go b/go/topology/collection.go
index 376b62405..6368900c3 100644
--- a/go/topology/collection.go
+++ b/go/topology/collection.go
@@ -35,7 +35,7 @@ func (c *Collection) GetOrCreateVolumeLayout(rp *storage.ReplicaPlacement, ttl *
}
func (c *Collection) Lookup(vid storage.VolumeId) []*DataNode {
- for _, vl := range c.storageType2VolumeLayout.Items {
+ for _, vl := range c.storageType2VolumeLayout.Items() {
if vl != nil {
if list := vl.(*VolumeLayout).Lookup(vid); list != nil {
return list
@@ -46,7 +46,7 @@ func (c *Collection) Lookup(vid storage.VolumeId) []*DataNode {
}
func (c *Collection) ListVolumeServers() (nodes []*DataNode) {
- for _, vl := range c.storageType2VolumeLayout.Items {
+ for _, vl := range c.storageType2VolumeLayout.Items() {
if vl != nil {
if list := vl.(*VolumeLayout).ListVolumeServers(); list != nil {
nodes = append(nodes, list...)