aboutsummaryrefslogtreecommitdiff
path: root/weed/topology/topology.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@uber.com>2019-03-16 13:43:16 -0700
committerChris Lu <chris.lu@uber.com>2019-03-16 13:43:16 -0700
commit657dd2e6c93c02f46b10dfd43fb6e9b38c025ece (patch)
treec23a093382d5ffd0d39dd69b68fb24050daa7f3e /weed/topology/topology.go
parentb92122b885c8fba189f3c503c17478008806fda7 (diff)
downloadseaweedfs-657dd2e6c93c02f46b10dfd43fb6e9b38c025ece.tar.xz
seaweedfs-657dd2e6c93c02f46b10dfd43fb6e9b38c025ece.zip
add shell command to list all collections
Diffstat (limited to 'weed/topology/topology.go')
-rw-r--r--weed/topology/topology.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go
index 77716605a..208c9b5b7 100644
--- a/weed/topology/topology.go
+++ b/weed/topology/topology.go
@@ -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 {