pb shard info uses ShardBits instead one message for one shard

This commit is contained in:
Chris Lu
2019-05-24 13:28:44 -07:00
parent 228850d588
commit 6f4b09b6a4
9 changed files with 175 additions and 155 deletions

View File

@@ -4,6 +4,8 @@ import (
"context"
"fmt"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
"io"
"sort"
)
@@ -89,7 +91,7 @@ func writeDataNodeInfo(writer io.Writer, t *master_pb.DataNodeInfo) statistics {
s = s.plus(writeVolumeInformationMessage(writer, vi))
}
for _, ecShardInfo := range t.EcShardInfos {
fmt.Fprintf(writer, " ec %+v \n", ecShardInfo)
fmt.Fprintf(writer, " ec volume id:%v collection:%v shards:%v\n", ecShardInfo.Id, ecShardInfo.Collection, erasure_coding.ShardBits(ecShardInfo.EcIndexBits).ShardIds())
}
fmt.Fprintf(writer, " DataNode %s %+v \n", t.Id, s)
return s