summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2018-04-20 12:46:30 +0200
committerGitHub <noreply@github.com>2018-04-20 12:46:30 +0200
commitab8fa0da1f1bffbb5b3398e86c13bfaa3fa17924 (patch)
tree27642f07bf0bf10dd5332f6fa31f5a4141bd6642
parente7574b3407e1d059207dafb9e9042c87148c4b14 (diff)
parent06bf20093e3f2e04827d3d86062978ed00dc76a9 (diff)
Merge pull request #5645 from vespa-engine/balder/deinline
Balder/deinline
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.cpp14
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/fef/test/CMakeLists.txt1
-rw-r--r--searchlib/src/vespa/searchlib/fef/test/attribute_map.cpp9
-rw-r--r--searchlib/src/vespa/searchlib/fef/test/attribute_map.h3
6 files changed, 23 insertions, 17 deletions
diff --git a/persistence/src/vespa/persistence/spi/clusterstate.cpp b/persistence/src/vespa/persistence/spi/clusterstate.cpp
index fc5c970b371..bc30197978f 100644
--- a/persistence/src/vespa/persistence/spi/clusterstate.cpp
+++ b/persistence/src/vespa/persistence/spi/clusterstate.cpp
@@ -40,7 +40,7 @@ ClusterState::ClusterState(const ClusterState& other) {
deserialize(o);
}
-ClusterState::~ClusterState() { }
+ClusterState::~ClusterState() = default;
ClusterState& ClusterState::operator=(const ClusterState& other) {
ClusterState copy(other);
@@ -51,8 +51,8 @@ ClusterState& ClusterState::operator=(const ClusterState& other) {
}
bool ClusterState::shouldBeReady(const Bucket& b) const {
- assert(_distribution.get());
- assert(_state.get());
+ assert(_distribution);
+ assert(_state);
if (_distribution->getReadyCopies() >= _distribution->getRedundancy()) {
return true; // all copies should be ready
@@ -69,11 +69,11 @@ bool ClusterState::shouldBeReady(const Bucket& b) const {
}
bool ClusterState::clusterUp() const {
- return _state.get() && _state->getClusterState() == lib::State::UP;
+ return _state && _state->getClusterState() == lib::State::UP;
}
bool ClusterState::nodeHasStateOneOf(const char* states) const {
- return _state.get() &&
+ return _state &&
_state->getNodeState(lib::Node(lib::NodeType::STORAGE, _nodeIndex)).
getState().oneOf(states);
}
@@ -91,8 +91,8 @@ bool ClusterState::nodeRetired() const {
}
void ClusterState::serialize(vespalib::nbostream& o) const {
- assert(_distribution.get());
- assert(_state.get());
+ assert(_distribution);
+ assert(_state);
vespalib::asciistream tmp;
_state->serialize(tmp, false);
o << tmp.str() << _nodeIndex;
diff --git a/persistence/src/vespa/persistence/spi/clusterstate.h b/persistence/src/vespa/persistence/spi/clusterstate.h
index e0db8cc7196..f5dda1fd745 100644
--- a/persistence/src/vespa/persistence/spi/clusterstate.h
+++ b/persistence/src/vespa/persistence/spi/clusterstate.h
@@ -3,14 +3,13 @@
#include "bucket.h"
-namespace storage {
-namespace lib {
+namespace storage::lib {
class ClusterState;
class Distribution;
}
-namespace spi {
+namespace storage::spi {
/**
* Used to determine the state of the current node and its buckets.
@@ -77,6 +76,3 @@ private:
};
}
-
-}
-
diff --git a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
index 71b6fe73e38..987218beefa 100644
--- a/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/combiningfeedview.cpp
@@ -261,7 +261,7 @@ CombiningFeedView::setCalculator(const IBucketStateCalculator::SP &newCalc)
{
// Called by document db executor
_calc = newCalc;
- _clusterUp = _calc.get() != NULL && _calc->clusterUp();
+ _clusterUp = _calc && _calc->clusterUp();
_forceReady = !_clusterUp || !hasNotReadyFeedView();
}
@@ -274,8 +274,7 @@ CombiningFeedView::shouldBeReady(const document::BucketId &bucket) const
bucket.toString().c_str(),
(_forceReady ? "true" : "false"),
(_clusterUp ? "true" : "false"),
- (_calc.get() != NULL ?
- (_calc->shouldBeReady(dbucket) ? "true" : "false") : "null"));
+ (_calc ? (_calc->shouldBeReady(dbucket) ? "true" : "false") : "null"));
const documentmetastore::IBucketHandler *readyMetaStore =
_metaStores[getReadyFeedViewId()];
bool isActive = readyMetaStore->getBucketDB().takeGuard()->isActiveBucket(bucket);
diff --git a/searchlib/src/vespa/searchlib/fef/test/CMakeLists.txt b/searchlib/src/vespa/searchlib/fef/test/CMakeLists.txt
index 5f454fa64b2..dd6fda7fdf8 100644
--- a/searchlib/src/vespa/searchlib/fef/test/CMakeLists.txt
+++ b/searchlib/src/vespa/searchlib/fef/test/CMakeLists.txt
@@ -1,6 +1,7 @@
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
vespa_add_library(searchlib_fef_test OBJECT
SOURCES
+ attribute_map.cpp
dummy_dependency_handler.cpp
featuretest.cpp
ftlib.cpp
diff --git a/searchlib/src/vespa/searchlib/fef/test/attribute_map.cpp b/searchlib/src/vespa/searchlib/fef/test/attribute_map.cpp
new file mode 100644
index 00000000000..b0bd9d2229f
--- /dev/null
+++ b/searchlib/src/vespa/searchlib/fef/test/attribute_map.cpp
@@ -0,0 +1,9 @@
+// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "attribute_map.h"
+
+namespace search::fef::test {
+
+AttributeMap::~AttributeMap() = default;
+
+}
diff --git a/searchlib/src/vespa/searchlib/fef/test/attribute_map.h b/searchlib/src/vespa/searchlib/fef/test/attribute_map.h
index aadca263722..0f274fb77b8 100644
--- a/searchlib/src/vespa/searchlib/fef/test/attribute_map.h
+++ b/searchlib/src/vespa/searchlib/fef/test/attribute_map.h
@@ -1,4 +1,4 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "mock_attribute_context.h"
#include <vespa/searchcommon/attribute/iattributecontext.h>
@@ -23,6 +23,7 @@ class AttributeMap {
std::map<vespalib::string, std::unique_ptr<attribute::AttributeReadGuard>> _guards;
public:
using IAttributeVector = attribute::IAttributeVector;
+ ~AttributeMap();
void add(std::shared_ptr<attribute::IAttributeVector> attr) {
_attributes.emplace(attr->getName(), std::move(attr));