add shell command to list all collections

This commit is contained in:
Chris Lu
2019-03-16 13:43:16 -07:00
parent b92122b885
commit 657dd2e6c9
11 changed files with 589 additions and 114 deletions

View File

@@ -117,6 +117,13 @@ func (t *Topology) GetVolumeLayout(collectionName string, rp *storage.ReplicaPla
}).(*Collection).GetOrCreateVolumeLayout(rp, ttl)
}
func (t *Topology) ListCollections() (ret []*Collection) {
for _, c := range t.collectionMap.Items() {
ret = append(ret, c.(*Collection))
}
return ret
}
func (t *Topology) FindCollection(collectionName string) (*Collection, bool) {
c, hasCollection := t.collectionMap.Find(collectionName)
if !hasCollection {