aboutsummaryrefslogtreecommitdiffstats
path: root/persistence
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-01-18 19:46:50 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-01-18 19:58:27 +0000
commitabc81c8281f86d26e4a9f4b804640d2f3a99cb72 (patch)
tree16a50b17021e56994747795f59f71d62f5b221c7 /persistence
parentccb0e462b5cd0d6fc8fa78ff12bfd0784a29202e (diff)
Include exception where needed and use std:.make_unique
Diffstat (limited to 'persistence')
-rw-r--r--persistence/src/vespa/persistence/spi/bucket.h1
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.cpp5
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.h7
-rw-r--r--persistence/src/vespa/persistence/spi/documentselection.h3
-rw-r--r--persistence/src/vespa/persistence/spi/exceptions.h2
-rw-r--r--persistence/src/vespa/persistence/spi/matcher.h39
-rw-r--r--persistence/src/vespa/persistence/spi/selection.h1
7 files changed, 12 insertions, 46 deletions
diff --git a/persistence/src/vespa/persistence/spi/bucket.h b/persistence/src/vespa/persistence/spi/bucket.h
index ab47d77bed7..30393109cc9 100644
--- a/persistence/src/vespa/persistence/spi/bucket.h
+++ b/persistence/src/vespa/persistence/spi/bucket.h
@@ -9,7 +9,6 @@
#pragma once
-#include <persistence/spi/types.h>
#include <vespa/document/bucket/bucket.h>
namespace storage::spi {
diff --git a/persistence/src/vespa/persistence/spi/clusterstate.cpp b/persistence/src/vespa/persistence/spi/clusterstate.cpp
index 567d7ebc1ce..8f25e7fb332 100644
--- a/persistence/src/vespa/persistence/spi/clusterstate.cpp
+++ b/persistence/src/vespa/persistence/spi/clusterstate.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "clusterstate.h"
+#include "bucket.h"
#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/objects/nbostream.h>
@@ -13,8 +14,8 @@ ClusterState::ClusterState(const lib::ClusterState& state,
uint16_t nodeIndex,
const lib::Distribution& distribution)
: _state(std::make_unique<lib::ClusterState>(state)),
- _nodeIndex(nodeIndex),
- _distribution(std::make_unique<lib::Distribution>(distribution.serialize()))
+ _distribution(std::make_unique<lib::Distribution>(distribution.serialize())),
+ _nodeIndex(nodeIndex)
{
}
diff --git a/persistence/src/vespa/persistence/spi/clusterstate.h b/persistence/src/vespa/persistence/spi/clusterstate.h
index 9d2d3922a17..5b2b41b3161 100644
--- a/persistence/src/vespa/persistence/spi/clusterstate.h
+++ b/persistence/src/vespa/persistence/spi/clusterstate.h
@@ -1,8 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include "bucket.h"
+#include <memory>
+namespace vespalib { class nbostream; }
namespace storage::lib {
class ClusterState;
class Distribution;
@@ -10,6 +11,8 @@ namespace storage::lib {
namespace storage::spi {
+class Bucket;
+
/**
* Used to determine the state of the current node and its buckets.
*/
@@ -67,8 +70,8 @@ public:
private:
std::unique_ptr<lib::ClusterState> _state;
- uint16_t _nodeIndex;
std::unique_ptr<lib::Distribution> _distribution;
+ uint16_t _nodeIndex;
void deserialize(vespalib::nbostream&);
bool nodeHasStateOneOf(const char* states) const;
diff --git a/persistence/src/vespa/persistence/spi/documentselection.h b/persistence/src/vespa/persistence/spi/documentselection.h
index af734d2e16e..eeea1f6c2bc 100644
--- a/persistence/src/vespa/persistence/spi/documentselection.h
+++ b/persistence/src/vespa/persistence/spi/documentselection.h
@@ -8,8 +8,9 @@
#pragma once
-#include <persistence/spi/types.h>
+#include <vespa/vespalib/stllike/string.h>
+namespace document { class Document; }
namespace storage::spi {
class DocumentSelection
diff --git a/persistence/src/vespa/persistence/spi/exceptions.h b/persistence/src/vespa/persistence/spi/exceptions.h
index e972e304567..8ac9c3765f0 100644
--- a/persistence/src/vespa/persistence/spi/exceptions.h
+++ b/persistence/src/vespa/persistence/spi/exceptions.h
@@ -1,7 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/exception.h>
namespace storage::spi {
diff --git a/persistence/src/vespa/persistence/spi/matcher.h b/persistence/src/vespa/persistence/spi/matcher.h
deleted file mode 100644
index bf989530f35..00000000000
--- a/persistence/src/vespa/persistence/spi/matcher.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-/**
- * \class storage::spi::Matcher
- * \ingroup spi
- *
- * \brief Use a matcher to find what documents one is interested in.
- */
-
-#pragma once
-
-#include "docentry.h"
-#include <persistence/spi/documentsubset.h>
-#include <persistence/spi/types.h>
-
-namespace storage::spi {
-
-class Matcher {
- DocumentSubset _subset;
-
-public:
- Matcher(const DocumentSubset& subset) : _subset(subset) {}
- virtual ~Matcher() {}
-
- virtual bool match(const DocEntry&) const = 0;
-
- /**
- * Get the document subset that this matcher needs in order to decide
- * whether a document entry should be matched or not. When match is called,
- * specified information is guarantueed to be set.
- */
- const DocumentSubset& getNeededParts() const { return _subset; }
-};
-
-struct AllMatcher : public Matcher {
- AllMatcher() : Matcher(DocumentSubset(0)) {}
- bool match(const DocEntry&) const { return true; }
-};
-
-}
diff --git a/persistence/src/vespa/persistence/spi/selection.h b/persistence/src/vespa/persistence/spi/selection.h
index 0f809cf1641..744af849c83 100644
--- a/persistence/src/vespa/persistence/spi/selection.h
+++ b/persistence/src/vespa/persistence/spi/selection.h
@@ -9,6 +9,7 @@
#pragma once
#include "documentselection.h"
+#include <persistence/spi/types.h>
namespace storage::spi {