summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-09-19 08:26:37 +0200
committerGitHub <noreply@github.com>2018-09-19 08:26:37 +0200
commit7e4fe0287e4f09be481b19bcf5fdd24324894711 (patch)
tree374d4d842969a5a67c082e98bd9020d234b5eb71 /searchlib
parent80a159536b3f312f47d482dbb4e916126446e93e (diff)
parent7ee198443e90c9793570e388710221bdd2a41e57 (diff)
Merge pull request #6984 from vespa-engine/balder/increase-interval-from-1s-to-5s
GC unused code and add override and = default.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attrvector.h6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attrvector.hpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/enumattribute.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h14
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp13
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp10
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h9
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multienumattribute.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multivalueattribute.h2
-rw-r--r--searchlib/src/vespa/searchlib/datastore/array_store.hpp5
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastorebase.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/datastore/datastorebase.h8
14 files changed, 29 insertions, 56 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
index d0886c25898..fbf752d3893 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
@@ -138,12 +138,11 @@ void AttributeVector::updateStat(bool force) {
onUpdateStat();
} else if (_nextStatUpdateTime < fastos::ClockSystem::now()) {
onUpdateStat();
- _nextStatUpdateTime = fastos::ClockSystem::now() + fastos::TimeStamp::SEC;
+ _nextStatUpdateTime = fastos::ClockSystem::now() + 5ul * fastos::TimeStamp::SEC;
}
}
bool AttributeVector::hasEnum() const { return _hasEnum; }
-bool AttributeVector::hasEnum2Value() const { return false; }
uint32_t AttributeVector::getMaxValueCount() const { return _highestValueCount; }
bool
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.h b/searchlib/src/vespa/searchlib/attribute/attributevector.h
index 54a43bec09e..ab590f807bf 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.h
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.h
@@ -42,7 +42,6 @@ namespace search {
template <typename T> class ComponentGuard;
class AttributeReadGuard;
- class AttributeWriteGuard;
class AttributeSaver;
class EnumStoreBase;
class IAttributeSaveTarget;
@@ -405,7 +404,6 @@ public:
bool hasArrayType() const { return _config.collectionType().isArray(); }
bool hasEnum() const override final;
- virtual bool hasEnum2Value() const;
uint32_t getMaxValueCount() const override;
uint32_t getEnumMax() const { return _enumMax; }
diff --git a/searchlib/src/vespa/searchlib/attribute/attrvector.h b/searchlib/src/vespa/searchlib/attribute/attrvector.h
index c0530ee8368..eb6d2eebb84 100644
--- a/searchlib/src/vespa/searchlib/attribute/attrvector.h
+++ b/searchlib/src/vespa/searchlib/attribute/attrvector.h
@@ -42,7 +42,7 @@ protected:
typedef typename B::Config Config;
NumericDirectAttribute(const vespalib::string & baseFileName, const Config & c);
- ~NumericDirectAttribute();
+ ~NumericDirectAttribute() override;
bool findEnum(BaseType value, EnumHandle & e) const override;
void onCommit() override;
@@ -83,7 +83,6 @@ private:
uint32_t get(DocId doc, EnumHandle * e, uint32_t sz) const override { return getAllEnumHelper(doc, e, sz); }
uint32_t getValueCount(DocId doc) const override { return getValueCountHelper(doc); }
- bool hasEnum2Value() const override { return false; }
uint32_t getValueCountHelper(DocId doc) const {
if (F::IsMultiValue()) {
@@ -145,7 +144,7 @@ private:
const char * getStringFromEnum(EnumHandle e) const override { return &_buffer[e]; }
protected:
StringDirectAttribute(const vespalib::string & baseFileName, const Config & c);
- ~StringDirectAttribute();
+ ~StringDirectAttribute() override;
bool findEnum(const char * value, EnumHandle & e) const override;
std::vector<EnumHandle> findFoldedEnums(const char *) const override;
void onCommit() override;
@@ -182,7 +181,6 @@ private:
uint32_t get(DocId doc, WeightedEnum * e, uint32_t sz) const override { return getAllEnumHelper(doc, e, sz); }
uint32_t get(DocId doc, WeightedString * v, uint32_t sz) const override { return getAllHelper(doc, v, sz); }
uint32_t get(DocId doc, WeightedConstChar * v, uint32_t sz) const override { return getAllHelper(doc, v, sz); }
- bool hasEnum2Value() const override { return true; }
uint32_t getValueCountHelper(DocId doc) const {
if (F::IsMultiValue()) {
diff --git a/searchlib/src/vespa/searchlib/attribute/attrvector.hpp b/searchlib/src/vespa/searchlib/attribute/attrvector.hpp
index 565801b1b0c..cdd34725e69 100644
--- a/searchlib/src/vespa/searchlib/attribute/attrvector.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/attrvector.hpp
@@ -18,7 +18,7 @@ NumericDirectAttribute(const vespalib::string & baseFileName, const Config & c)
}
template <typename B>
-NumericDirectAttribute<B>::~NumericDirectAttribute() {}
+NumericDirectAttribute<B>::~NumericDirectAttribute() = default;
template <typename B>
bool NumericDirectAttribute<B>::onLoad()
diff --git a/searchlib/src/vespa/searchlib/attribute/enumattribute.h b/searchlib/src/vespa/searchlib/attribute/enumattribute.h
index 993267f79a6..c79c9a7c2fb 100644
--- a/searchlib/src/vespa/searchlib/attribute/enumattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/enumattribute.h
@@ -73,9 +73,7 @@ protected:
void insertNewUniqueValues(EnumStoreBase::IndexVector & newIndexes);
virtual void considerAttributeChange(const Change & c, UniqueSet & newUniques) = 0;
virtual void reEnumerate() = 0;
- bool hasEnum2Value() const override { return true; }
AddressSpace getEnumStoreAddressSpaceUsage() const override;
-
public:
EnumAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & cfg);
~EnumAttribute();
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h
index 435fbb21923..dd88393a5e2 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.h
@@ -6,8 +6,7 @@
#include <vespa/searchlib/datastore/array_store.h>
#include <vespa/searchlib/common/address_space.h>
-namespace search {
-namespace attribute {
+namespace search::attribute {
/**
* Class for mapping from from document id to an array of values.
@@ -29,7 +28,7 @@ public:
MultiValueMapping & operator = (const MultiValueMapping &) = delete;
MultiValueMapping(const datastore::ArrayStoreConfig &storeCfg,
const GrowStrategy &gs = GrowStrategy());
- virtual ~MultiValueMapping();
+ ~MultiValueMapping() override;
ConstArrayRef get(uint32_t docId) const { return _store.get(_indices[docId]); }
ConstArrayRef getDataForIdx(EntryRef idx) const { return _store.get(idx); }
void set(uint32_t docId, ConstArrayRef values);
@@ -45,10 +44,10 @@ public:
void doneLoadFromMultiValue() { _store.setInitializing(false); }
- virtual void compactWorst(bool compactMemory, bool compactAddressSpace) override;
+ void compactWorst(bool compactMemory, bool compactAddressSpace) override;
- virtual AddressSpace getAddressSpaceUsage() const override;
- virtual MemoryUsage getArrayStoreMemoryUsage() const override;
+ AddressSpace getAddressSpaceUsage() const override;
+ MemoryUsage getArrayStoreMemoryUsage() const override;
static datastore::ArrayStoreConfig optimizedConfigForHugePage(size_t maxSmallArraySize,
size_t hugePageSize,
@@ -57,5 +56,4 @@ public:
float allocGrowFactor);
};
-} // namespace search::attribute
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp
index 83886619d0f..2395cb8b808 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping.hpp
@@ -6,8 +6,7 @@
#include <vespa/searchlib/datastore/array_store.hpp>
#include <vespa/searchlib/common/rcuvector.hpp>
-namespace search {
-namespace attribute {
+namespace search::attribute {
template <typename EntryT, typename RefT>
MultiValueMapping<EntryT,RefT>::MultiValueMapping(const datastore::ArrayStoreConfig &storeCfg, const GrowStrategy &gs)
@@ -17,9 +16,7 @@ MultiValueMapping<EntryT,RefT>::MultiValueMapping(const datastore::ArrayStoreCon
}
template <typename EntryT, typename RefT>
-MultiValueMapping<EntryT,RefT>::~MultiValueMapping()
-{
-}
+MultiValueMapping<EntryT,RefT>::~MultiValueMapping() = default;
template <typename EntryT, typename RefT>
void
@@ -52,8 +49,7 @@ MultiValueMapping<EntryT,RefT>::compactWorst(bool compactMemory, bool compactAdd
{
datastore::ICompactionContext::UP compactionContext(_store.compactWorst(compactMemory, compactAddressSpace));
if (compactionContext) {
- compactionContext->compact(vespalib::ArrayRef<EntryRef>(&_indices[0],
- _indices.size()));
+ compactionContext->compact(vespalib::ArrayRef<EntryRef>(&_indices[0], _indices.size()));
}
}
@@ -81,5 +77,4 @@ MultiValueMapping<EntryT, RefT>::optimizedConfigForHugePage(size_t maxSmallArray
return ArrayStore::optimizedConfigForHugePage(maxSmallArraySize, hugePageSize, smallPageSize, minNumArraysForNewBuffer, allocGrowFactor);
}
-} // namespace search::attribute
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp
index c3046b5ed7c..67257286a70 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.cpp
@@ -3,8 +3,7 @@
#include "multi_value_mapping_base.h"
#include <vespa/searchcommon/common/compaction_strategy.h>
-namespace search {
-namespace attribute {
+namespace search::attribute {
namespace {
@@ -23,9 +22,7 @@ MultiValueMappingBase::MultiValueMappingBase(const GrowStrategy &gs,
{
}
-MultiValueMappingBase::~MultiValueMappingBase()
-{
-}
+MultiValueMappingBase::~MultiValueMappingBase() = default;
MultiValueMappingBase::RefCopyVector
MultiValueMappingBase::getRefCopy(uint32_t size) const {
@@ -102,5 +99,4 @@ MultiValueMappingBase::considerCompact(const CompactionStrategy &compactionStrat
return false;
}
-} // namespace search::attribute
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h
index 5affd893d4d..faf16a8f624 100644
--- a/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h
+++ b/searchlib/src/vespa/searchlib/attribute/multi_value_mapping_base.h
@@ -7,11 +7,9 @@
#include <vespa/searchlib/common/address_space.h>
#include <functional>
-namespace search {
+namespace search { class CompactionStrategy; }
-class CompactionStrategy;
-
-namespace attribute {
+namespace search::attribute {
/**
* Base class for mapping from from document id to an array of values.
@@ -57,5 +55,4 @@ public:
bool considerCompact(const CompactionStrategy &compactionStrategy);
};
-} // namespace search::attribute
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/attribute/multienumattribute.h b/searchlib/src/vespa/searchlib/attribute/multienumattribute.h
index bcad27f046e..99f8d594976 100644
--- a/searchlib/src/vespa/searchlib/attribute/multienumattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multienumattribute.h
@@ -58,7 +58,7 @@ protected:
this->getEnumStore().freezeTree();
}
- virtual void fillValues(LoadedVector & loaded) override;
+ void fillValues(LoadedVector & loaded) override;
void fillEnumIdx(ReaderBase &attrReader, const EnumIndexVector &eidxs, LoadedEnumAttributeVector &loaded) override;
void fillEnumIdx(ReaderBase &attrReader, const EnumIndexVector &eidxs, EnumVector &enumHist) override;
virtual void mergeMemoryStats(MemoryUsage & total) { (void) total; }
diff --git a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h
index 4957e4b68cb..7ccde24aff3 100644
--- a/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multivalueattribute.h
@@ -53,7 +53,7 @@ protected:
public:
MultiValueAttribute(const vespalib::string & baseFileName, const AttributeVector::Config & cfg);
- virtual ~MultiValueAttribute();
+ ~MultiValueAttribute() override;
bool addDoc(DocId & doc) override;
uint32_t getValueCount(DocId doc) const override;
diff --git a/searchlib/src/vespa/searchlib/datastore/array_store.hpp b/searchlib/src/vespa/searchlib/datastore/array_store.hpp
index d76bd173d4a..14c6a43fe09 100644
--- a/searchlib/src/vespa/searchlib/datastore/array_store.hpp
+++ b/searchlib/src/vespa/searchlib/datastore/array_store.hpp
@@ -139,10 +139,10 @@ public:
_store(store),
_bufferIdsToCompact(std::move(bufferIdsToCompact))
{}
- virtual ~CompactionContext() {
+ ~CompactionContext() override {
_dataStore.finishCompact(_bufferIdsToCompact);
}
- virtual void compact(vespalib::ArrayRef<EntryRef> refs) override {
+ void compact(vespalib::ArrayRef<EntryRef> refs) override {
if (!_bufferIdsToCompact.empty()) {
for (auto &ref : refs) {
if (ref.valid()) {
@@ -202,4 +202,3 @@ ArrayStore<EntryT, RefT>::optimizedConfigForHugePage(size_t maxSmallArraySize,
}
}
-
diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp
index 68e7155505f..29621e79a59 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp
+++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.cpp
@@ -61,17 +61,14 @@ class DataStoreBase::BufferHold : public GenerationHeldBase
uint32_t _bufferId;
public:
- BufferHold(size_t size,
- DataStoreBase &dsb,
- uint32_t bufferId)
+ BufferHold(size_t size, DataStoreBase &dsb, uint32_t bufferId)
: GenerationHeldBase(size),
_dsb(dsb),
_bufferId(bufferId)
{
}
- virtual
- ~BufferHold()
+ ~BufferHold() override
{
_dsb.doneHoldBuffer(_bufferId);
}
diff --git a/searchlib/src/vespa/searchlib/datastore/datastorebase.h b/searchlib/src/vespa/searchlib/datastore/datastorebase.h
index bdb49fec029..b5256545194 100644
--- a/searchlib/src/vespa/searchlib/datastore/datastorebase.h
+++ b/searchlib/src/vespa/searchlib/datastore/datastorebase.h
@@ -13,10 +13,6 @@ namespace search::datastore {
class DataStoreBase
{
-private:
- DataStoreBase(const DataStoreBase &rhs);
-
- DataStoreBase &operator=(const DataStoreBase &rhs);
public:
// Hold list before freeze, before knowing how long elements must be held
class ElemHold1ListElem
@@ -80,7 +76,7 @@ protected:
FallbackHold(size_t size, BufferState::Alloc &&buffer, size_t usedElems,
BufferTypeBase *typeHandler, uint32_t typeId);
- virtual ~FallbackHold();
+ ~FallbackHold() override;
};
class BufferHold;
@@ -151,6 +147,8 @@ protected:
vespalib::GenerationHolder _genHolder;
DataStoreBase(uint32_t numBuffers, size_t maxClusters);
+ DataStoreBase(const DataStoreBase &) = delete;
+ DataStoreBase &operator=(const DataStoreBase &) = delete;
virtual ~DataStoreBase();