Add read-write lock to guard topology changes on new collections and ttls.

This commit is contained in:
chrislusf
2014-12-08 20:29:25 -08:00
parent ba972694c7
commit 52180f386b
5 changed files with 74 additions and 34 deletions

View File

@@ -11,10 +11,11 @@ func (t *Topology) ToMap() interface{} {
}
m["DataCenters"] = dcs
var layouts []interface{}
for _, c := range t.collectionMap {
for _, layout := range c.storageType2VolumeLayout {
for _, col := range t.collectionMap.Items {
c := col.(*Collection)
for _, layout := range c.storageType2VolumeLayout.Items {
if layout != nil {
tmp := layout.ToMap()
tmp := layout.(*VolumeLayout).ToMap()
tmp["collection"] = c.Name
layouts = append(layouts, tmp)
}