summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2022-10-06 16:25:04 +0200
committerTor Egge <Tor.Egge@online.no>2022-10-06 16:25:04 +0200
commit57f1c470a55e5ce30ce96932c97bac123d8ca689 (patch)
tree5688aca92d2a2848eaf46efb779aece539c8a2c3 /vespalib
parent4608993c27911a304071df04989b741b0a403694 (diff)
Remove unused DataStoreBase::startCompactWorstBuffer() member functions.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/datastore/datastorebase.cpp37
-rw-r--r--vespalib/src/vespa/vespalib/datastore/datastorebase.h3
2 files changed, 0 insertions, 40 deletions
diff --git a/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp b/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp
index a67fceec1b5..fbf19972f80 100644
--- a/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp
+++ b/vespalib/src/vespa/vespalib/datastore/datastorebase.cpp
@@ -458,43 +458,6 @@ DataStoreBase::fallbackResize(uint32_t bufferId, size_t elemsNeeded)
}
}
-uint32_t
-DataStoreBase::startCompactWorstBuffer(uint32_t typeId)
-{
- uint32_t buffer_id = get_primary_buffer_id(typeId);
- const BufferTypeBase *typeHandler = _typeHandlers[typeId];
- assert(typeHandler->get_active_buffers_count() >= 1u);
- if (typeHandler->get_active_buffers_count() == 1u) {
- // Single active buffer for type, no need for scan
- markCompacting(buffer_id);
- return buffer_id;
- }
- // Multiple active buffers for type, must perform full scan
- return startCompactWorstBuffer(buffer_id,
- [=](const BufferState &state) { return state.isActive(typeId); });
-}
-
-template <typename BufferStateActiveFilter>
-uint32_t
-DataStoreBase::startCompactWorstBuffer(uint32_t initWorstBufferId, BufferStateActiveFilter &&filterFunc)
-{
- uint32_t worstBufferId = initWorstBufferId;
- size_t worstDeadElems = 0;
- for (uint32_t bufferId = 0; bufferId < _numBuffers; ++bufferId) {
- const auto &state = getBufferState(bufferId);
- if (filterFunc(state)) {
- assert(!state.getCompacting());
- size_t deadElems = state.getDeadElems() - state.getTypeHandler()->getReservedElements(bufferId);
- if (deadElems > worstDeadElems) {
- worstBufferId = bufferId;
- worstDeadElems = deadElems;
- }
- }
- }
- markCompacting(worstBufferId);
- return worstBufferId;
-}
-
void
DataStoreBase::markCompacting(uint32_t bufferId)
{
diff --git a/vespalib/src/vespa/vespalib/datastore/datastorebase.h b/vespalib/src/vespa/vespalib/datastore/datastorebase.h
index bbd0ced123c..8351527f9a2 100644
--- a/vespalib/src/vespa/vespalib/datastore/datastorebase.h
+++ b/vespalib/src/vespa/vespalib/datastore/datastorebase.h
@@ -200,8 +200,6 @@ protected:
virtual void clearElemHoldList() = 0;
- template <typename BufferStateActiveFilter>
- uint32_t startCompactWorstBuffer(uint32_t initWorstBufferId, BufferStateActiveFilter &&filterFunc);
void markCompacting(uint32_t bufferId);
public:
uint32_t addType(BufferTypeBase *typeHandler);
@@ -376,7 +374,6 @@ public:
return self._genHolder;
}
- uint32_t startCompactWorstBuffer(uint32_t typeId);
std::unique_ptr<CompactingBuffers> start_compact_worst_buffers(CompactionSpec compaction_spec, const CompactionStrategy &compaction_strategy);
uint64_t get_compaction_count() const { return _compaction_count.load(std::memory_order_relaxed); }
void inc_compaction_count() const { ++_compaction_count; }