aboutsummaryrefslogtreecommitdiffstats
path: root/vdslib
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-05-09 12:03:06 +0000
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-06-03 13:08:25 +0000
commit7e9a122d5865db5a24b135c41b6dbf7dedf6a31c (patch)
treee6901c00e5797b7b688e921d9c83961550463c5a /vdslib
parent34920d57c38c11f8ef8979071992e206fcd0ab03 (diff)
Add new DB merging API to distributor BucketDatabase
Abstracts away how an ordered merge may be performed with the database and an arbitrary sorted bucket sequence, with any number of buckets skipped, updated or inserted as part of the merge. Such an API is required to allow efficient bulk updates of a B-tree backed database, as it is suboptimal to require constant tree mutations. Other changes: - Removed legacy mutable iteration API. Not needed with new merge API. - Const-iteration of bucket database now uses an explicit const reference entry type to avoid needing to construct a temporary entry when we can instead just point directly into the backing ArrayStore. - Micro-optimizations of node remover pass to avoid going via cluster state's node state std::map for each bucket replica entry. Now uses a precomputed bit vector. Also avoid BucketId bit reversing operations as much as possible by using raw bucket keys in more places. - Changed wording and contents of log message that triggers when buckets are removed from the DB due to no remaining nodes containing replicas for the bucket. Now more obvious what the message actually means. - Added several benchmark tests (disabled by default)
Diffstat (limited to 'vdslib')
-rw-r--r--vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp5
-rw-r--r--vdslib/src/vespa/vdslib/state/cluster_state_bundle.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp
index ff633c02fad..198ef4e54d1 100644
--- a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp
+++ b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp
@@ -31,6 +31,11 @@ ClusterStateBundle::ClusterStateBundle(const ClusterState& baselineClusterState,
{
}
+ClusterStateBundle::ClusterStateBundle(const ClusterStateBundle&) = default;
+ClusterStateBundle& ClusterStateBundle::operator=(const ClusterStateBundle&) = default;
+ClusterStateBundle::ClusterStateBundle(ClusterStateBundle&&) = default;
+ClusterStateBundle& ClusterStateBundle::operator=(ClusterStateBundle&&) = default;
+
ClusterStateBundle::~ClusterStateBundle() = default;
const std::shared_ptr<const lib::ClusterState> &
diff --git a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h
index d0b052766ff..1502335f030 100644
--- a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h
+++ b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h
@@ -33,6 +33,12 @@ public:
ClusterStateBundle(const ClusterState& baselineClusterState,
BucketSpaceStateMapping derivedBucketSpaceStates,
bool deferredActivation);
+
+ ClusterStateBundle(const ClusterStateBundle&);
+ ClusterStateBundle& operator=(const ClusterStateBundle&);
+ ClusterStateBundle(ClusterStateBundle&&);
+ ClusterStateBundle& operator=(ClusterStateBundle&&);
+
~ClusterStateBundle();
const std::shared_ptr<const ClusterState> &getBaselineClusterState() const;
const std::shared_ptr<const ClusterState> &getDerivedClusterState(document::BucketSpace bucketSpace) const;