only copy required shards

This commit is contained in:
Chris Lu
2019-12-23 18:06:13 -08:00
parent c7d5a0b00c
commit a18f62bbe7
2 changed files with 8 additions and 1 deletions

View File

@@ -104,3 +104,10 @@ func (b ShardBits) Minus(other ShardBits) ShardBits {
func (b ShardBits) Plus(other ShardBits) ShardBits {
return b | other
}
func (b ShardBits) MinusParityShards() ShardBits {
for i := DataShardsCount; i < TotalShardsCount; i++ {
b = b.RemoveShardId(ShardId(i))
}
return b
}