aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_ec_test.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-12-24 16:52:21 -0800
committerChris Lu <chris.lu@gmail.com>2019-12-24 16:52:21 -0800
commit3ebeae0c0ba94659bb39e055ae0278db5bb825f1 (patch)
tree60e4e88c6a00a388721d8b0609136cd730a91408 /weed/shell/command_ec_test.go
parent9ff72f616a488dce97bf26f118531595c5b74600 (diff)
downloadseaweedfs-3ebeae0c0ba94659bb39e055ae0278db5bb825f1.tar.xz
seaweedfs-3ebeae0c0ba94659bb39e055ae0278db5bb825f1.zip
ec encode distribute ec data and parity shards evenly
Diffstat (limited to 'weed/shell/command_ec_test.go')
-rw-r--r--weed/shell/command_ec_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/shell/command_ec_test.go b/weed/shell/command_ec_test.go
index 9e578ed28..c233d25d0 100644
--- a/weed/shell/command_ec_test.go
+++ b/weed/shell/command_ec_test.go
@@ -2,12 +2,25 @@ package shell
import (
"context"
+ "fmt"
"testing"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
)
+func TestCommandEcDistribution(t *testing.T) {
+
+ allEcNodes := []*EcNode{
+ newEcNode("dc1", "rack1", "dn1", 100),
+ newEcNode("dc1", "rack2", "dn2", 100),
+ }
+
+ allocated := balancedEcDistribution(allEcNodes)
+
+ fmt.Printf("allocated: %+v", allocated)
+}
+
func TestCommandEcBalanceSmall(t *testing.T) {
allEcNodes := []*EcNode{