diff options
Diffstat (limited to 'go/topology/topology.go')
| -rw-r--r-- | go/topology/topology.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/go/topology/topology.go b/go/topology/topology.go index 1426f7a12..d72879035 100644 --- a/go/topology/topology.go +++ b/go/topology/topology.go @@ -99,6 +99,15 @@ func (t *Topology) GetVolumeLayout(collectionName string, rp *storage.ReplicaPla return t.collectionMap[collectionName].GetOrCreateVolumeLayout(rp) } +func (t *Topology) GetCollection(collectionName string) (collection *Collection, ok bool) { + collection, ok = t.collectionMap[collectionName] + return +} + +func (t *Topology) DeleteCollection(collectionName string) { + delete(t.collectionMap, collectionName) +} + func (t *Topology) RegisterVolumeLayout(v *storage.VolumeInfo, dn *DataNode) { t.GetVolumeLayout(v.Collection, v.ReplicaPlacement).RegisterVolume(v, dn) } @@ -112,8 +121,8 @@ func (t *Topology) RegisterVolumes(init bool, volumeInfos []storage.VolumeInfo, t.UnRegisterDataNode(dn) } dn = rack.GetOrCreateDataNode(ip, port, publicUrl, maxVolumeCount) + dn.UpdateVolumes(volumeInfos) for _, v := range volumeInfos { - dn.AddOrUpdateVolume(v) t.RegisterVolumeLayout(&v, dn) } } |
