aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--persistence/src/vespa/persistence/spi/bucketinfo.h7
-rw-r--r--persistencetypes/src/persistence/spi/types.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_filter.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_context.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/attributesconfigscout.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h6
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_repo.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/attribute/sequential_attributes_initializer.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_explorer.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp17
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.cpp19
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketdeltapair.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.h15
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.cpp16
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.h94
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.h8
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.h61
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp7
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/subdbtype.h3
33 files changed, 75 insertions, 288 deletions
diff --git a/persistence/src/vespa/persistence/spi/bucketinfo.h b/persistence/src/vespa/persistence/spi/bucketinfo.h
index ad869c0add3..eb7a5daeb5a 100644
--- a/persistence/src/vespa/persistence/spi/bucketinfo.h
+++ b/persistence/src/vespa/persistence/spi/bucketinfo.h
@@ -12,8 +12,7 @@ namespace vespalib {
class asciistream;
}
-namespace storage {
-namespace spi {
+namespace storage::spi {
class BucketInfo {
public:
@@ -105,6 +104,4 @@ private:
vespalib::asciistream& operator<<(vespalib::asciistream& out, const BucketInfo& info);
std::ostream& operator<<(std::ostream& out, const BucketInfo& info);
-} // spi
-} // storage
-
+}
diff --git a/persistencetypes/src/persistence/spi/types.h b/persistencetypes/src/persistence/spi/types.h
index d88fc5eb5ae..95d2c443948 100644
--- a/persistencetypes/src/persistence/spi/types.h
+++ b/persistencetypes/src/persistence/spi/types.h
@@ -54,8 +54,7 @@ namespace document {
return is; \
} \
-namespace storage {
-namespace spi {
+namespace storage::spi {
/**
* \class storage::spi::NodeIndex
@@ -111,6 +110,4 @@ enum MaintenanceLevel {
HIGH
};
-} // spi
-} // storage
-
+}
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_filter.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_filter.cpp
index 8c334293e63..e33a80824c5 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_filter.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_filter.cpp
@@ -1,13 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "attribute_usage_filter.h"
#include <sstream>
namespace proton {
-namespace
-{
+namespace {
void makeAddressSpaceMessage(std::ostream &os,
const AddressSpaceUsageStats &usage)
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_context.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_context.cpp
index c4914580e34..fc5d366f14e 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_context.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_context.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "attribute_usage_sampler_context.h"
#include "attribute_usage_filter.h"
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.cpp
index 1854e243ae3..871a339005b 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "attribute_usage_sampler_functor.h"
#include "attribute_usage_sampler_context.h"
#include <vespa/searchlib/attribute/attributevector.h>
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.h b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.h
index 61565562232..a435875e3d5 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_sampler_functor.h
@@ -3,6 +3,7 @@
#pragma once
#include "i_attribute_functor.h"
+#include <memory>
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
index aa26b6d81df..17d111db272 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_usage_stats.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "attribute_usage_stats.h"
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
index d0e59cdbda5..8e833ac8c67 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_vector_explorer.cpp
@@ -1,9 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.attribute.attribute_vector_explorer");
-
#include "attribute_vector_explorer.h"
#include <vespa/searchlib/attribute/enumstorebase.h>
#include <vespa/searchlib/attribute/multi_value_mapping.h>
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
index fa0d6cbd0a5..60cc292cbeb 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_writer.cpp
@@ -1,19 +1,13 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.server.attributeadapter");
#include "attribute_writer.h"
#include "attributemanager.h"
#include <vespa/searchcore/proton/common/attrupdate.h>
#include <vespa/searchlib/attribute/attributevector.hpp>
-#include <vespa/searchlib/attribute/floatbase.h>
-#include <vespa/searchlib/attribute/integerbase.h>
-#include <vespa/searchlib/attribute/stringbase.h>
#include <vespa/searchlib/common/isequencedtaskexecutor.h>
-#include <vespa/document/fieldvalue/weightedsetfieldvalue.h>
-#include <vespa/document/fieldvalue/arrayfieldvalue.h>
-#include <type_traits>
+
+#include <vespa/log/log.h>
+LOG_SETUP(".proton.server.attributeadapter");
using namespace document;
using namespace search;
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attributesconfigscout.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attributesconfigscout.cpp
index 5d7a1526bf0..6f958ed9c3e 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/attributesconfigscout.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/attributesconfigscout.cpp
@@ -1,13 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "attributesconfigscout.h"
#include <vespa/searchlib/attribute/configconverter.h>
using search::attribute::ConfigConverter;
-namespace proton
-{
+namespace proton {
AttributesConfigScout::AttributesConfigScout(const AttributesConfig &live)
: _live(live),
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
index 930bf709e6c..c716dc12e85 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.cpp
@@ -1,14 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.exclusive_attribute_read_accessor");
-
#include "exclusive_attribute_read_accessor.h"
#include <vespa/searchlib/attribute/attributevector.h>
#include <vespa/searchlib/common/isequencedtaskexecutor.h>
-#include <vespa/vespalib/util/executor.h>
-#include <vespa/vespalib/util/sync.h>
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h
index 2edecd1ca2a..cae1d1de770 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h
+++ b/searchcore/src/vespa/searchcore/proton/attribute/exclusive_attribute_read_accessor.h
@@ -2,9 +2,11 @@
#pragma once
+#include <memory>
+
namespace search {
-class AttributeVector;
-class ISequencedTaskExecutor;
+ class AttributeVector;
+ class ISequencedTaskExecutor;
}
namespace vespalib { class Gate; }
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp
index 63ae28444d3..34ceaf60c90 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp
@@ -1,5 +1,5 @@
// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
+
#include "imported_attributes_context.h"
#include "imported_attributes_repo.h"
#include <vespa/searchlib/attribute/attributeguard.h>
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_repo.cpp b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_repo.cpp
index d7a87609995..9261840f2b6 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_repo.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_repo.cpp
@@ -1,5 +1,5 @@
// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
+
#include "imported_attributes_repo.h"
#include <vespa/searchlib/attribute/imported_attribute_vector.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/sequential_attributes_initializer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/sequential_attributes_initializer.cpp
index 4170a8e8be5..5470ab91008 100644
--- a/searchcore/src/vespa/searchcore/proton/attribute/sequential_attributes_initializer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/attribute/sequential_attributes_initializer.cpp
@@ -1,8 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "sequential_attributes_initializer.h"
-#include "attributemanager.h"
using search::AttributeVector;
using search::SerialNum;
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_explorer.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_explorer.cpp
index 5236ebed261..569c49f0564 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_explorer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_explorer.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "bucket_db_explorer.h"
#include <vespa/vespalib/data/slime/cursor.h>
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.cpp
index 4e417d91eac..056eced6bb4 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include "bucket_db_owner.h"
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.h
index 4b26b1eaba1..c534cb5ae10 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucket_db_owner.h
@@ -2,8 +2,8 @@
#pragma once
-#include <mutex>
#include "bucketdb.h"
+#include <mutex>
namespace proton {
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp
index d998d019c5e..7b5fabb1c74 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.cpp
@@ -1,16 +1,12 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.documentmetastore.bucketdb");
#include "bucketdb.h"
+#include <cassert>
using document::GlobalId;
using storage::spi::BucketChecksum;
-namespace proton
-{
-
+namespace proton {
BucketDB::BucketDB()
: _map(),
@@ -19,14 +15,12 @@ BucketDB::BucketDB()
{
}
-
BucketDB::~BucketDB()
{
checkEmpty();
clear();
}
-
bucketdb::BucketState *
BucketDB::getBucketStatePtr(const BucketId &bucket)
{
@@ -37,7 +31,6 @@ BucketDB::getBucketStatePtr(const BucketId &bucket)
return nullptr;
}
-
void
BucketDB::unloadBucket(const BucketId &bucket, const BucketState &delta)
{
@@ -46,7 +39,6 @@ BucketDB::unloadBucket(const BucketId &bucket, const BucketState &delta)
*state -= delta;
}
-
const bucketdb::BucketState &
BucketDB::add(const GlobalId &gid,
const BucketId &bucketId,
@@ -70,7 +62,6 @@ BucketDB::remove(const GlobalId &gid,
state.remove(gid, timestamp, docSize, subDbType);
}
-
void
BucketDB::modify(const GlobalId &gid,
const BucketId &oldBucketId,
@@ -172,7 +163,6 @@ BucketDB::clear()
_map.clear();
}
-
void
BucketDB::checkEmpty() const
{
@@ -213,7 +203,6 @@ BucketDB::deleteEmptyBucket(const BucketId &bucketId)
}
}
-
void
BucketDB::getActiveBuckets(BucketId::List &buckets) const
{
@@ -224,7 +213,6 @@ BucketDB::getActiveBuckets(BucketId::List &buckets) const
}
}
-
void
BucketDB::populateActiveBuckets(const BucketId::List &buckets,
BucketId::List &fixupBuckets)
@@ -258,5 +246,4 @@ BucketDB::populateActiveBuckets(const BucketId::List &buckets,
}
}
-
}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h
index b948cb63caf..a51529eab1f 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdb.h
@@ -2,16 +2,12 @@
#pragma once
-#include <vespa/document/base/globalid.h>
+#include "bucketstate.h"
#include <vespa/document/bucket/bucketid.h>
-#include <vespa/persistence/spi/bucketinfo.h>
-#include <vespa/searchcore/proton/common/subdbtype.h>
#include <vespa/persistence/spi/result.h>
-#include "bucketstate.h"
#include <map>
-namespace proton
-{
+namespace proton {
class BucketDB
{
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.cpp
index a36fca85def..2160ce4be78 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.cpp
@@ -1,20 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include "bucketdb.h"
-#include "bucketsessionbase.h"
+#include "bucketdbhandler.h"
#include "splitbucketsession.h"
#include "joinbucketssession.h"
-#include <vespa/searchlib/common/serialnum.h>
-#include "bucketdbhandler.h"
#include <vespa/searchcore/proton/documentmetastore/i_document_meta_store.h>
-namespace proton
-{
-
-namespace bucketdb
-{
-
+namespace proton::bucketdb {
BucketDBHandler::BucketDBHandler(BucketDBOwner &bucketDB)
: _bucketDB(bucketDB),
@@ -22,7 +13,6 @@ BucketDBHandler::BucketDBHandler(BucketDBOwner &bucketDB)
{
}
-
void
BucketDBHandler::addDocumentMetaStore(IDocumentMetaStore *dms,
search::SerialNum flushedSerialNum)
@@ -30,7 +20,6 @@ BucketDBHandler::addDocumentMetaStore(IDocumentMetaStore *dms,
_dmsv.push_back(MetaStoreDesc(dms, flushedSerialNum));
}
-
void
BucketDBHandler::handleSplit(search::SerialNum serialNum,
const BucketId &source,
@@ -87,21 +76,17 @@ BucketDBHandler::handleJoin(search::SerialNum serialNum,
session.finish();
}
-
void
BucketDBHandler::handleCreateBucket(const BucketId &bucketId)
{
_bucketDB.takeGuard()->createBucket(bucketId);
}
-
void
BucketDBHandler::handleDeleteBucket(const BucketId &bucketId)
{
_bucketDB.takeGuard()->deleteEmptyBucket(bucketId);
}
-
}
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.h
index 464cb2e69a1..7d855abbaae 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdbhandler.h
@@ -6,11 +6,7 @@
#include "ibucketdbhandler.h"
#include "ibucketdbhandlerinitializer.h"
-namespace proton
-{
-
-namespace bucketdb
-{
+namespace proton::bucketdb {
/**
* The BucketDBHandler class handles operations on a bucket db.
@@ -65,5 +61,3 @@ public:
};
}
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdeltapair.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdeltapair.h
index f0db5e17867..fdc77f6b2a7 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdeltapair.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketdeltapair.h
@@ -2,11 +2,9 @@
#pragma once
-namespace proton
-{
+#include "bucketstate.h"
-namespace bucketdb
-{
+namespace proton::bucketdb {
/**
* Class BucketDeltaPair represent the deltas to bucket states caused by
@@ -26,5 +24,3 @@ public:
};
}
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.cpp
index 4173cc28f5d..b72fe8e9934 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.cpp
@@ -1,14 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include "bucketdb.h"
#include "bucketsessionbase.h"
-namespace proton
-{
-
-namespace bucketdb
-{
+namespace proton::bucketdb {
BucketSessionBase::BucketSessionBase(BucketDBOwner &bucketDB)
: _bucketDB(bucketDB.takeGuard())
@@ -39,7 +33,4 @@ BucketSessionBase::calcFixupNeed(BucketState *state, bool wantActive,
return false;
}
-
-}
-
}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.h
index 64983ae45bf..5fe335ad59c 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketsessionbase.h
@@ -4,11 +4,7 @@
#include "bucket_db_owner.h"
-namespace proton
-{
-
-namespace bucketdb
-{
+namespace proton::bucketdb {
/**
* Base class for split/join handling utility classes that bundles temporary
@@ -27,14 +23,9 @@ protected:
public:
BucketSessionBase(BucketDBOwner &bucketDB);
- bool
- extractInfo(const BucketId &bucket, BucketState *&info);
+ bool extractInfo(const BucketId &bucket, BucketState *&info);
- static bool
- calcFixupNeed(BucketState *state, bool wantActive, bool fixup);
+ static bool calcFixupNeed(BucketState *state, bool wantActive, bool fixup);
};
-
-}
-
}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.cpp
index afaf9700e3f..45d1b2957e3 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.cpp
@@ -1,17 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
+#include "bucketstate.h"
+#include <cassert>
-#include "bucketdb.h"
+namespace proton::bucketdb {
-namespace proton
-{
-
-namespace bucketdb
-{
-
-namespace
-{
+namespace {
uint32_t
gidChecksum(const document::GlobalId &gid)
@@ -181,7 +175,5 @@ BucketState::operator storage::spi::BucketInfo() const
_active ? BucketInfo::ACTIVE : BucketInfo::NOT_ACTIVE);
}
-
}
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.h b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.h
index b2b4760cb8b..50f862e1e41 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/bucketstate.h
@@ -2,11 +2,11 @@
#pragma once
-namespace proton
-{
+#include <vespa/searchcore/proton/common/subdbtype.h>
+#include <vespa/document/base/globalid.h>
+#include <vespa/persistence/spi/bucketinfo.h>
-namespace bucketdb
-{
+namespace proton::bucketdb {
/**
* Class BucketState represent the known state of a bucket in raw form.
@@ -34,85 +34,33 @@ public:
static uint32_t calcChecksum(const GlobalId &gid, const Timestamp &timestamp);
- void
- add(const GlobalId &gid, const Timestamp &timestamp, uint32_t docSize, SubDbType subDbType);
-
- void
- remove(const GlobalId &gid, const Timestamp &timestamp, uint32_t docSize, SubDbType subDbType);
+ void add(const GlobalId &gid, const Timestamp &timestamp, uint32_t docSize, SubDbType subDbType);
+ void remove(const GlobalId &gid, const Timestamp &timestamp, uint32_t docSize, SubDbType subDbType);
- void
- modify(const Timestamp &oldTimestamp, uint32_t oldDocSize,
- const Timestamp &newTimestamp, uint32_t newDocSize,
- SubDbType subDbType);
+ void modify(const Timestamp &oldTimestamp, uint32_t oldDocSize,
+ const Timestamp &newTimestamp, uint32_t newDocSize,
+ SubDbType subDbType);
- bool
- isActive() const
- {
- return _active;
- }
-
- BucketState &
- setActive(bool active)
- {
+ BucketState &setActive(bool active) {
_active = active;
return *this;
}
- uint32_t
- getReadyCount() const
- {
- return _docCount[READY];
- }
-
- uint32_t
- getRemovedCount() const
- {
- return _docCount[REMOVED];
- }
-
- uint32_t
- getNotReadyCount() const
- {
- return _docCount[NOTREADY];
- }
-
+ bool isActive() const { return _active; }
+ uint32_t getReadyCount() const { return _docCount[READY]; }
+ uint32_t getRemovedCount() const { return _docCount[REMOVED]; }
+ uint32_t getNotReadyCount() const { return _docCount[NOTREADY]; }
size_t getReadyDocSizes() const { return _docSizes[READY]; }
size_t getRemovedDocSizes() const { return _docSizes[REMOVED]; }
size_t getNotReadyDocSizes() const { return _docSizes[NOTREADY]; }
-
- uint32_t
- getDocumentCount() const
- {
- return getReadyCount() + getNotReadyCount();
- }
-
- uint32_t
- getEntryCount() const
- {
- return getDocumentCount() + getRemovedCount();
- }
-
- storage::spi::BucketChecksum
- getChecksum() const
- {
- return storage::spi::BucketChecksum(_checksum);
- }
-
- bool
- empty() const;
-
- BucketState &
- operator+=(const BucketState &rhs);
-
- BucketState &
- operator-=(const BucketState &rhs);
-
- void
- applyDelta(BucketState *src, BucketState *dst) const;
-
+ uint32_t getDocumentCount() const { return getReadyCount() + getNotReadyCount(); }
+ uint32_t getEntryCount() const { return getDocumentCount() + getRemovedCount(); }
+ storage::spi::BucketChecksum getChecksum() const { return storage::spi::BucketChecksum(_checksum); }
+ bool empty() const;
+ BucketState &operator+=(const BucketState &rhs);
+ BucketState &operator-=(const BucketState &rhs);
+ void applyDelta(BucketState *src, BucketState *dst) const;
operator storage::spi::BucketInfo() const;
};
}
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.cpp
index ce46df2c450..60024fc63ac 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.cpp
@@ -1,16 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include "bucketdb.h"
-#include "bucketsessionbase.h"
#include "joinbucketssession.h"
#include "bucketdeltapair.h"
+#include <cassert>
-namespace proton
-{
-
-namespace bucketdb
-{
+namespace proton::bucketdb {
JoinBucketsSession::JoinBucketsSession(BucketDBOwner &bucketDB,
const BucketId &source1,
@@ -107,7 +101,5 @@ JoinBucketsSession::finish()
}
}
-
}
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.h b/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.h
index f05521a06c0..bdb43130e19 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/joinbucketssession.h
@@ -2,11 +2,9 @@
#pragma once
-namespace proton
-{
+#include "bucketsessionbase.h"
-namespace bucketdb
-{
+namespace proton::bucketdb {
class BucketDeltaPair;
@@ -82,5 +80,3 @@ public:
};
}
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.cpp b/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.cpp
index 5cc4d74cf25..389ec594878 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.cpp
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.cpp
@@ -1,16 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include "bucketdb.h"
-#include "bucketsessionbase.h"
#include "splitbucketsession.h"
#include "bucketdeltapair.h"
+#include <cassert>
-namespace proton
-{
-
-namespace bucketdb
-{
+namespace proton::bucketdb {
SplitBucketSession::SplitBucketSession(BucketDBOwner &bucketDB,
@@ -93,7 +87,5 @@ SplitBucketSession::finish()
}
}
-
}
-}
diff --git a/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.h b/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.h
index 260a32d7dbd..8260c99547d 100644
--- a/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.h
+++ b/searchcore/src/vespa/searchcore/proton/bucketdb/splitbucketsession.h
@@ -2,11 +2,9 @@
#pragma once
-namespace proton
-{
+#include "bucketsessionbase.h"
-namespace bucketdb
-{
+namespace proton::bucketdb {
class BucketDeltaPair;
@@ -32,8 +30,7 @@ private:
BucketId _target1;
BucketId _target2;
- void
- applyDelta(const BucketState &delta, BucketState *src, BucketId &dstBucket);
+ void applyDelta(const BucketState &delta, BucketState *src, BucketId &dstBucket);
public:
SplitBucketSession(BucketDBOwner &bucketDB,
@@ -44,62 +41,28 @@ public:
/*
* Reflect move of documents to target1 and target2 in bucket states
*/
- void
- applyDeltas(const BucketDeltaPair &deltas);
-
- bool
- getSourceActive() const
- {
- return _sourceActive;
- }
+ void applyDeltas(const BucketDeltaPair &deltas);
+ bool getSourceActive() const { return _sourceActive; }
/*
* Return true if bitvector for active lids need to be adjusted in
* document meta store due to old documents in target1 and active
* state change.
*/
- bool
- mustFixupTarget1ActiveLids() const
- {
- return _adjustTarget1ActiveLids;
- }
+ bool mustFixupTarget1ActiveLids() const { return _adjustTarget1ActiveLids; }
/*
* Return true if bitvector for active lids need to be adjusted in
* document meta store due to old documents in target2 and active
* state change.
*/
- bool
- mustFixupTarget2ActiveLids() const
- {
- return _adjustTarget2ActiveLids;
- }
-
- void
- setup();
-
- void
- finish();
+ bool mustFixupTarget2ActiveLids() const { return _adjustTarget2ActiveLids; }
- const BucketId &
- getSource() const
- {
- return _source;
- }
-
- const BucketId &
- getTarget1() const
- {
- return _target1;
- }
-
- const BucketId &
- getTarget2() const
- {
- return _target2;
- }
+ void setup();
+ void finish();
+ const BucketId &getSource() const { return _source; }
+ const BucketId &getTarget1() const { return _target1; }
+ const BucketId &getTarget2() const { return _target2; }
};
}
-
-}
diff --git a/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp b/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp
index 73df7d511c9..d15eddb3ac4 100644
--- a/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp
+++ b/searchcore/src/vespa/searchcore/proton/common/attributefieldvaluenode.cpp
@@ -1,15 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".proton.common.attributefieldvaluenode");
#include "attributefieldvaluenode.h"
#include "selectcontext.h"
-#include <vespa/document/select/value.h>
#include <vespa/searchcommon/attribute/attributecontent.h>
-namespace proton
-{
+namespace proton {
using document::select::Context;
using document::select::FloatValue;
diff --git a/searchcore/src/vespa/searchcore/proton/common/subdbtype.h b/searchcore/src/vespa/searchcore/proton/common/subdbtype.h
index 0864b0a8fe7..b782b46aa6b 100644
--- a/searchcore/src/vespa/searchcore/proton/common/subdbtype.h
+++ b/searchcore/src/vespa/searchcore/proton/common/subdbtype.h
@@ -2,8 +2,7 @@
#pragma once
-namespace proton
-{
+namespace proton {
/**
* Enumeration of the different kinds of sub databases within a