diff options
| author | Chris Lu <chris.lu@uber.com> | 2019-03-16 13:43:16 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@uber.com> | 2019-03-16 13:43:16 -0700 |
| commit | 657dd2e6c93c02f46b10dfd43fb6e9b38c025ece (patch) | |
| tree | c23a093382d5ffd0d39dd69b68fb24050daa7f3e /weed/topology/topology.go | |
| parent | b92122b885c8fba189f3c503c17478008806fda7 (diff) | |
| download | seaweedfs-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.go | 7 |
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 { |
