summaryrefslogtreecommitdiffstats
path: root/persistence
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@oath.com>2018-04-20 12:37:56 +0200
committerHenning Baldersheim <balder@oath.com>2018-04-20 12:37:56 +0200
commit7a3834a9373da78e2883fcac78a02f6b78e5a502 (patch)
tree703636ebd7f42d62e6ffb57300e144e9bb240420 /persistence
parente590767e3bb6346b1edf65f3a2e0e66c33608a77 (diff)
Minor cleanup while reading code
Diffstat (limited to 'persistence')
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.cpp14
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.h8
2 files changed, 9 insertions, 13 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:
};
}
-
-}
-