aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_common.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-09-12 04:06:26 -0700
committerChris Lu <chris.lu@gmail.com>2020-09-12 04:06:26 -0700
commitd15682b4a18fdc0f94757a8d88f4be2d2a6c7b12 (patch)
tree7ab9517251ed8d7bca8bbaa348eb122b9ac0fe9f /weed/shell/command_ec_common.go
parentc0ee78d2fa4c77631bec5656a2548e2c1fea923d (diff)
downloadseaweedfs-d15682b4a18fdc0f94757a8d88f4be2d2a6c7b12.tar.xz
seaweedfs-d15682b4a18fdc0f94757a8d88f4be2d2a6c7b12.zip
shell: volume.balance plan by ratio of fullness
Diffstat (limited to 'weed/shell/command_ec_common.go')
-rw-r--r--weed/shell/command_ec_common.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/shell/command_ec_common.go b/weed/shell/command_ec_common.go
index 0db119d3c..c6c7a1260 100644
--- a/weed/shell/command_ec_common.go
+++ b/weed/shell/command_ec_common.go
@@ -253,6 +253,10 @@ func mountEcShards(grpcDialOption grpc.DialOption, collection string, volumeId n
})
}
+func divide(total, n int) float64 {
+ return float64(total) / float64(n)
+}
+
func ceilDivide(total, n int) int {
return int(math.Ceil(float64(total) / float64(n)))
}