summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-04-12 12:11:07 +0200
committerTor Egge <Tor.Egge@online.no>2021-04-12 12:14:58 +0200
commit5a32a27ea88e38a1d21322805220af8eaab9c285 (patch)
tree7db047ab2ccd8fa3a324268ba0cdbe718feb86db /searchlib
parent32db7b3891c9b0b39af89a3764e14809683f431c (diff)
Adjust member function names to reflect what is being compacted.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstore.h4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumstore.hpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/i_enum_store.h4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp16
-rw-r--r--searchlib/src/vespa/searchlib/attribute/reference_attribute.h4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp2
7 files changed, 19 insertions, 19 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.h b/searchlib/src/vespa/searchlib/attribute/enumstore.h
index 4f5454c15b2..fc4390dfc76 100644
--- a/searchlib/src/vespa/searchlib/attribute/enumstore.h
+++ b/searchlib/src/vespa/searchlib/attribute/enumstore.h
@@ -199,8 +199,8 @@ public:
void free_unused_values() override;
void free_unused_values(const IndexSet& to_remove);
vespalib::MemoryUsage update_stat() override;
- std::unique_ptr<EnumIndexRemapper> consider_compact(const CompactionStrategy& compaction_strategy) override;
- std::unique_ptr<EnumIndexRemapper> compact_worst(bool compact_memory, bool compact_address_space) override;
+ std::unique_ptr<EnumIndexRemapper> consider_compact_values(const CompactionStrategy& compaction_strategy) override;
+ std::unique_ptr<EnumIndexRemapper> compact_worst_values(bool compact_memory, bool compact_address_space) override;
uint64_t get_compaction_count() const override {
return _store.get_data_store().get_compaction_count();
}
diff --git a/searchlib/src/vespa/searchlib/attribute/enumstore.hpp b/searchlib/src/vespa/searchlib/attribute/enumstore.hpp
index 99d9a7fdfee..6e4c4f869c8 100644
--- a/searchlib/src/vespa/searchlib/attribute/enumstore.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/enumstore.hpp
@@ -221,7 +221,7 @@ EnumStoreT<EntryT>::update_stat()
template <typename EntryT>
std::unique_ptr<IEnumStore::EnumIndexRemapper>
-EnumStoreT<EntryT>::consider_compact(const CompactionStrategy& compaction_strategy)
+EnumStoreT<EntryT>::consider_compact_values(const CompactionStrategy& compaction_strategy)
{
size_t used_bytes = _cached_values_memory_usage.usedBytes();
size_t dead_bytes = _cached_values_memory_usage.deadBytes();
@@ -230,14 +230,14 @@ EnumStoreT<EntryT>::consider_compact(const CompactionStrategy& compaction_strate
bool compact_memory = compaction_strategy.should_compact_memory(used_bytes, dead_bytes);
bool compact_address_space = compaction_strategy.should_compact_address_space(used_address_space, dead_address_space);
if (compact_memory || compact_address_space) {
- return compact_worst(compact_memory, compact_address_space);
+ return compact_worst_values(compact_memory, compact_address_space);
}
return std::unique_ptr<IEnumStore::EnumIndexRemapper>();
}
template <typename EntryT>
std::unique_ptr<IEnumStore::EnumIndexRemapper>
-EnumStoreT<EntryT>::compact_worst(bool compact_memory, bool compact_address_space)
+EnumStoreT<EntryT>::compact_worst_values(bool compact_memory, bool compact_address_space)
{
return _store.compact_worst(compact_memory, compact_address_space);
}
diff --git a/searchlib/src/vespa/searchlib/attribute/i_enum_store.h b/searchlib/src/vespa/searchlib/attribute/i_enum_store.h
index 55cd4f88c25..b439315e4a4 100644
--- a/searchlib/src/vespa/searchlib/attribute/i_enum_store.h
+++ b/searchlib/src/vespa/searchlib/attribute/i_enum_store.h
@@ -64,8 +64,8 @@ public:
virtual vespalib::MemoryUsage get_values_memory_usage() const = 0;
virtual vespalib::MemoryUsage get_dictionary_memory_usage() const = 0;
virtual vespalib::MemoryUsage update_stat() = 0;
- virtual std::unique_ptr<EnumIndexRemapper> consider_compact(const CompactionStrategy& compaction_strategy) = 0;
- virtual std::unique_ptr<EnumIndexRemapper> compact_worst(bool compact_memory, bool compact_address_space) = 0;
+ virtual std::unique_ptr<EnumIndexRemapper> consider_compact_values(const CompactionStrategy& compaction_strategy) = 0;
+ virtual std::unique_ptr<EnumIndexRemapper> compact_worst_values(bool compact_memory, bool compact_address_space) = 0;
virtual uint64_t get_compaction_count() const = 0;
// Should only be used by unit tests.
virtual void inc_compaction_count() = 0;
diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp
index d320ecfaa85..c38f8047107 100644
--- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.hpp
@@ -175,7 +175,7 @@ MultiValueEnumAttribute<B, M>::onCommit()
this->incGeneration();
this->updateStat(true);
}
- auto remapper = this->_enumStore.consider_compact(this->getConfig().getCompactionStrategy());
+ auto remapper = this->_enumStore.consider_compact_values(this->getConfig().getCompactionStrategy());
if (remapper) {
multienumattribute::remap_enum_store_refs(*remapper, *this, this->_mvMapping);
remapper->done();
diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
index f9faed34d90..de68305b7ba 100644
--- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.cpp
@@ -177,7 +177,7 @@ ReferenceAttribute::onCommit()
{
// Note: Cost can be reduced if unneeded generation increments are dropped
incGeneration();
- if (considerCompact(getConfig().getCompactionStrategy())) {
+ if (consider_compact_values(getConfig().getCompactionStrategy())) {
incGeneration();
updateStat(true);
}
@@ -282,20 +282,20 @@ ReferenceAttribute::getReference(DocId doc) const
}
bool
-ReferenceAttribute::considerCompact(const CompactionStrategy &compactionStrategy)
+ReferenceAttribute::consider_compact_values(const CompactionStrategy &compactionStrategy)
{
- size_t usedBytes = _cached_unique_store_values_memory_usage.usedBytes();
- size_t deadBytes = _cached_unique_store_values_memory_usage.deadBytes();
- bool compactMemory = compactionStrategy.should_compact_memory(usedBytes, deadBytes);
- if (compactMemory) {
- compactWorst();
+ size_t used_bytes = _cached_unique_store_values_memory_usage.usedBytes();
+ size_t dead_bytes = _cached_unique_store_values_memory_usage.deadBytes();
+ bool compact_memory = compactionStrategy.should_compact_memory(used_bytes, dead_bytes);
+ if (compact_memory) {
+ compact_worst_values();
return true;
}
return false;
}
void
-ReferenceAttribute::compactWorst()
+ReferenceAttribute::compact_worst_values()
{
auto remapper(_store.compact_worst(true, true));
if (remapper) {
diff --git a/searchlib/src/vespa/searchlib/attribute/reference_attribute.h b/searchlib/src/vespa/searchlib/attribute/reference_attribute.h
index 892966b16c7..a69e70955b6 100644
--- a/searchlib/src/vespa/searchlib/attribute/reference_attribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/reference_attribute.h
@@ -55,8 +55,8 @@ private:
bool onLoad() override;
uint64_t getUniqueValueCount() const override;
- bool considerCompact(const CompactionStrategy &compactionStrategy);
- void compactWorst();
+ bool consider_compact_values(const CompactionStrategy &compactionStrategy);
+ void compact_worst_values();
IndicesCopyVector getIndicesCopy(uint32_t size) const;
void removeReverseMapping(EntryRef oldRef, uint32_t lid);
void addReverseMapping(EntryRef newRef, uint32_t lid);
diff --git a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp
index 96dda48c043..05cceda9a60 100644
--- a/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/singleenumattribute.hpp
@@ -94,7 +94,7 @@ SingleValueEnumAttribute<B>::onCommit()
freezeEnumDictionary();
std::atomic_thread_fence(std::memory_order_release);
this->removeAllOldGenerations();
- auto remapper = this->_enumStore.consider_compact(this->getConfig().getCompactionStrategy());
+ auto remapper = this->_enumStore.consider_compact_values(this->getConfig().getCompactionStrategy());
if (remapper) {
remap_enum_store_refs(*remapper, *this);
remapper->done();