summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-05-04 18:13:19 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2017-05-05 13:58:10 +0200
commit50e9bfdb982090d0de2909b4ddfef80ed7880ec5 (patch)
tree225f9ef11163cadd700b18c433516eb9a186a7d7 /storage
parent58db3e7a7db7694431d45dcd7ae24e6c89ac0586 (diff)
Move code from .hpp to cpp file to avoid unused anonymous function complaints from some compilations units that do not use it.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/bucketdb/lockablemap.cpp26
-rw-r--r--storage/src/vespa/storage/bucketdb/lockablemap.hpp31
-rw-r--r--storage/src/vespa/storage/bucketmover/run.cpp2
-rw-r--r--storage/src/vespa/storage/bucketmover/run.h4
4 files changed, 31 insertions, 32 deletions
diff --git a/storage/src/vespa/storage/bucketdb/lockablemap.cpp b/storage/src/vespa/storage/bucketdb/lockablemap.cpp
index cc635a913d5..3497a2e6662 100644
--- a/storage/src/vespa/storage/bucketdb/lockablemap.cpp
+++ b/storage/src/vespa/storage/bucketdb/lockablemap.cpp
@@ -5,6 +5,32 @@
namespace storage {
+uint8_t
+getMinDiffBits(uint16_t minBits, const document::BucketId& a, const document::BucketId& b) {
+ for (uint32_t i = minBits; i <= std::min(a.getUsedBits(), b.getUsedBits()); i++) {
+ document::BucketId a1(i, a.getRawId());
+ document::BucketId b1(i, b.getRawId());
+ if (b1.getId() != a1.getId()) {
+ return i;
+ }
+ }
+ return minBits;
+}
+
+bool
+checkContains(document::BucketId::Type key, const document::BucketId& bucket,
+ document::BucketId& result, document::BucketId::Type& keyResult)
+{
+ document::BucketId id = document::BucketId(document::BucketId::keyToBucketId(key));
+ if (id.contains(bucket)) {
+ result = id;
+ keyResult = key;
+ return true;
+ }
+
+ return false;
+}
+
using bucketdb::StorageBucketInfo;
template class LockableMap<storage::JudyMultiMap<StorageBucketInfo, StorageBucketInfo, StorageBucketInfo, StorageBucketInfo> >;
diff --git a/storage/src/vespa/storage/bucketdb/lockablemap.hpp b/storage/src/vespa/storage/bucketdb/lockablemap.hpp
index 7d6af079d38..017208fbbad 100644
--- a/storage/src/vespa/storage/bucketdb/lockablemap.hpp
+++ b/storage/src/vespa/storage/bucketdb/lockablemap.hpp
@@ -467,8 +467,6 @@ LockableMap<Map>::unlock(const key_type& key)
guard.broadcast();
}
-namespace {
-
/**
* Check whether the given key contains the given bucket.
* Sets result to the bucket corresponding to the key, and keyResult
@@ -476,19 +474,7 @@ namespace {
*/
bool
checkContains(document::BucketId::Type key, const document::BucketId& bucket,
- document::BucketId& result, document::BucketId::Type& keyResult)
-{
- document::BucketId id = document::BucketId(document::BucketId::keyToBucketId(key));
- if (id.contains(bucket)) {
- result = id;
- keyResult = key;
- return true;
- }
-
- return false;
-}
-
-} // anon namespace
+ document::BucketId& result, document::BucketId::Type& keyResult);
/**
* Retrieves the most specific bucket id (highest used bits) that contains
@@ -598,20 +584,7 @@ LockableMap<Map>::addAndLockResults(
}
}
-namespace {
-
-uint8_t getMinDiffBits(uint16_t minBits, const document::BucketId& a, const document::BucketId& b) {
- for (uint32_t i = minBits; i <= std::min(a.getUsedBits(), b.getUsedBits()); i++) {
- document::BucketId a1(i, a.getRawId());
- document::BucketId b1(i, b.getRawId());
- if (b1.getId() != a1.getId()) {
- return i;
- }
- }
- return minBits;
-};
-
-}
+uint8_t getMinDiffBits(uint16_t minBits, const document::BucketId& a, const document::BucketId& b);
template<typename Map>
typename LockableMap<Map>::WrappedEntry
diff --git a/storage/src/vespa/storage/bucketmover/run.cpp b/storage/src/vespa/storage/bucketmover/run.cpp
index 8afaa5f8659..e202ddfba58 100644
--- a/storage/src/vespa/storage/bucketmover/run.cpp
+++ b/storage/src/vespa/storage/bucketmover/run.cpp
@@ -4,8 +4,8 @@
#include <vespa/storage/bucketdb/storbucketdb.h>
#include <vespa/storage/bucketdb/lockablemap.hpp>
#include <iomanip>
-#include <vespa/log/log.h>
+#include <vespa/log/log.h>
LOG_SETUP(".bucketmover.run");
namespace storage {
diff --git a/storage/src/vespa/storage/bucketmover/run.h b/storage/src/vespa/storage/bucketmover/run.h
index d05020e6ba5..52e1d6af9c1 100644
--- a/storage/src/vespa/storage/bucketmover/run.h
+++ b/storage/src/vespa/storage/bucketmover/run.h
@@ -16,8 +16,8 @@
#pragma once
-#include <vespa/storage/bucketmover/move.h>
-#include <vespa/storage/bucketmover/runstatistics.h>
+#include "move.h"
+#include "runstatistics.h"
#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vdslib/state/nodestate.h>
#include <list>