ec encode distribute ec data and parity shards evenly

This commit is contained in:
Chris Lu
2019-12-24 16:52:21 -08:00
parent 9ff72f616a
commit 3ebeae0c0b
3 changed files with 36 additions and 27 deletions

View File

@@ -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{