mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 22:08:52 +08:00
collection list normal and ec volumes
This commit is contained in:
@@ -24,7 +24,7 @@ func (c *commandCollectionList) Help() string {
|
||||
|
||||
func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
|
||||
|
||||
collections, err := ListCollectionNames(commandEnv)
|
||||
collections, err := ListCollectionNames(commandEnv, true, true)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -39,11 +39,14 @@ func (c *commandCollectionList) Do(args []string, commandEnv *commandEnv, writer
|
||||
return nil
|
||||
}
|
||||
|
||||
func ListCollectionNames(commandEnv *commandEnv) (collections []string, err error) {
|
||||
func ListCollectionNames(commandEnv *commandEnv, includeNormalVolumes, includeEcVolumes bool) (collections []string, err error) {
|
||||
var resp *master_pb.CollectionListResponse
|
||||
ctx := context.Background()
|
||||
err = commandEnv.masterClient.WithClient(ctx, func(client master_pb.SeaweedClient) error {
|
||||
resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{})
|
||||
resp, err = client.CollectionList(ctx, &master_pb.CollectionListRequest{
|
||||
IncludeNormalVolumes: includeNormalVolumes,
|
||||
IncludeEcVolumes: includeEcVolumes,
|
||||
})
|
||||
return err
|
||||
})
|
||||
if err != nil {
|
||||
|
@@ -83,7 +83,7 @@ func (c *commandEcBalance) Do(args []string, commandEnv *commandEnv, writer io.W
|
||||
}
|
||||
|
||||
if *collection == "EACH_COLLECTION" {
|
||||
collections, err := ListCollectionNames(commandEnv)
|
||||
collections, err := ListCollectionNames(commandEnv, false, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ func (c *commandVolumeBalance) Do(args []string, commandEnv *commandEnv, writer
|
||||
continue
|
||||
}
|
||||
if *collection == "EACH_COLLECTION" {
|
||||
collections, err := ListCollectionNames(commandEnv)
|
||||
collections, err := ListCollectionNames(commandEnv, true, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user