no errors, but not returning file content
* the interval needs to use actual file zie
* need to read the actual version instead of the current version
This commit is contained in:
Chris Lu
2019-05-28 00:51:01 -07:00
parent 2858a954b3
commit 4f76342cbc
3 changed files with 24 additions and 15 deletions

View File

@@ -41,6 +41,8 @@ func NewEcVolume(dir string, collection string, vid needle.VolumeId) (ev *EcVolu
}
ev.ecxFileSize = ecxFi.Size()
ev.ShardLocations = make(map[ShardId][]string)
return
}
@@ -51,7 +53,7 @@ func (ev *EcVolume) AddEcVolumeShard(ecVolumeShard *EcVolumeShard) bool {
}
}
ev.Shards = append(ev.Shards, ecVolumeShard)
sort.Slice(ev, func(i, j int) bool {
sort.Slice(ev.Shards, func(i, j int) bool {
return ev.Shards[i].VolumeId < ev.Shards[j].VolumeId ||
ev.Shards[i].VolumeId == ev.Shards[j].VolumeId && ev.Shards[i].ShardId < ev.Shards[j].ShardId
})