mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 12:57:57 +08:00
working with reading remote intervals
This commit is contained in:
@@ -111,7 +111,7 @@ func (ev *EcVolume) ToVolumeEcShardInformationMessage() (messages []*master_pb.V
|
||||
return
|
||||
}
|
||||
|
||||
func (ev *EcVolume) LocateEcShardNeedle(n *needle.Needle) (offset types.Offset, size uint32, intervals []Interval, err error) {
|
||||
func (ev *EcVolume) LocateEcShardNeedle(n *needle.Needle, version needle.Version) (offset types.Offset, size uint32, intervals []Interval, err error) {
|
||||
|
||||
// find the needle from ecx file
|
||||
offset, size, err = ev.findNeedleFromEcx(n.Id)
|
||||
@@ -122,7 +122,7 @@ func (ev *EcVolume) LocateEcShardNeedle(n *needle.Needle) (offset types.Offset,
|
||||
shard := ev.Shards[0]
|
||||
|
||||
// calculate the locations in the ec shards
|
||||
intervals = LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shard.ecdFileSize, offset.ToAcutalOffset(), size)
|
||||
intervals = LocateData(ErasureCodingLargeBlockSize, ErasureCodingSmallBlockSize, DataShardsCount*shard.ecdFileSize, offset.ToAcutalOffset(), uint32(needle.GetActualSize(size, version)))
|
||||
|
||||
return
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ func (ecInfo *EcVolumeInfo) ShardIdCount() (count int) {
|
||||
return ecInfo.ShardBits.ShardIdCount()
|
||||
}
|
||||
|
||||
func (ecInfo *EcVolumeInfo) Minus(other *EcVolumeInfo) (*EcVolumeInfo) {
|
||||
func (ecInfo *EcVolumeInfo) Minus(other *EcVolumeInfo) *EcVolumeInfo {
|
||||
ret := &EcVolumeInfo{
|
||||
VolumeId: ecInfo.VolumeId,
|
||||
Collection: ecInfo.Collection,
|
||||
@@ -88,10 +88,10 @@ func (b ShardBits) ShardIdCount() (count int) {
|
||||
return
|
||||
}
|
||||
|
||||
func (b ShardBits) Minus(other ShardBits) (ShardBits) {
|
||||
func (b ShardBits) Minus(other ShardBits) ShardBits {
|
||||
return b &^ other
|
||||
}
|
||||
|
||||
func (b ShardBits) Plus(other ShardBits) (ShardBits) {
|
||||
func (b ShardBits) Plus(other ShardBits) ShardBits {
|
||||
return b | other
|
||||
}
|
||||
|
Reference in New Issue
Block a user