diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-12-23 18:06:13 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-12-23 18:06:13 -0800 |
| commit | a18f62bbe7e5e477fd891849b44ec5a25d8988d2 (patch) | |
| tree | fe3486dd2482bbdd5d7504f6b8404db875bd8b7a /weed/storage/erasure_coding/ec_volume_info.go | |
| parent | c7d5a0b00cd69f719a46ee3692f123c8deac1e20 (diff) | |
| download | seaweedfs-a18f62bbe7e5e477fd891849b44ec5a25d8988d2.tar.xz seaweedfs-a18f62bbe7e5e477fd891849b44ec5a25d8988d2.zip | |
only copy required shards
Diffstat (limited to 'weed/storage/erasure_coding/ec_volume_info.go')
| -rw-r--r-- | weed/storage/erasure_coding/ec_volume_info.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/storage/erasure_coding/ec_volume_info.go b/weed/storage/erasure_coding/ec_volume_info.go index bb1fd0bf8..8ff65bb0f 100644 --- a/weed/storage/erasure_coding/ec_volume_info.go +++ b/weed/storage/erasure_coding/ec_volume_info.go @@ -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 +} |
