aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-04 13:48:00 -0700
committerchrislu <chris.lu@gmail.com>2022-07-04 13:48:00 -0700
commitcc51c7582f1bcdb1c3f5f7099f2676ddf19a2b22 (patch)
tree2cb8b5a9c6a2f82fa511c29d708c1edaf7ca55c2 /weed
parentc1eb4b2c9f1e88e84e9df39c224a171ad9b22462 (diff)
parent57975b93ff463e71b20aed8feb1e669ee0f72780 (diff)
downloadseaweedfs-cc51c7582f1bcdb1c3f5f7099f2676ddf19a2b22.tar.xz
seaweedfs-cc51c7582f1bcdb1c3f5f7099f2676ddf19a2b22.zip
Merge branch 'master' into messaging
Diffstat (limited to 'weed')
-rw-r--r--weed/shell/command_fs_du.go4
-rw-r--r--weed/shell/command_s3_bucket_quota.go10
-rw-r--r--weed/topology/volume_location_list.go3
-rw-r--r--weed/util/constants.go2
4 files changed, 12 insertions, 7 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go
index 71003714d..a9d704f37 100644
--- a/weed/shell/command_fs_du.go
+++ b/weed/shell/command_fs_du.go
@@ -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
})
diff --git a/weed/shell/command_s3_bucket_quota.go b/weed/shell/command_s3_bucket_quota.go
index 17be1d5b0..b7dbe416a 100644
--- a/weed/shell/command_s3_bucket_quota.go
+++ b/weed/shell/command_s3_bucket_quota.go
@@ -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":
diff --git a/weed/topology/volume_location_list.go b/weed/topology/volume_location_list.go
index 03580ae5b..00bd8d199 100644
--- a/weed/topology/volume_location_list.go
+++ b/weed/topology/volume_location_list.go
@@ -82,12 +82,13 @@ func (dnll *VolumeLocationList) Refresh(freshThreshHold int64) {
}
}
+// Stats returns logic size and count
func (dnll *VolumeLocationList) Stats(vid needle.VolumeId, freshThreshHold int64) (size uint64, fileCount int) {
for _, dnl := range dnll.list {
if dnl.LastSeen < freshThreshHold {
vinfo, err := dnl.GetVolumesById(vid)
if err == nil {
- return (vinfo.Size - vinfo.DeletedByteCount) * uint64(len(dnll.list)), vinfo.FileCount - vinfo.DeleteCount
+ return (vinfo.Size - vinfo.DeletedByteCount), vinfo.FileCount - vinfo.DeleteCount
}
}
}
diff --git a/weed/util/constants.go b/weed/util/constants.go
index ce8757ce9..7448fad62 100644
--- a/weed/util/constants.go
+++ b/weed/util/constants.go
@@ -5,7 +5,7 @@ import (
)
var (
- VERSION_NUMBER = fmt.Sprintf("%.02f", 3.13)
+ VERSION_NUMBER = fmt.Sprintf("%.02f", 3.14)
VERSION = sizeLimit + " " + VERSION_NUMBER
COMMIT = ""
)