Browse Source

refactor

pull/3950/head
Konstantin Lebedev 2 years ago
parent
commit
3c09acdd24
  1. 6
      weed/storage/erasure_coding/ec_volume.go

6
weed/storage/erasure_coding/ec_volume.go

@ -211,14 +211,14 @@ func (ev *EcVolume) LocateEcShardNeedle(needleId types.NeedleId, version needle.
return types.Offset{}, 0, nil, fmt.Errorf("FindNeedleFromEcx: %v", err) return types.Offset{}, 0, nil, fmt.Errorf("FindNeedleFromEcx: %v", err)
} }
intervals = ev.LocateEcShardNeedleInterval(version, offset.ToActualOffset(), size)
intervals = ev.LocateEcShardNeedleInterval(offset.ToActualOffset(), types.Size(needle.GetActualSize(size, version)))
return return
} }
func (ev *EcVolume) LocateEcShardNeedleInterval(version needle.Version, offset int64, size types.Size) (intervals []Interval) {
func (ev *EcVolume) LocateEcShardNeedleInterval(actualOffset int64, actualSize types.Size) (intervals []Interval) {
shard := ev.Shards[0] shard := ev.Shards[0]
// calculate the locations in the ec shards // calculate the locations in the ec shards
intervals = LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shard.ecdFileSize, offset, types.Size(needle.GetActualSize(size, version)))
intervals = LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shard.ecdFileSize, actualOffset, actualSize)
return return
} }

Loading…
Cancel
Save