Merge branch 'master' into messaging
This commit is contained in:
@@ -45,7 +45,7 @@ func (c *commandFsDu) Do(args []string, commandEnv *CommandEnv, writer io.Writer
|
||||
blockCount, byteCount, err = duTraverseDirectory(writer, commandEnv, dir, name)
|
||||
|
||||
if name == "" && err == nil {
|
||||
fmt.Fprintf(writer, "block:%4d\tbyte:%10d\t%s\n", blockCount, byteCount, dir)
|
||||
fmt.Fprintf(writer, "block:%4d\tlogical size:%10d\t%s\n", blockCount, byteCount, dir)
|
||||
}
|
||||
|
||||
return
|
||||
@@ -76,7 +76,7 @@ func duTraverseDirectory(writer io.Writer, filerClient filer_pb.FilerClient, dir
|
||||
}
|
||||
|
||||
if name != "" && !entry.IsDirectory {
|
||||
fmt.Fprintf(writer, "block:%4d\tbyte:%10d\t%s/%s\n", fileBlockCount, fileByteCount, dir, entry.Name)
|
||||
fmt.Fprintf(writer, "block:%4d\tlogical size:%10d\t%s/%s\n", fileBlockCount, fileByteCount, dir, entry.Name)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
@@ -4,8 +4,9 @@ import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||
"io"
|
||||
|
||||
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -23,7 +24,7 @@ func (c *commandS3BucketQuota) Help() string {
|
||||
return `set/remove/enable/disable quota for a bucket
|
||||
|
||||
Example:
|
||||
s3.bucket.quota -name=<bucket_name> -operation=set -sizeMB=1024
|
||||
s3.bucket.quota -name=<bucket_name> -op=set -sizeMB=1024
|
||||
`
|
||||
}
|
||||
|
||||
@@ -31,7 +32,7 @@ func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer
|
||||
|
||||
bucketCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
|
||||
bucketName := bucketCommand.String("name", "", "bucket name")
|
||||
operationName := bucketCommand.String("op", "set", "operation name [set|remove|enable|disable]")
|
||||
operationName := bucketCommand.String("op", "set", "operation name [set|get|remove|enable|disable]")
|
||||
sizeMB := bucketCommand.Int64("sizeMB", 0, "bucket quota size in MiB")
|
||||
if err = bucketCommand.Parse(args); err != nil {
|
||||
return nil
|
||||
@@ -63,6 +64,9 @@ func (c *commandS3BucketQuota) Do(args []string, commandEnv *CommandEnv, writer
|
||||
switch *operationName {
|
||||
case "set":
|
||||
bucketEntry.Quota = *sizeMB * 1024 * 1024
|
||||
case "get":
|
||||
fmt.Fprintf(writer, "bucket quota: %dMiB \n", bucketEntry.Quota/1024/1024)
|
||||
return nil
|
||||
case "remove":
|
||||
bucketEntry.Quota = 0
|
||||
case "enable":
|
||||
|
||||
Reference in New Issue
Block a user