diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-10-09 07:28:35 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-10-09 07:28:35 +0000 |
commit | 1a0a3eaa93d3cb0df3ee527f0a861891d3a38541 (patch) | |
tree | e3420db8ae8b5d6914b383915e1de429d02a1fae /searchlib | |
parent | 62cf056fb15b5f77686a297f362dba2b21648074 (diff) |
Explicit destructor.
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/compacter.cpp | 2 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/docstore/compacter.h | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/searchlib/src/vespa/searchlib/docstore/compacter.cpp b/searchlib/src/vespa/searchlib/docstore/compacter.cpp index 6caafe42040..0bf91b7616c 100644 --- a/searchlib/src/vespa/searchlib/docstore/compacter.cpp +++ b/searchlib/src/vespa/searchlib/docstore/compacter.cpp @@ -41,6 +41,8 @@ BucketCompacter::BucketCompacter(size_t maxSignificantBucketBits, CompressionCon } } +BucketCompacter::~BucketCompacter() = default; + FileChunk::FileId BucketCompacter::getDestinationId(const LockGuard & guard) const { return (_destinationFileId.isActive()) ? _ds.getActiveFileId(guard) : _destinationFileId; diff --git a/searchlib/src/vespa/searchlib/docstore/compacter.h b/searchlib/src/vespa/searchlib/docstore/compacter.h index 1eb3fda78a6..2db6bc73139 100644 --- a/searchlib/src/vespa/searchlib/docstore/compacter.h +++ b/searchlib/src/vespa/searchlib/docstore/compacter.h @@ -16,10 +16,9 @@ namespace search::docstore { class Compacter : public IWriteData { public: - Compacter(LogDataStore & ds) : _ds(ds) { } + explicit Compacter(LogDataStore & ds) : _ds(ds) { } void write(LockGuard guard, uint32_t chunkId, uint32_t lid, ConstBufferRef data) override; void close() override { } - private: LogDataStore & _ds; }; @@ -40,16 +39,17 @@ public: using FileId = FileChunk::FileId; BucketCompacter(size_t maxSignificantBucketBits, CompressionConfig compression, LogDataStore & ds, Executor & executor, const IBucketizer & bucketizer, FileId source, FileId destination); + ~BucketCompacter() override; void write(LockGuard guard, uint32_t chunkId, uint32_t lid, ConstBufferRef data) override; void write(BucketId bucketId, uint32_t chunkId, uint32_t lid, ConstBufferRef data) override; void store(const StoreByBucket::Index & index) override; + void close() override; + size_t getBucketCount() const noexcept; +private: size_t toPartitionId(BucketId bucketId) const noexcept { uint64_t sortableBucketId = bucketId.toKey(); return (sortableBucketId >> _unSignificantBucketBits) % _tmpStore.size(); } - void close() override; -private: - size_t getBucketCount() const noexcept; static constexpr size_t NUM_PARTITIONS = 256; using GenerationHandler = vespalib::GenerationHandler; using Partitions = std::array<std::unique_ptr<StoreByBucket>, NUM_PARTITIONS>; |