diff options
Diffstat (limited to 'storage/src/vespa/storage/common')
51 files changed, 134 insertions, 146 deletions
diff --git a/storage/src/vespa/storage/common/CMakeLists.txt b/storage/src/vespa/storage/common/CMakeLists.txt index 6165106f871..708f3dd05b9 100644 --- a/storage/src/vespa/storage/common/CMakeLists.txt +++ b/storage/src/vespa/storage/common/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(storage_common OBJECT SOURCES bucket_stripe_utils.cpp diff --git a/storage/src/vespa/storage/common/bucket_resolver.h b/storage/src/vespa/storage/common/bucket_resolver.h index ea261200b7b..8096f218bdc 100644 --- a/storage/src/vespa/storage/common/bucket_resolver.h +++ b/storage/src/vespa/storage/common/bucket_resolver.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/document/bucket/bucket.h> diff --git a/storage/src/vespa/storage/common/bucket_stripe_utils.cpp b/storage/src/vespa/storage/common/bucket_stripe_utils.cpp index d66ef9e55ea..3a1a4a28f0e 100644 --- a/storage/src/vespa/storage/common/bucket_stripe_utils.cpp +++ b/storage/src/vespa/storage/common/bucket_stripe_utils.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "bucket_stripe_utils.h" #include <vespa/vespalib/util/alloc.h> diff --git a/storage/src/vespa/storage/common/bucket_stripe_utils.h b/storage/src/vespa/storage/common/bucket_stripe_utils.h index 4d922baac06..5e351095286 100644 --- a/storage/src/vespa/storage/common/bucket_stripe_utils.h +++ b/storage/src/vespa/storage/common/bucket_stripe_utils.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/bucket_utils.h b/storage/src/vespa/storage/common/bucket_utils.h index fc556a92d4f..5999fdcf0d9 100644 --- a/storage/src/vespa/storage/common/bucket_utils.h +++ b/storage/src/vespa/storage/common/bucket_utils.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/cluster_context.h b/storage/src/vespa/storage/common/cluster_context.h index c159accb101..379c40cb0e3 100644 --- a/storage/src/vespa/storage/common/cluster_context.h +++ b/storage/src/vespa/storage/common/cluster_context.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/content_bucket_db_options.h b/storage/src/vespa/storage/common/content_bucket_db_options.h index b8c9cc6cdf4..b4eb08831e6 100644 --- a/storage/src/vespa/storage/common/content_bucket_db_options.h +++ b/storage/src/vespa/storage/common/content_bucket_db_options.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <cstdint> diff --git a/storage/src/vespa/storage/common/content_bucket_space.cpp b/storage/src/vespa/storage/common/content_bucket_space.cpp index 58f7501d278..0cedb78cfe6 100644 --- a/storage/src/vespa/storage/common/content_bucket_space.cpp +++ b/storage/src/vespa/storage/common/content_bucket_space.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "content_bucket_space.h" diff --git a/storage/src/vespa/storage/common/content_bucket_space.h b/storage/src/vespa/storage/common/content_bucket_space.h index 836cd6e15f8..93b171bd48e 100644 --- a/storage/src/vespa/storage/common/content_bucket_space.h +++ b/storage/src/vespa/storage/common/content_bucket_space.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/document/bucket/bucketspace.h> diff --git a/storage/src/vespa/storage/common/content_bucket_space_repo.cpp b/storage/src/vespa/storage/common/content_bucket_space_repo.cpp index bddfa812657..eda3f735f66 100644 --- a/storage/src/vespa/storage/common/content_bucket_space_repo.cpp +++ b/storage/src/vespa/storage/common/content_bucket_space_repo.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "content_bucket_space_repo.h" #include <vespa/document/bucket/fixed_bucket_spaces.h> diff --git a/storage/src/vespa/storage/common/content_bucket_space_repo.h b/storage/src/vespa/storage/common/content_bucket_space_repo.h index 048c2c266f0..c8dcf01617e 100644 --- a/storage/src/vespa/storage/common/content_bucket_space_repo.h +++ b/storage/src/vespa/storage/common/content_bucket_space_repo.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "content_bucket_space.h" diff --git a/storage/src/vespa/storage/common/distributorcomponent.cpp b/storage/src/vespa/storage/common/distributorcomponent.cpp index 13350d0dc9f..41e875a4ed7 100644 --- a/storage/src/vespa/storage/common/distributorcomponent.cpp +++ b/storage/src/vespa/storage/common/distributorcomponent.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "distributorcomponent.h" diff --git a/storage/src/vespa/storage/common/distributorcomponent.h b/storage/src/vespa/storage/common/distributorcomponent.h index 6542bf2ddfe..1892c7ce5a2 100644 --- a/storage/src/vespa/storage/common/distributorcomponent.h +++ b/storage/src/vespa/storage/common/distributorcomponent.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * \class storage::DistributorStripeComponent * \ingroup common diff --git a/storage/src/vespa/storage/common/doneinitializehandler.h b/storage/src/vespa/storage/common/doneinitializehandler.h index 9aaa4e04dc7..7933a29fecf 100644 --- a/storage/src/vespa/storage/common/doneinitializehandler.h +++ b/storage/src/vespa/storage/common/doneinitializehandler.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * \class storage::DoneInitializeHandler * diff --git a/storage/src/vespa/storage/common/dummy_mbus_messages.h b/storage/src/vespa/storage/common/dummy_mbus_messages.h index 10ecf7b6ed7..b526686aa06 100644 --- a/storage/src/vespa/storage/common/dummy_mbus_messages.h +++ b/storage/src/vespa/storage/common/dummy_mbus_messages.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/messagebus/message.h> diff --git a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp index 832bd33de42..ec606af0690 100644 --- a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp +++ b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "global_bucket_space_distribution_converter.h" #include <vespa/vdslib/distribution/distribution.h> diff --git a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h index ef508238907..c530922ad18 100644 --- a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h +++ b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/hostreporter/CMakeLists.txt b/storage/src/vespa/storage/common/hostreporter/CMakeLists.txt index 60919a80bab..02b58208222 100644 --- a/storage/src/vespa/storage/common/hostreporter/CMakeLists.txt +++ b/storage/src/vespa/storage/common/hostreporter/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +# Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. vespa_add_library(storage_hostreporter OBJECT SOURCES hostinfo.cpp diff --git a/storage/src/vespa/storage/common/hostreporter/hostinfo.cpp b/storage/src/vespa/storage/common/hostreporter/hostinfo.cpp index 7ff999735c0..fe5356f4662 100644 --- a/storage/src/vespa/storage/common/hostreporter/hostinfo.cpp +++ b/storage/src/vespa/storage/common/hostreporter/hostinfo.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "hostinfo.h" #include "hostreporter.h" diff --git a/storage/src/vespa/storage/common/hostreporter/hostinfo.h b/storage/src/vespa/storage/common/hostreporter/hostinfo.h index b33375bba2e..3e5dbab9573 100644 --- a/storage/src/vespa/storage/common/hostreporter/hostinfo.h +++ b/storage/src/vespa/storage/common/hostreporter/hostinfo.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/hostreporter/hostreporter.h b/storage/src/vespa/storage/common/hostreporter/hostreporter.h index 6ce6bd803df..70a11ced885 100644 --- a/storage/src/vespa/storage/common/hostreporter/hostreporter.h +++ b/storage/src/vespa/storage/common/hostreporter/hostreporter.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/vespalib/util/jsonstream.h> diff --git a/storage/src/vespa/storage/common/hostreporter/versionreporter.cpp b/storage/src/vespa/storage/common/hostreporter/versionreporter.cpp index 20d19178684..379db12ebac 100644 --- a/storage/src/vespa/storage/common/hostreporter/versionreporter.cpp +++ b/storage/src/vespa/storage/common/hostreporter/versionreporter.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "versionreporter.h" #include <vespa/vespalib/component/vtag.h> diff --git a/storage/src/vespa/storage/common/hostreporter/versionreporter.h b/storage/src/vespa/storage/common/hostreporter/versionreporter.h index 37b68aaf105..67917778f67 100644 --- a/storage/src/vespa/storage/common/hostreporter/versionreporter.h +++ b/storage/src/vespa/storage/common/hostreporter/versionreporter.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #ifndef STORAGE_SRC_CPP_STORAGE_COMMON_HOSTREPORTER_VERSIONREPORTER_H_ #define STORAGE_SRC_CPP_STORAGE_COMMON_HOSTREPORTER_VERSIONREPORTER_H_ diff --git a/storage/src/vespa/storage/common/i_storage_chain_builder.h b/storage/src/vespa/storage/common/i_storage_chain_builder.h index 5276fa35070..d3bace9ddc4 100644 --- a/storage/src/vespa/storage/common/i_storage_chain_builder.h +++ b/storage/src/vespa/storage/common/i_storage_chain_builder.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/message_guard.cpp b/storage/src/vespa/storage/common/message_guard.cpp index 335b2c3d4d7..46ea54d580e 100644 --- a/storage/src/vespa/storage/common/message_guard.cpp +++ b/storage/src/vespa/storage/common/message_guard.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "message_guard.h" namespace storage { diff --git a/storage/src/vespa/storage/common/message_guard.h b/storage/src/vespa/storage/common/message_guard.h index 682d7a3dc99..5288e303204 100644 --- a/storage/src/vespa/storage/common/message_guard.h +++ b/storage/src/vespa/storage/common/message_guard.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include "messagesender.h" diff --git a/storage/src/vespa/storage/common/messagebucket.cpp b/storage/src/vespa/storage/common/messagebucket.cpp index 202c4a29fac..015ce573e86 100644 --- a/storage/src/vespa/storage/common/messagebucket.cpp +++ b/storage/src/vespa/storage/common/messagebucket.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "messagebucket.h" #include "statusmessages.h" diff --git a/storage/src/vespa/storage/common/messagebucket.h b/storage/src/vespa/storage/common/messagebucket.h index c8805cad1b3..7a74bcbbd48 100644 --- a/storage/src/vespa/storage/common/messagebucket.h +++ b/storage/src/vespa/storage/common/messagebucket.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/document/bucket/bucket.h> diff --git a/storage/src/vespa/storage/common/messagesender.cpp b/storage/src/vespa/storage/common/messagesender.cpp index 7d5a548d2f2..3cb9dc4df56 100644 --- a/storage/src/vespa/storage/common/messagesender.cpp +++ b/storage/src/vespa/storage/common/messagesender.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "messagesender.h" #include <vespa/storageapi/messageapi/storagemessage.h> #include <vespa/storageapi/messageapi/storagereply.h> diff --git a/storage/src/vespa/storage/common/messagesender.h b/storage/src/vespa/storage/common/messagesender.h index 57db86e2258..aebe498980e 100644 --- a/storage/src/vespa/storage/common/messagesender.h +++ b/storage/src/vespa/storage/common/messagesender.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * @class storage::MessageSender * @ingroup common diff --git a/storage/src/vespa/storage/common/node_identity.cpp b/storage/src/vespa/storage/common/node_identity.cpp index f517da8acfe..048ad72cb5c 100644 --- a/storage/src/vespa/storage/common/node_identity.cpp +++ b/storage/src/vespa/storage/common/node_identity.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "node_identity.h" diff --git a/storage/src/vespa/storage/common/node_identity.h b/storage/src/vespa/storage/common/node_identity.h index 77399f78d0c..301fd59658c 100644 --- a/storage/src/vespa/storage/common/node_identity.h +++ b/storage/src/vespa/storage/common/node_identity.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/nodestateupdater.h b/storage/src/vespa/storage/common/nodestateupdater.h index 3d32b9e4b4b..d06731639fa 100644 --- a/storage/src/vespa/storage/common/nodestateupdater.h +++ b/storage/src/vespa/storage/common/nodestateupdater.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * @class storage::NodeStateUpdater * @ingroup common diff --git a/storage/src/vespa/storage/common/reindexing_constants.cpp b/storage/src/vespa/storage/common/reindexing_constants.cpp index d4d27eb5d88..73edfb6c1a5 100644 --- a/storage/src/vespa/storage/common/reindexing_constants.cpp +++ b/storage/src/vespa/storage/common/reindexing_constants.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "reindexing_constants.h" namespace storage { diff --git a/storage/src/vespa/storage/common/reindexing_constants.h b/storage/src/vespa/storage/common/reindexing_constants.h index 91f45e44c86..f15516b5bf6 100644 --- a/storage/src/vespa/storage/common/reindexing_constants.h +++ b/storage/src/vespa/storage/common/reindexing_constants.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once namespace storage { diff --git a/storage/src/vespa/storage/common/servicelayercomponent.cpp b/storage/src/vespa/storage/common/servicelayercomponent.cpp index ca9fb3a45cb..1c17b98a66b 100644 --- a/storage/src/vespa/storage/common/servicelayercomponent.cpp +++ b/storage/src/vespa/storage/common/servicelayercomponent.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "servicelayercomponent.h" diff --git a/storage/src/vespa/storage/common/servicelayercomponent.h b/storage/src/vespa/storage/common/servicelayercomponent.h index 2ab8d6a8dfb..23bed3b6a82 100644 --- a/storage/src/vespa/storage/common/servicelayercomponent.h +++ b/storage/src/vespa/storage/common/servicelayercomponent.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * \class storage::ServiceLayerComponent * \ingroup common diff --git a/storage/src/vespa/storage/common/statusmessages.cpp b/storage/src/vespa/storage/common/statusmessages.cpp index 011ea30f86a..bfc47159378 100644 --- a/storage/src/vespa/storage/common/statusmessages.cpp +++ b/storage/src/vespa/storage/common/statusmessages.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "statusmessages.h" #include <ostream> diff --git a/storage/src/vespa/storage/common/statusmessages.h b/storage/src/vespa/storage/common/statusmessages.h index 12432bfe095..25f584b9dc1 100644 --- a/storage/src/vespa/storage/common/statusmessages.h +++ b/storage/src/vespa/storage/common/statusmessages.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * Internal command used by visitor and filestor framework to gather partial * status from message processing threads. diff --git a/storage/src/vespa/storage/common/statusmetricconsumer.cpp b/storage/src/vespa/storage/common/statusmetricconsumer.cpp index 342680318bd..90cd52e27b4 100644 --- a/storage/src/vespa/storage/common/statusmetricconsumer.cpp +++ b/storage/src/vespa/storage/common/statusmetricconsumer.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "statusmetricconsumer.h" #include <vespa/storageframework/generic/clock/clock.h> diff --git a/storage/src/vespa/storage/common/statusmetricconsumer.h b/storage/src/vespa/storage/common/statusmetricconsumer.h index b25c2d5db48..a59d9cfaa95 100644 --- a/storage/src/vespa/storage/common/statusmetricconsumer.h +++ b/storage/src/vespa/storage/common/statusmetricconsumer.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * @class storage::StatusMetricConsumer diff --git a/storage/src/vespa/storage/common/storage_chain_builder.cpp b/storage/src/vespa/storage/common/storage_chain_builder.cpp index 72961b5e855..09464490118 100644 --- a/storage/src/vespa/storage/common/storage_chain_builder.cpp +++ b/storage/src/vespa/storage/common/storage_chain_builder.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "storage_chain_builder.h" #include "storagelink.h" diff --git a/storage/src/vespa/storage/common/storage_chain_builder.h b/storage/src/vespa/storage/common/storage_chain_builder.h index 9d969ab354d..942681d3f52 100644 --- a/storage/src/vespa/storage/common/storage_chain_builder.h +++ b/storage/src/vespa/storage/common/storage_chain_builder.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once diff --git a/storage/src/vespa/storage/common/storagecomponent.cpp b/storage/src/vespa/storage/common/storagecomponent.cpp index e48368a89cd..148683750ea 100644 --- a/storage/src/vespa/storage/common/storagecomponent.cpp +++ b/storage/src/vespa/storage/common/storagecomponent.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "storagecomponent.h" #include <vespa/vespalib/util/exceptions.h> diff --git a/storage/src/vespa/storage/common/storagecomponent.h b/storage/src/vespa/storage/common/storagecomponent.h index 061d17fa031..e9ac691c0e8 100644 --- a/storage/src/vespa/storage/common/storagecomponent.h +++ b/storage/src/vespa/storage/common/storagecomponent.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * \class storage::StorageComponent * \ingroup common diff --git a/storage/src/vespa/storage/common/storagelink.cpp b/storage/src/vespa/storage/common/storagelink.cpp index 2d566f1fc29..ec55bc89e90 100644 --- a/storage/src/vespa/storage/common/storagelink.cpp +++ b/storage/src/vespa/storage/common/storagelink.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "storagelink.h" #include <vespa/storageapi/messageapi/storagecommand.h> @@ -14,6 +14,23 @@ using namespace storage::api; namespace storage { +StorageLink::StorageLink(const std::string& name, + MsgDownOnFlush allow_msg_down_during_flushing, + MsgUpOnClosed allow_msg_up_during_closed) + : _name(name), + _up(nullptr), + _down(), + _state(CREATED), + _msg_down_during_flushing(allow_msg_down_during_flushing), + _msg_up_during_closed(allow_msg_up_during_closed) +{ +} + +StorageLink::StorageLink(const std::string& name) + : StorageLink(name, MsgDownOnFlush::Disallowed, MsgUpOnClosed::Disallowed) +{ +} + StorageLink::~StorageLink() { LOG(debug, "Destructing link %s.", toString().c_str()); } @@ -129,9 +146,15 @@ void StorageLink::sendDown(const StorageMessage::SP& msg) case CLOSING: case FLUSHINGDOWN: break; + case FLUSHINGUP: + if (_msg_down_during_flushing == MsgDownOnFlush::Allowed) { + break; + } + [[fallthrough]]; default: - LOG(error, "Link %s trying to send %s down while in state %s", - toString().c_str(), msg->toString().c_str(), stateToString(getState())); + LOG(error, "Link %s trying to send %s down while in state %s. Stacktrace: %s", + toString().c_str(), msg->toString().c_str(), stateToString(getState()), + vespalib::getStackTrace(0).c_str()); assert(false); } assert(msg); @@ -171,9 +194,15 @@ void StorageLink::sendUp(const std::shared_ptr<StorageMessage> & msg) case FLUSHINGDOWN: case FLUSHINGUP: break; + case CLOSED: + if (_msg_up_during_closed == MsgUpOnClosed::Allowed) { + break; + } + [[fallthrough]]; default: - LOG(error, "Link %s trying to send %s up while in state %s", - toString().c_str(), msg->toString(true).c_str(), stateToString(getState())); + LOG(error, "Link %s trying to send %s up while in state %s. Stacktrace: %s", + toString().c_str(), msg->toString(true).c_str(), stateToString(getState()), + vespalib::getStackTrace(0).c_str()); assert(false); } assert(msg); @@ -281,15 +310,14 @@ Queue::getNext(std::shared_ptr<api::StorageMessage>& msg, vespalib::duration tim void Queue::enqueue(std::shared_ptr<api::StorageMessage> msg) { - { - std::lock_guard sync(_lock); - _queue.emplace(std::move(msg)); - } + std::lock_guard sync(_lock); + _queue.emplace(std::move(msg)); _cond.notify_one(); } void Queue::signal() { + std::lock_guard sync(_lock); _cond.notify_one(); } diff --git a/storage/src/vespa/storage/common/storagelink.h b/storage/src/vespa/storage/common/storagelink.h index 5e176c10fbc..3ff75df9448 100644 --- a/storage/src/vespa/storage/common/storagelink.h +++ b/storage/src/vespa/storage/common/storagelink.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * @class storage::StorageLink * @ingroup common @@ -41,29 +41,41 @@ public: enum State { CREATED, OPENED, CLOSING, FLUSHINGDOWN, FLUSHINGUP, CLOSED }; + enum class MsgDownOnFlush { Allowed, Disallowed }; + enum class MsgUpOnClosed { Allowed, Disallowed }; + private: - std::string _name; - StorageLink* _up; + const std::string _name; + StorageLink* _up; std::unique_ptr<StorageLink> _down; - std::atomic<State> _state; + std::atomic<State> _state; + const MsgDownOnFlush _msg_down_during_flushing; + const MsgUpOnClosed _msg_up_during_closed; public: + StorageLink(const std::string& name, + MsgDownOnFlush allow_msg_down_during_flushing, + MsgUpOnClosed allow_msg_up_during_closed); + explicit StorageLink(const std::string& name); + StorageLink(const StorageLink &) = delete; StorageLink & operator = (const StorageLink &) = delete; - StorageLink(const std::string& name) - : _name(name), _up(0), _down(), _state(CREATED) {} ~StorageLink() override; - const std::string& getName() const { return _name; } - bool isTop() const { return (_up == 0); } - bool isBottom() const { return (_down.get() == 0); } - unsigned int size() const { return (isBottom() ? 1 : _down->size() + 1); } + const std::string& getName() const noexcept { return _name; } + [[nodiscard]] bool isTop() const noexcept { return !_up; } + [[nodiscard]] bool isBottom() const noexcept { return !_down; } + [[nodiscard]] unsigned int size() const noexcept { + return (isBottom() ? 1 : _down->size() + 1); + } /** Adds the link to the end of the chain. */ void push_back(StorageLink::UP); /** Get the current state of the storage link. */ - State getState() const noexcept { return _state.load(std::memory_order_relaxed); } + [[nodiscard]] State getState() const noexcept { + return _state.load(std::memory_order_relaxed); + } /** * Called by storage server after the storage chain have been created. diff --git a/storage/src/vespa/storage/common/storagelinkqueued.cpp b/storage/src/vespa/storage/common/storagelinkqueued.cpp index 2f116738c28..c08eedd8ff0 100644 --- a/storage/src/vespa/storage/common/storagelinkqueued.cpp +++ b/storage/src/vespa/storage/common/storagelinkqueued.cpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "storagelinkqueued.hpp" #include <vespa/log/log.h> @@ -10,7 +10,6 @@ StorageLinkQueued::StorageLinkQueued(const std::string& name, framework::Compone : StorageLink(name), _compReg(cr), _replyDispatcher(*this), - _commandDispatcher(*this), _closeState(0) { } @@ -25,23 +24,6 @@ StorageLinkQueued::~StorageLinkQueued() } } -void StorageLinkQueued::dispatchDown( - const std::shared_ptr<api::StorageMessage>& msg) -{ - // Verify acceptable state to send messages down - switch(getState()) { - case OPENED: - case CLOSING: - case FLUSHINGDOWN: - break; - default: - LOG(error, "Link %s trying to dispatch %s down while in state %u", - toString().c_str(), msg->toString().c_str(), getState()); - assert(false); - } - _commandDispatcher.add(msg); -} - void StorageLinkQueued::dispatchUp( const std::shared_ptr<api::StorageMessage>& msg) { diff --git a/storage/src/vespa/storage/common/storagelinkqueued.h b/storage/src/vespa/storage/common/storagelinkqueued.h index 17a344a368a..3f7a831d9fe 100644 --- a/storage/src/vespa/storage/common/storagelinkqueued.h +++ b/storage/src/vespa/storage/common/storagelinkqueued.h @@ -1,25 +1,18 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** - * @class storage::StorageLinkQueued - * @ingroup common - * - * @brief Storage link with a message queue. - * - * Storage link implementing separate threads for dispatching messages. + * Storage link implementing a separate thread for dispatching replies. * Using this class you can use dispatchReply instead of sendReply to have the * replies sent through another thread. - * - * @version $Id$ */ #pragma once #include "storagelink.h" #include <vespa/storageframework/generic/thread/runnable.h> +#include <condition_variable> #include <deque> #include <limits> #include <mutex> -#include <condition_variable> namespace storage { @@ -32,13 +25,7 @@ namespace framework { class StorageLinkQueued : public StorageLink { public: StorageLinkQueued(const std::string& name, framework::ComponentRegister& cr); - virtual ~StorageLinkQueued(); - - /** - * Add message to internal queue, to be dispatched downstream - * in separate thread. - */ - void dispatchDown(const std::shared_ptr<api::StorageMessage>&); + ~StorageLinkQueued() override; /** * Add message to internal queue, to be dispatched downstream @@ -48,14 +35,12 @@ public: /** Remember to call this method if you override it. */ void onClose() override { - _commandDispatcher.flush(); _closeState |= 1; } /** Remember to call this method if you override it. */ void onFlush(bool downwards) override { if (downwards) { - _commandDispatcher.flush(); _closeState |= 2; } else { _replyDispatcher.flush(); @@ -69,25 +54,25 @@ public: framework::ComponentRegister& getComponentRegister() { return _compReg; } private: - /** Common class to prevent need for duplicate code. */ template<typename Message> class Dispatcher : public framework::Runnable { protected: - StorageLinkQueued& _parent; - unsigned int _maxQueueSize; - std::mutex _sync; - std::condition_variable _syncCond; - std::deque< std::shared_ptr<Message> > _messages; - bool _replyDispatcher; + StorageLinkQueued& _parent; + unsigned int _maxQueueSize; + std::mutex _sync; + std::condition_variable _syncCond; + std::deque<std::shared_ptr<Message>> _messages; + bool _replyDispatcher; std::unique_ptr<framework::Component> _component; - std::unique_ptr<framework::Thread> _thread; - void terminate(); + std::unique_ptr<framework::Thread> _thread; + + void shutdown(); public: Dispatcher(StorageLinkQueued& parent, unsigned int maxQueueSize, bool replyDispatcher); - ~Dispatcher(); + ~Dispatcher() override; void start(); void run(framework::ThreadHandle&) override; @@ -98,10 +83,9 @@ private: virtual void send(const std::shared_ptr<Message> & ) = 0; }; - class ReplyDispatcher : public Dispatcher<api::StorageMessage> - { + class ReplyDispatcher : public Dispatcher<api::StorageMessage> { public: - ReplyDispatcher(StorageLinkQueued& parent) + explicit ReplyDispatcher(StorageLinkQueued& parent) : Dispatcher<api::StorageMessage>( parent, std::numeric_limits<unsigned int>::max(), true) { @@ -109,30 +93,11 @@ private: void send(const std::shared_ptr<api::StorageMessage> & reply) override { _parent.sendUp(reply); } - ~ReplyDispatcher() { terminate(); } - }; - - class CommandDispatcher : public Dispatcher<api::StorageMessage> - { - public: - CommandDispatcher(StorageLinkQueued& parent) - : Dispatcher<api::StorageMessage>( - parent, std::numeric_limits<unsigned int>::max(), false) - { - } - ~CommandDispatcher() { terminate(); } - void send(const std::shared_ptr<api::StorageMessage> & command) override { - _parent.sendDown(command); - } }; framework::ComponentRegister& _compReg; - ReplyDispatcher _replyDispatcher; - CommandDispatcher _commandDispatcher; - uint16_t _closeState; - -protected: - ReplyDispatcher& getReplyDispatcher() { return _replyDispatcher; } + ReplyDispatcher _replyDispatcher; + uint16_t _closeState; }; } diff --git a/storage/src/vespa/storage/common/storagelinkqueued.hpp b/storage/src/vespa/storage/common/storagelinkqueued.hpp index 01b6ae4a370..7c477bfa84d 100644 --- a/storage/src/vespa/storage/common/storagelinkqueued.hpp +++ b/storage/src/vespa/storage/common/storagelinkqueued.hpp @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once @@ -14,11 +14,11 @@ namespace storage { template<typename Message> void -StorageLinkQueued::Dispatcher<Message>::terminate() { +StorageLinkQueued::Dispatcher<Message>::shutdown() { if (_thread) { _thread->interrupt(); { - std::lock_guard<std::mutex> guard(_sync); + std::lock_guard guard(_sync); _syncCond.notify_one(); } _thread->join(); @@ -43,7 +43,7 @@ StorageLinkQueued::Dispatcher<Message>::Dispatcher(StorageLinkQueued& parent, un template<typename Message> StorageLinkQueued::Dispatcher<Message>::~Dispatcher() { - terminate(); + shutdown(); } template<typename Message> @@ -56,7 +56,7 @@ void StorageLinkQueued::Dispatcher<Message>::start() template<typename Message> void StorageLinkQueued::Dispatcher<Message>::add(const std::shared_ptr<Message>& m) { - std::unique_lock<std::mutex> guard(_sync); + std::unique_lock guard(_sync); if ( ! _thread) start(); while ((_messages.size() > _maxQueueSize) && !_thread->interrupted()) { @@ -73,7 +73,7 @@ void StorageLinkQueued::Dispatcher<Message>::run(framework::ThreadHandle& h) h.registerTick(framework::PROCESS_CYCLE); std::shared_ptr<Message> message; { - std::unique_lock<std::mutex> guard(_sync); + std::unique_lock guard(_sync); while (!h.interrupted() && _messages.empty()) { _syncCond.wait_for(guard, 100ms); h.registerTick(framework::WAIT_CYCLE); @@ -94,7 +94,7 @@ void StorageLinkQueued::Dispatcher<Message>::run(framework::ThreadHandle& h) { // Since flush() only waits for stack to be empty, we must // pop stack AFTER send have been called. - std::lock_guard<std::mutex> guard(_sync); + std::lock_guard guard(_sync); _messages.pop_front(); _syncCond.notify_one(); } @@ -106,7 +106,7 @@ template<typename Message> void StorageLinkQueued::Dispatcher<Message>::flush() { using namespace std::chrono_literals; - std::unique_lock<std::mutex> guard(_sync); + std::unique_lock guard(_sync); while (!_messages.empty()) { _syncCond.wait_for(guard, 100ms); } diff --git a/storage/src/vespa/storage/common/visitorfactory.h b/storage/src/vespa/storage/common/visitorfactory.h index 8ee7577a9e3..1f18ace3095 100644 --- a/storage/src/vespa/storage/common/visitorfactory.h +++ b/storage/src/vespa/storage/common/visitorfactory.h @@ -1,4 +1,4 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. /** * \class storage::VisitorFactory * @@ -12,6 +12,7 @@ namespace storage { +class StorageComponent; class Visitor; class VisitorEnvironment { |