refactor filer_pb.Entry and filer.Entry to use GetChunks()

for later locking on reading chunks
This commit is contained in:
chrislu
2022-11-15 06:33:36 -08:00
parent 371972a1c2
commit 70a4c98b00
56 changed files with 107 additions and 103 deletions

View File

@@ -94,7 +94,7 @@ func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) {
}
// pick out-of-order chunks from existing chunks
for _, chunk := range fh.entry.Chunks {
for _, chunk := range fh.entry.GetChunks() {
if lessThan(earliestChunk, chunk) {
chunks = append(chunks, chunk)
}
@@ -105,9 +105,9 @@ func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) {
return lessThan(a, b)
})
glog.V(4).Infof("%s existing %d chunks adds %d more", fh.FullPath(), len(fh.entry.Chunks), len(chunks))
glog.V(4).Infof("%s existing %d chunks adds %d more", fh.FullPath(), len(fh.entry.GetChunks()), len(chunks))
fh.entry.Chunks = append(fh.entry.Chunks, newChunks...)
fh.entry.Chunks = append(fh.entry.GetChunks(), newChunks...)
fh.entryViewCache = nil
}