aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/docstore/logdatastore.h
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/vespa/searchlib/docstore/logdatastore.h')
-rw-r--r--searchlib/src/vespa/searchlib/docstore/logdatastore.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/logdatastore.h b/searchlib/src/vespa/searchlib/docstore/logdatastore.h
index 3289ceb19ba..ef2cbf93215 100644
--- a/searchlib/src/vespa/searchlib/docstore/logdatastore.h
+++ b/searchlib/src/vespa/searchlib/docstore/logdatastore.h
@@ -227,16 +227,12 @@ private:
size_t computeNumberOfSignificantBucketIdBits(const IBucketizer & bucketizer, FileId fileId) const;
- /*
- * Protect against compactWorst() dropping file chunk. Caller must hold
- * _updateLock.
- */
- std::unique_ptr<FileChunkHolder> holdFileChunk(FileId fileId);
+ /// Protect against compactWorst() dropping file chunk. Caller must hold _updateLock.
+ std::unique_ptr<FileChunkHolder> holdFileChunk(const MonitorGuard & guard, FileId fileId);
- /*
- * Drop protection against compactWorst() dropping file chunk.
- */
+ /// Drop protection against compactWorst() dropping file chunk.
void unholdFileChunk(FileId fileId);
+ bool canFileChunkBeDropped(const MonitorGuard & guard, FileId fileId) const;
SerialNum flushFile(MonitorGuard guard, WriteableFileChunk & file, SerialNum syncToken,
vespalib::CpuUsage::Category cpu_category);
@@ -258,7 +254,7 @@ private:
mutable vespalib::GenerationHandler _genHandler;
LidInfoVector _lidInfo;
FileChunkVector _fileChunks;
- std::vector<uint32_t> _holdFileChunks;
+ vespalib::hash_map<uint32_t, uint32_t> _holdFileChunks;
FileId _active;
FileId _prevActive;
mutable std::mutex _updateLock;