From 410f71cf8b953a0bbe5b6f103bebc61106961761 Mon Sep 17 00:00:00 2001 From: Yuan Jing Vincent Yan Date: Tue, 30 Jul 2024 10:01:13 -0400 Subject: [PATCH] mqbconf.xsd: Move flag to publish appId metircs from mqbcfg.xsd (#353) * mqbconf.xsd: Add flag to publish appId metircs Signed-off-by: Yuan Jing Vincent Yan * mqbcfg.xsd: Remove flag to publish appId metircs Signed-off-by: Yuan Jing Vincent Yan * mqbstat::QueueStatsDomain: Use domain flag for publish appId metrics Signed-off-by: Yuan Jing Vincent Yan * docs plugins.md: Remove appIdTagDomains Signed-off-by: Yuan Jing Vincent Yan * configurator/__init__.py: Clean up removed config option Signed-off-by: Yuan Jing Vincent Yan * mqbconf, mqbcfg: Generated Python code Signed-off-by: Yuan Jing Vincent Yan * test_admin_client.py: Use new publish appId metrics flag Signed-off-by: Yuan Jing Vincent Yan --------- Signed-off-by: Yuan Jing Vincent Yan --- docs/docs/features/plugins.md | 11 +- src/groups/mqb/mqbcfg/mqbcfg.xsd | 1 - src/groups/mqb/mqbcfg/mqbcfg_messages.cpp | 27 +- src/groups/mqb/mqbcfg/mqbcfg_messages.h | 75 +- src/groups/mqb/mqbconfm/mqbconf.xsd | 7 +- src/groups/mqb/mqbconfm/mqbconfm_messages.cpp | 313 +- src/groups/mqb/mqbconfm/mqbconfm_messages.h | 2972 +++++++---------- src/groups/mqb/mqbstat/mqbstat_queuestats.cpp | 33 +- src/integration-tests/test_admin_client.py | 7 +- .../blazingmq/dev/configurator/__init__.py | 1 - .../blazingmq/dev/it/tweaks/generated.py | 175 +- src/python/blazingmq/schemas/mqbcfg.py | 9 - src/python/blazingmq/schemas/mqbconf.py | 13 +- 13 files changed, 1532 insertions(+), 2112 deletions(-) diff --git a/docs/docs/features/plugins.md b/docs/docs/features/plugins.md index 920f8d766..87bfaff33 100644 --- a/docs/docs/features/plugins.md +++ b/docs/docs/features/plugins.md @@ -35,7 +35,6 @@ By default, plugin is disabled. To enable and configure it, edit `bmqbrkcfg.json "appConfig": { "stats": { "snapshotInterval": 1, - "appIdTagDomains": ["", ""], "plugins": [ ... { @@ -44,7 +43,7 @@ By default, plugin is disabled. To enable and configure it, edit `bmqbrkcfg.json "prometheusSpecific": { "host": "localhost", "port": 9091, - "mode": "E_PUSH" + "mode": "E_PUSH" } } ], @@ -59,14 +58,6 @@ where - `snapshotInterval`: represents how often stats are computed by broker internally, in seconds (typically every 1s); - - [OPTIONAL] `appIdTagDomains`: used for troubleshooting, represents - the list of *fanout* mode domains for which *applicationId* tag will be - applied on `queue.confirm_time_max` and `queue.queue_time_max` metrics. - It can be *extremely* useful to detect slow responding consumer by - *applicationId*. If this setting is omitted/empty, or domain name not - in the list - *applicationId* tag will not be applied;
- **NOTE**: This feature is available for all BlazingMQ broker roles except - *PROXY*; 2. Prometheus plugin configuration diff --git a/src/groups/mqb/mqbcfg/mqbcfg.xsd b/src/groups/mqb/mqbcfg/mqbcfg.xsd index 0de03e584..3db430cfe 100644 --- a/src/groups/mqb/mqbcfg/mqbcfg.xsd +++ b/src/groups/mqb/mqbcfg/mqbcfg.xsd @@ -128,7 +128,6 @@ - diff --git a/src/groups/mqb/mqbcfg/mqbcfg_messages.cpp b/src/groups/mqb/mqbcfg/mqbcfg_messages.cpp index 08a4b0638..1e10ec4a8 100644 --- a/src/groups/mqb/mqbcfg/mqbcfg_messages.cpp +++ b/src/groups/mqb/mqbcfg/mqbcfg_messages.cpp @@ -1,4 +1,4 @@ -// Copyright 2018-2024 Bloomberg Finance L.P. +// Copyright 2014-2024 Bloomberg Finance L.P. // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -4984,11 +4984,6 @@ const bdlat_AttributeInfo StatsConfig::ATTRIBUTE_INFO_ARRAY[] = { sizeof("snapshotInterval") - 1, "", bdlat_FormattingMode::e_DEC}, - {ATTRIBUTE_ID_APP_ID_TAG_DOMAINS, - "appIdTagDomains", - sizeof("appIdTagDomains") - 1, - "", - bdlat_FormattingMode::e_TEXT}, {ATTRIBUTE_ID_PLUGINS, "plugins", sizeof("plugins") - 1, @@ -5005,7 +5000,7 @@ const bdlat_AttributeInfo StatsConfig::ATTRIBUTE_INFO_ARRAY[] = { const bdlat_AttributeInfo* StatsConfig::lookupAttributeInfo(const char* name, int nameLength) { - for (int i = 0; i < 4; ++i) { + for (int i = 0; i < 3; ++i) { const bdlat_AttributeInfo& attributeInfo = StatsConfig::ATTRIBUTE_INFO_ARRAY[i]; @@ -5023,8 +5018,6 @@ const bdlat_AttributeInfo* StatsConfig::lookupAttributeInfo(int id) switch (id) { case ATTRIBUTE_ID_SNAPSHOT_INTERVAL: return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SNAPSHOT_INTERVAL]; - case ATTRIBUTE_ID_APP_ID_TAG_DOMAINS: - return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_ID_TAG_DOMAINS]; case ATTRIBUTE_ID_PLUGINS: return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PLUGINS]; case ATTRIBUTE_ID_PRINTER: @@ -5036,8 +5029,7 @@ const bdlat_AttributeInfo* StatsConfig::lookupAttributeInfo(int id) // CREATORS StatsConfig::StatsConfig(bslma::Allocator* basicAllocator) -: d_appIdTagDomains(basicAllocator) -, d_plugins(basicAllocator) +: d_plugins(basicAllocator) , d_printer(basicAllocator) , d_snapshotInterval(DEFAULT_INITIALIZER_SNAPSHOT_INTERVAL) { @@ -5045,8 +5037,7 @@ StatsConfig::StatsConfig(bslma::Allocator* basicAllocator) StatsConfig::StatsConfig(const StatsConfig& original, bslma::Allocator* basicAllocator) -: d_appIdTagDomains(original.d_appIdTagDomains, basicAllocator) -, d_plugins(original.d_plugins, basicAllocator) +: d_plugins(original.d_plugins, basicAllocator) , d_printer(original.d_printer, basicAllocator) , d_snapshotInterval(original.d_snapshotInterval) { @@ -5055,8 +5046,7 @@ StatsConfig::StatsConfig(const StatsConfig& original, #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) StatsConfig::StatsConfig(StatsConfig&& original) noexcept -: d_appIdTagDomains(bsl::move(original.d_appIdTagDomains)), - d_plugins(bsl::move(original.d_plugins)), +: d_plugins(bsl::move(original.d_plugins)), d_printer(bsl::move(original.d_printer)), d_snapshotInterval(bsl::move(original.d_snapshotInterval)) { @@ -5064,8 +5054,7 @@ StatsConfig::StatsConfig(StatsConfig&& original) noexcept StatsConfig::StatsConfig(StatsConfig&& original, bslma::Allocator* basicAllocator) -: d_appIdTagDomains(bsl::move(original.d_appIdTagDomains), basicAllocator) -, d_plugins(bsl::move(original.d_plugins), basicAllocator) +: d_plugins(bsl::move(original.d_plugins), basicAllocator) , d_printer(bsl::move(original.d_printer), basicAllocator) , d_snapshotInterval(bsl::move(original.d_snapshotInterval)) { @@ -5082,7 +5071,6 @@ StatsConfig& StatsConfig::operator=(const StatsConfig& rhs) { if (this != &rhs) { d_snapshotInterval = rhs.d_snapshotInterval; - d_appIdTagDomains = rhs.d_appIdTagDomains; d_plugins = rhs.d_plugins; d_printer = rhs.d_printer; } @@ -5096,7 +5084,6 @@ StatsConfig& StatsConfig::operator=(StatsConfig&& rhs) { if (this != &rhs) { d_snapshotInterval = bsl::move(rhs.d_snapshotInterval); - d_appIdTagDomains = bsl::move(rhs.d_appIdTagDomains); d_plugins = bsl::move(rhs.d_plugins); d_printer = bsl::move(rhs.d_printer); } @@ -5108,7 +5095,6 @@ StatsConfig& StatsConfig::operator=(StatsConfig&& rhs) void StatsConfig::reset() { d_snapshotInterval = DEFAULT_INITIALIZER_SNAPSHOT_INTERVAL; - bdlat_ValueTypeFunctions::reset(&d_appIdTagDomains); bdlat_ValueTypeFunctions::reset(&d_plugins); bdlat_ValueTypeFunctions::reset(&d_printer); } @@ -5121,7 +5107,6 @@ StatsConfig::print(bsl::ostream& stream, int level, int spacesPerLevel) const bslim::Printer printer(&stream, level, spacesPerLevel); printer.start(); printer.printAttribute("snapshotInterval", this->snapshotInterval()); - printer.printAttribute("appIdTagDomains", this->appIdTagDomains()); printer.printAttribute("plugins", this->plugins()); printer.printAttribute("printer", this->printer()); printer.end(); diff --git a/src/groups/mqb/mqbcfg/mqbcfg_messages.h b/src/groups/mqb/mqbcfg/mqbcfg_messages.h index 8e1d33d1b..cecfcc088 100644 --- a/src/groups/mqb/mqbcfg/mqbcfg_messages.h +++ b/src/groups/mqb/mqbcfg/mqbcfg_messages.h @@ -1,4 +1,4 @@ -// Copyright 2018-2024 Bloomberg Finance L.P. +// Copyright 2014-2024 Bloomberg Finance L.P. // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -7922,7 +7922,6 @@ namespace mqbcfg { class StatsConfig { // INSTANCE DATA - bsl::vector d_appIdTagDomains; bsl::vector d_plugins; StatsPrinterConfig d_printer; int d_snapshotInterval; @@ -7931,24 +7930,20 @@ class StatsConfig { template void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; - bool isEqualTo(const StatsConfig& rhs) const; - public: // TYPES enum { - ATTRIBUTE_ID_SNAPSHOT_INTERVAL = 0, - ATTRIBUTE_ID_APP_ID_TAG_DOMAINS = 1, - ATTRIBUTE_ID_PLUGINS = 2, - ATTRIBUTE_ID_PRINTER = 3 + ATTRIBUTE_ID_SNAPSHOT_INTERVAL = 0, + ATTRIBUTE_ID_PLUGINS = 1, + ATTRIBUTE_ID_PRINTER = 2 }; - enum { NUM_ATTRIBUTES = 4 }; + enum { NUM_ATTRIBUTES = 3 }; enum { - ATTRIBUTE_INDEX_SNAPSHOT_INTERVAL = 0, - ATTRIBUTE_INDEX_APP_ID_TAG_DOMAINS = 1, - ATTRIBUTE_INDEX_PLUGINS = 2, - ATTRIBUTE_INDEX_PRINTER = 3 + ATTRIBUTE_INDEX_SNAPSHOT_INTERVAL = 0, + ATTRIBUTE_INDEX_PLUGINS = 1, + ATTRIBUTE_INDEX_PRINTER = 2 }; // CONSTANTS @@ -8052,10 +8047,6 @@ class StatsConfig { // Return a reference to the modifiable "SnapshotInterval" attribute of // this object. - bsl::vector& appIdTagDomains(); - // Return a reference to the modifiable "AppIdTagDomains" attribute of - // this object. - bsl::vector& plugins(); // Return a reference to the modifiable "Plugins" attribute of this // object. @@ -8110,10 +8101,6 @@ class StatsConfig { int snapshotInterval() const; // Return the value of the "SnapshotInterval" attribute of this object. - const bsl::vector& appIdTagDomains() const; - // Return a reference offering non-modifiable access to the - // "AppIdTagDomains" attribute of this object. - const bsl::vector& plugins() const; // Return a reference offering non-modifiable access to the "Plugins" // attribute of this object. @@ -8128,7 +8115,9 @@ class StatsConfig { // have the same value, and 'false' otherwise. Two attribute objects // have the same value if each respective attribute has the same value. { - return lhs.isEqualTo(rhs); + return lhs.snapshotInterval() == rhs.snapshotInterval() && + lhs.plugins() == rhs.plugins() && + lhs.printer() == rhs.printer(); } friend bool operator!=(const StatsConfig& lhs, const StatsConfig& rhs) @@ -16387,19 +16376,10 @@ void StatsConfig::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { using bslh::hashAppend; hashAppend(hashAlgorithm, this->snapshotInterval()); - hashAppend(hashAlgorithm, this->appIdTagDomains()); hashAppend(hashAlgorithm, this->plugins()); hashAppend(hashAlgorithm, this->printer()); } -inline bool StatsConfig::isEqualTo(const StatsConfig& rhs) const -{ - return this->snapshotInterval() == rhs.snapshotInterval() && - this->appIdTagDomains() == rhs.appIdTagDomains() && - this->plugins() == rhs.plugins() && - this->printer() == rhs.printer(); -} - // CLASS METHODS // MANIPULATORS template @@ -16413,13 +16393,6 @@ int StatsConfig::manipulateAttributes(t_MANIPULATOR& manipulator) return ret; } - ret = manipulator( - &d_appIdTagDomains, - ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_ID_TAG_DOMAINS]); - if (ret) { - return ret; - } - ret = manipulator(&d_plugins, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PLUGINS]); if (ret) { @@ -16446,11 +16419,6 @@ int StatsConfig::manipulateAttribute(t_MANIPULATOR& manipulator, int id) &d_snapshotInterval, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SNAPSHOT_INTERVAL]); } - case ATTRIBUTE_ID_APP_ID_TAG_DOMAINS: { - return manipulator( - &d_appIdTagDomains, - ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_ID_TAG_DOMAINS]); - } case ATTRIBUTE_ID_PLUGINS: { return manipulator(&d_plugins, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PLUGINS]); @@ -16484,11 +16452,6 @@ inline int& StatsConfig::snapshotInterval() return d_snapshotInterval; } -inline bsl::vector& StatsConfig::appIdTagDomains() -{ - return d_appIdTagDomains; -} - inline bsl::vector& StatsConfig::plugins() { return d_plugins; @@ -16511,12 +16474,6 @@ int StatsConfig::accessAttributes(t_ACCESSOR& accessor) const return ret; } - ret = accessor(d_appIdTagDomains, - ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_ID_TAG_DOMAINS]); - if (ret) { - return ret; - } - ret = accessor(d_plugins, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PLUGINS]); if (ret) { return ret; @@ -16541,11 +16498,6 @@ int StatsConfig::accessAttribute(t_ACCESSOR& accessor, int id) const d_snapshotInterval, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_SNAPSHOT_INTERVAL]); } - case ATTRIBUTE_ID_APP_ID_TAG_DOMAINS: { - return accessor( - d_appIdTagDomains, - ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_ID_TAG_DOMAINS]); - } case ATTRIBUTE_ID_PLUGINS: { return accessor(d_plugins, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PLUGINS]); @@ -16579,11 +16531,6 @@ inline int StatsConfig::snapshotInterval() const return d_snapshotInterval; } -inline const bsl::vector& StatsConfig::appIdTagDomains() const -{ - return d_appIdTagDomains; -} - inline const bsl::vector& StatsConfig::plugins() const { return d_plugins; diff --git a/src/groups/mqb/mqbconfm/mqbconf.xsd b/src/groups/mqb/mqbconfm/mqbconf.xsd index 6b191750d..d41238a35 100644 --- a/src/groups/mqb/mqbconfm/mqbconf.xsd +++ b/src/groups/mqb/mqbconfm/mqbconf.xsd @@ -270,11 +270,14 @@ Configuration for a fanout queue. - appIDs.: List of appIDs authorized to consume from the queue. + appIDs.............: List of appIDs authorized to consume from the + queue. + publishAppIdMetrics: Whether to publish appId metrics. - + + diff --git a/src/groups/mqb/mqbconfm/mqbconfm_messages.cpp b/src/groups/mqb/mqbconfm/mqbconfm_messages.cpp index b20246964..6487fe2c4 100644 --- a/src/groups/mqb/mqbconfm/mqbconfm_messages.cpp +++ b/src/groups/mqb/mqbconfm/mqbconfm_messages.cpp @@ -1,4 +1,4 @@ -// Copyright 2014-2023 Bloomberg Finance L.P. +// Copyright 2014-2024 Bloomberg Finance L.P. // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -659,36 +659,8 @@ const bdlat_AttributeInfo* FileBackedStorage::lookupAttributeInfo(int id) // CREATORS -FileBackedStorage::FileBackedStorage() -{ -} - -FileBackedStorage::FileBackedStorage(const FileBackedStorage& original) -{ - (void)original; -} - -FileBackedStorage::~FileBackedStorage() -{ -} - // MANIPULATORS -FileBackedStorage& FileBackedStorage::operator=(const FileBackedStorage& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -FileBackedStorage& FileBackedStorage::operator=(FileBackedStorage&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void FileBackedStorage::reset() { } @@ -727,36 +699,8 @@ const bdlat_AttributeInfo* InMemoryStorage::lookupAttributeInfo(int id) // CREATORS -InMemoryStorage::InMemoryStorage() -{ -} - -InMemoryStorage::InMemoryStorage(const InMemoryStorage& original) -{ - (void)original; -} - -InMemoryStorage::~InMemoryStorage() -{ -} - // MANIPULATORS -InMemoryStorage& InMemoryStorage::operator=(const InMemoryStorage& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -InMemoryStorage& InMemoryStorage::operator=(InMemoryStorage&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void InMemoryStorage::reset() { } @@ -845,47 +789,8 @@ Limits::Limits() { } -Limits::Limits(const Limits& original) -: d_messagesWatermarkRatio(original.d_messagesWatermarkRatio) -, d_bytesWatermarkRatio(original.d_bytesWatermarkRatio) -, d_messages(original.d_messages) -, d_bytes(original.d_bytes) -{ -} - -Limits::~Limits() -{ -} - // MANIPULATORS -Limits& Limits::operator=(const Limits& rhs) -{ - if (this != &rhs) { - d_messages = rhs.d_messages; - d_messagesWatermarkRatio = rhs.d_messagesWatermarkRatio; - d_bytes = rhs.d_bytes; - d_bytesWatermarkRatio = rhs.d_bytesWatermarkRatio; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -Limits& Limits::operator=(Limits&& rhs) -{ - if (this != &rhs) { - d_messages = bsl::move(rhs.d_messages); - d_messagesWatermarkRatio = bsl::move(rhs.d_messagesWatermarkRatio); - d_bytes = bsl::move(rhs.d_bytes); - d_bytesWatermarkRatio = bsl::move(rhs.d_bytesWatermarkRatio); - } - - return *this; -} -#endif - void Limits::reset() { bdlat_ValueTypeFunctions::reset(&d_messages); @@ -981,44 +886,8 @@ MsgGroupIdConfig::MsgGroupIdConfig() { } -MsgGroupIdConfig::MsgGroupIdConfig(const MsgGroupIdConfig& original) -: d_ttlSeconds(original.d_ttlSeconds) -, d_maxGroups(original.d_maxGroups) -, d_rebalance(original.d_rebalance) -{ -} - -MsgGroupIdConfig::~MsgGroupIdConfig() -{ -} - // MANIPULATORS -MsgGroupIdConfig& MsgGroupIdConfig::operator=(const MsgGroupIdConfig& rhs) -{ - if (this != &rhs) { - d_rebalance = rhs.d_rebalance; - d_maxGroups = rhs.d_maxGroups; - d_ttlSeconds = rhs.d_ttlSeconds; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -MsgGroupIdConfig& MsgGroupIdConfig::operator=(MsgGroupIdConfig&& rhs) -{ - if (this != &rhs) { - d_rebalance = bsl::move(rhs.d_rebalance); - d_maxGroups = bsl::move(rhs.d_maxGroups); - d_ttlSeconds = bsl::move(rhs.d_ttlSeconds); - } - - return *this; -} -#endif - void MsgGroupIdConfig::reset() { d_rebalance = DEFAULT_INITIALIZER_REBALANCE; @@ -1069,39 +938,8 @@ QueueConsistencyEventual::lookupAttributeInfo(int id) // CREATORS -QueueConsistencyEventual::QueueConsistencyEventual() -{ -} - -QueueConsistencyEventual::QueueConsistencyEventual( - const QueueConsistencyEventual& original) -{ - (void)original; -} - -QueueConsistencyEventual::~QueueConsistencyEventual() -{ -} - // MANIPULATORS -QueueConsistencyEventual& -QueueConsistencyEventual::operator=(const QueueConsistencyEventual& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -QueueConsistencyEventual& -QueueConsistencyEventual::operator=(QueueConsistencyEventual&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void QueueConsistencyEventual::reset() { } @@ -1141,39 +979,8 @@ const bdlat_AttributeInfo* QueueConsistencyStrong::lookupAttributeInfo(int id) // CREATORS -QueueConsistencyStrong::QueueConsistencyStrong() -{ -} - -QueueConsistencyStrong::QueueConsistencyStrong( - const QueueConsistencyStrong& original) -{ - (void)original; -} - -QueueConsistencyStrong::~QueueConsistencyStrong() -{ -} - // MANIPULATORS -QueueConsistencyStrong& -QueueConsistencyStrong::operator=(const QueueConsistencyStrong& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -QueueConsistencyStrong& -QueueConsistencyStrong::operator=(QueueConsistencyStrong&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void QueueConsistencyStrong::reset() { } @@ -1213,37 +1020,8 @@ const bdlat_AttributeInfo* QueueModeBroadcast::lookupAttributeInfo(int id) // CREATORS -QueueModeBroadcast::QueueModeBroadcast() -{ -} - -QueueModeBroadcast::QueueModeBroadcast(const QueueModeBroadcast& original) -{ - (void)original; -} - -QueueModeBroadcast::~QueueModeBroadcast() -{ -} - // MANIPULATORS -QueueModeBroadcast& -QueueModeBroadcast::operator=(const QueueModeBroadcast& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -QueueModeBroadcast& QueueModeBroadcast::operator=(QueueModeBroadcast&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void QueueModeBroadcast::reset() { } @@ -1263,11 +1041,18 @@ bsl::ostream& QueueModeBroadcast::print(bsl::ostream& stream, int, int) const const char QueueModeFanout::CLASS_NAME[] = "QueueModeFanout"; +const bool QueueModeFanout::DEFAULT_INITIALIZER_PUBLISH_APP_ID_METRICS = false; + const bdlat_AttributeInfo QueueModeFanout::ATTRIBUTE_INFO_ARRAY[] = { {ATTRIBUTE_ID_APP_I_DS, "appIDs", sizeof("appIDs") - 1, "", + bdlat_FormattingMode::e_TEXT}, + {ATTRIBUTE_ID_PUBLISH_APP_ID_METRICS, + "publishAppIdMetrics", + sizeof("publishAppIdMetrics") - 1, + "", bdlat_FormattingMode::e_TEXT}}; // CLASS METHODS @@ -1275,7 +1060,7 @@ const bdlat_AttributeInfo QueueModeFanout::ATTRIBUTE_INFO_ARRAY[] = { const bdlat_AttributeInfo* QueueModeFanout::lookupAttributeInfo(const char* name, int nameLength) { - for (int i = 0; i < 1; ++i) { + for (int i = 0; i < 2; ++i) { const bdlat_AttributeInfo& attributeInfo = QueueModeFanout::ATTRIBUTE_INFO_ARRAY[i]; @@ -1293,6 +1078,8 @@ const bdlat_AttributeInfo* QueueModeFanout::lookupAttributeInfo(int id) switch (id) { case ATTRIBUTE_ID_APP_I_DS: return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_I_DS]; + case ATTRIBUTE_ID_PUBLISH_APP_ID_METRICS: + return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PUBLISH_APP_ID_METRICS]; default: return 0; } } @@ -1301,25 +1088,29 @@ const bdlat_AttributeInfo* QueueModeFanout::lookupAttributeInfo(int id) QueueModeFanout::QueueModeFanout(bslma::Allocator* basicAllocator) : d_appIDs(basicAllocator) +, d_publishAppIdMetrics(DEFAULT_INITIALIZER_PUBLISH_APP_ID_METRICS) { } QueueModeFanout::QueueModeFanout(const QueueModeFanout& original, bslma::Allocator* basicAllocator) : d_appIDs(original.d_appIDs, basicAllocator) +, d_publishAppIdMetrics(original.d_publishAppIdMetrics) { } #if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) QueueModeFanout::QueueModeFanout(QueueModeFanout&& original) noexcept -: d_appIDs(bsl::move(original.d_appIDs)) +: d_appIDs(bsl::move(original.d_appIDs)), + d_publishAppIdMetrics(bsl::move(original.d_publishAppIdMetrics)) { } QueueModeFanout::QueueModeFanout(QueueModeFanout&& original, bslma::Allocator* basicAllocator) : d_appIDs(bsl::move(original.d_appIDs), basicAllocator) +, d_publishAppIdMetrics(bsl::move(original.d_publishAppIdMetrics)) { } #endif @@ -1334,6 +1125,7 @@ QueueModeFanout& QueueModeFanout::operator=(const QueueModeFanout& rhs) { if (this != &rhs) { d_appIDs = rhs.d_appIDs; + d_publishAppIdMetrics = rhs.d_publishAppIdMetrics; } return *this; @@ -1345,6 +1137,7 @@ QueueModeFanout& QueueModeFanout::operator=(QueueModeFanout&& rhs) { if (this != &rhs) { d_appIDs = bsl::move(rhs.d_appIDs); + d_publishAppIdMetrics = bsl::move(rhs.d_publishAppIdMetrics); } return *this; @@ -1354,6 +1147,7 @@ QueueModeFanout& QueueModeFanout::operator=(QueueModeFanout&& rhs) void QueueModeFanout::reset() { bdlat_ValueTypeFunctions::reset(&d_appIDs); + d_publishAppIdMetrics = DEFAULT_INITIALIZER_PUBLISH_APP_ID_METRICS; } // ACCESSORS @@ -1365,6 +1159,7 @@ bsl::ostream& QueueModeFanout::print(bsl::ostream& stream, bslim::Printer printer(&stream, level, spacesPerLevel); printer.start(); printer.printAttribute("appIDs", this->appIDs()); + printer.printAttribute("publishAppIdMetrics", this->publishAppIdMetrics()); printer.end(); return stream; } @@ -1396,36 +1191,8 @@ const bdlat_AttributeInfo* QueueModePriority::lookupAttributeInfo(int id) // CREATORS -QueueModePriority::QueueModePriority() -{ -} - -QueueModePriority::QueueModePriority(const QueueModePriority& original) -{ - (void)original; -} - -QueueModePriority::~QueueModePriority() -{ -} - // MANIPULATORS -QueueModePriority& QueueModePriority::operator=(const QueueModePriority& rhs) -{ - (void)rhs; - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -QueueModePriority& QueueModePriority::operator=(QueueModePriority&& rhs) -{ - (void)rhs; - return *this; -} -#endif - void QueueModePriority::reset() { } @@ -3309,44 +3076,8 @@ StorageDefinition::StorageDefinition() { } -StorageDefinition::StorageDefinition(const StorageDefinition& original) -: d_config(original.d_config) -, d_domainLimits(original.d_domainLimits) -, d_queueLimits(original.d_queueLimits) -{ -} - -StorageDefinition::~StorageDefinition() -{ -} - // MANIPULATORS -StorageDefinition& StorageDefinition::operator=(const StorageDefinition& rhs) -{ - if (this != &rhs) { - d_domainLimits = rhs.d_domainLimits; - d_queueLimits = rhs.d_queueLimits; - d_config = rhs.d_config; - } - - return *this; -} - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) -StorageDefinition& StorageDefinition::operator=(StorageDefinition&& rhs) -{ - if (this != &rhs) { - d_domainLimits = bsl::move(rhs.d_domainLimits); - d_queueLimits = bsl::move(rhs.d_queueLimits); - d_config = bsl::move(rhs.d_config); - } - - return *this; -} -#endif - void StorageDefinition::reset() { bdlat_ValueTypeFunctions::reset(&d_domainLimits); @@ -4251,10 +3982,10 @@ const char* DomainVariant::selectionName() const } // close package namespace } // close enterprise namespace -// GENERATED BY BLP_BAS_CODEGEN_2023.11.25 +// GENERATED BY @BLP_BAS_CODEGEN_VERSION@ // USING bas_codegen.pl -m msg --noAggregateConversion --noExternalization // --noIdent --package mqbconfm --msgComponent messages mqbconf.xsd SERVICE -// SERVICE VERSION bmqconf:183474-1.0 +// VERSION bmqconf:183474-1.0 // ---------------------------------------------------------------------------- // NOTICE: // Copyright 2024 Bloomberg Finance L.P. All rights reserved. diff --git a/src/groups/mqb/mqbconfm/mqbconfm_messages.h b/src/groups/mqb/mqbconfm/mqbconfm_messages.h index a7501fa1f..828f0fae5 100644 --- a/src/groups/mqb/mqbconfm/mqbconfm_messages.h +++ b/src/groups/mqb/mqbconfm/mqbconfm_messages.h @@ -1,4 +1,4 @@ -// Copyright 2014-2023 Bloomberg Finance L.P. +// Copyright 2014-2024 Bloomberg Finance L.P. // SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -147,6 +147,10 @@ class BrokerIdentity { bsl::string d_hostTags; bsl::string d_brokerVersion; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -325,30 +329,45 @@ class BrokerIdentity { const bsl::string& brokerVersion() const; // Return a reference offering non-modifiable access to the // "BrokerVersion" attribute of this object. -}; - -// FREE OPERATORS -inline bool operator==(const BrokerIdentity& lhs, const BrokerIdentity& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const BrokerIdentity& lhs, const BrokerIdentity& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. -inline bsl::ostream& operator<<(bsl::ostream& stream, - const BrokerIdentity& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. - -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const BrokerIdentity& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'BrokerIdentity'. + // HIDDEN FRIENDS + friend bool operator==(const BrokerIdentity& lhs, + const BrokerIdentity& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.hostName() == rhs.hostName() && + lhs.hostTags() == rhs.hostTags() && + lhs.brokerVersion() == rhs.brokerVersion(); + } + + friend bool operator!=(const BrokerIdentity& lhs, + const BrokerIdentity& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const BrokerIdentity& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const BrokerIdentity& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'BrokerIdentity'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -532,30 +551,46 @@ class DomainConfigRaw { const bsl::string& config() const; // Return a reference offering non-modifiable access to the "Config" // attribute of this object. -}; - -// FREE OPERATORS -inline bool operator==(const DomainConfigRaw& lhs, const DomainConfigRaw& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const DomainConfigRaw& lhs, const DomainConfigRaw& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const DomainConfigRaw& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const DomainConfigRaw& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'DomainConfigRaw'. + // HIDDEN FRIENDS + friend bool operator==(const DomainConfigRaw& lhs, + const DomainConfigRaw& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.domainName() == rhs.domainName() && + lhs.config() == rhs.config(); + } + + friend bool operator!=(const DomainConfigRaw& lhs, + const DomainConfigRaw& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DomainConfigRaw& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const DomainConfigRaw& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DomainConfigRaw'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.domainName()); + hashAppend(hashAlg, object.config()); + } +}; } // close package namespace @@ -741,30 +776,45 @@ class DomainResolver { const bsl::string& cluster() const; // Return a reference offering non-modifiable access to the "Cluster" // attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const DomainResolver& lhs, const DomainResolver& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const DomainResolver& lhs, const DomainResolver& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const DomainResolver& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. - -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const DomainResolver& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'DomainResolver'. + // HIDDEN FRIENDS + friend bool operator==(const DomainResolver& lhs, + const DomainResolver& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.name() == rhs.name() && lhs.cluster() == rhs.cluster(); + } + + friend bool operator!=(const DomainResolver& lhs, + const DomainResolver& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DomainResolver& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const DomainResolver& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DomainResolver'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.name()); + hashAppend(hashAlg, object.cluster()); + } +}; } // close package namespace @@ -820,13 +870,15 @@ struct ExpressionVersion { // Write to the specified 'stream' the string representation of // the specified enumeration 'value'. Return a reference to // the modifiable 'stream'. -}; -// FREE OPERATORS -inline bsl::ostream& operator<<(bsl::ostream& stream, - ExpressionVersion::Value rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + // HIDDEN FRIENDS + friend bsl::ostream& operator<<(bsl::ostream& stream, Value rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return ExpressionVersion::print(stream, rhs); + } +}; } // close package namespace @@ -1010,29 +1062,40 @@ class Failure { const bsl::string& message() const; // Return a reference offering non-modifiable access to the "Message" // attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const Failure& lhs, const Failure& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. + // HIDDEN FRIENDS + friend bool operator==(const Failure& lhs, const Failure& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.code() == rhs.code() && lhs.message() == rhs.message(); + } -inline bool operator!=(const Failure& lhs, const Failure& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. + friend bool operator!=(const Failure& lhs, const Failure& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Failure& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const Failure& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Failure& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Failure'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Failure& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Failure'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.code()); + hashAppend(hashAlg, object.message()); + } +}; } // close package namespace @@ -1071,37 +1134,8 @@ class FileBackedStorage { // exists, and 0 otherwise. // CREATORS - FileBackedStorage(); - // Create an object of type 'FileBackedStorage' having the default - // value. - - FileBackedStorage(const FileBackedStorage& original); - // Create an object of type 'FileBackedStorage' having the value of the - // specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - FileBackedStorage(FileBackedStorage&& original) = default; - // Create an object of type 'FileBackedStorage' having the value of the - // specified 'original' object. After performing this action, the - // 'original' object will be left in a valid, but unspecified state. -#endif - - ~FileBackedStorage(); - // Destroy this object. // MANIPULATORS - FileBackedStorage& operator=(const FileBackedStorage& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - FileBackedStorage& operator=(FileBackedStorage&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -1177,32 +1211,39 @@ class FileBackedStorage { // information structure. Return the value returned from the // invocation of 'accessor' if 'name' identifies an attribute of this // class, and -1 otherwise. -}; -// FREE OPERATORS -inline bool operator==(const FileBackedStorage& lhs, - const FileBackedStorage& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const FileBackedStorage& lhs, - const FileBackedStorage& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const FileBackedStorage& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + // HIDDEN FRIENDS + friend bool operator==(const FileBackedStorage&, const FileBackedStorage&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const FileBackedStorage& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'FileBackedStorage'. + friend bool operator!=(const FileBackedStorage& lhs, + const FileBackedStorage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const FileBackedStorage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const FileBackedStorage&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'FileBackedStorage'. + { + } +}; } // close package namespace @@ -1241,36 +1282,8 @@ class InMemoryStorage { // exists, and 0 otherwise. // CREATORS - InMemoryStorage(); - // Create an object of type 'InMemoryStorage' having the default value. - - InMemoryStorage(const InMemoryStorage& original); - // Create an object of type 'InMemoryStorage' having the value of the - // specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - InMemoryStorage(InMemoryStorage&& original) = default; - // Create an object of type 'InMemoryStorage' having the value of the - // specified 'original' object. After performing this action, the - // 'original' object will be left in a valid, but unspecified state. -#endif - - ~InMemoryStorage(); - // Destroy this object. // MANIPULATORS - InMemoryStorage& operator=(const InMemoryStorage& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - InMemoryStorage& operator=(InMemoryStorage&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -1346,30 +1359,39 @@ class InMemoryStorage { // information structure. Return the value returned from the // invocation of 'accessor' if 'name' identifies an attribute of this // class, and -1 otherwise. -}; -// FREE OPERATORS -inline bool operator==(const InMemoryStorage& lhs, const InMemoryStorage& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. + // HIDDEN FRIENDS + friend bool operator==(const InMemoryStorage&, const InMemoryStorage&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } -inline bool operator!=(const InMemoryStorage& lhs, const InMemoryStorage& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. + friend bool operator!=(const InMemoryStorage& lhs, + const InMemoryStorage& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, - const InMemoryStorage& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, + const InMemoryStorage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const InMemoryStorage& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'InMemoryStorage'. + template + friend void hashAppend(t_HASH_ALGORITHM&, const InMemoryStorage&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'InMemoryStorage'. + { + } +}; } // close package namespace @@ -1399,6 +1421,12 @@ class Limits { bsls::Types::Int64 d_messages; bsls::Types::Int64 d_bytes; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Limits& rhs) const; + public: // TYPES enum { @@ -1442,33 +1470,7 @@ class Limits { Limits(); // Create an object of type 'Limits' having the default value. - Limits(const Limits& original); - // Create an object of type 'Limits' having the value of the specified - // 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - Limits(Limits&& original) = default; - // Create an object of type 'Limits' having the value of the specified - // 'original' object. After performing this action, the 'original' - // object will be left in a valid, but unspecified state. -#endif - - ~Limits(); - // Destroy this object. - // MANIPULATORS - Limits& operator=(const Limits& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - Limits& operator=(Limits&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -1574,29 +1576,38 @@ class Limits { double bytesWatermarkRatio() const; // Return the value of the "BytesWatermarkRatio" attribute of this // object. -}; -// FREE OPERATORS -inline bool operator==(const Limits& lhs, const Limits& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. + // HIDDEN FRIENDS + friend bool operator==(const Limits& lhs, const Limits& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const Limits& lhs, const Limits& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. + friend bool operator!=(const Limits& lhs, const Limits& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Limits& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const Limits& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Limits& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Limits'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Limits& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Limits'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -1631,6 +1642,10 @@ class MsgGroupIdConfig { int d_maxGroups; bool d_rebalance; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -1675,33 +1690,7 @@ class MsgGroupIdConfig { // Create an object of type 'MsgGroupIdConfig' having the default // value. - MsgGroupIdConfig(const MsgGroupIdConfig& original); - // Create an object of type 'MsgGroupIdConfig' having the value of the - // specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - MsgGroupIdConfig(MsgGroupIdConfig&& original) = default; - // Create an object of type 'MsgGroupIdConfig' having the value of the - // specified 'original' object. After performing this action, the - // 'original' object will be left in a valid, but unspecified state. -#endif - - ~MsgGroupIdConfig(); - // Destroy this object. - // MANIPULATORS - MsgGroupIdConfig& operator=(const MsgGroupIdConfig& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - MsgGroupIdConfig& operator=(MsgGroupIdConfig&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -1798,32 +1787,45 @@ class MsgGroupIdConfig { bsls::Types::Int64 ttlSeconds() const; // Return the value of the "TtlSeconds" attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const MsgGroupIdConfig& lhs, - const MsgGroupIdConfig& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const MsgGroupIdConfig& lhs, - const MsgGroupIdConfig& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const MsgGroupIdConfig& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. - -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const MsgGroupIdConfig& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'MsgGroupIdConfig'. + // HIDDEN FRIENDS + friend bool operator==(const MsgGroupIdConfig& lhs, + const MsgGroupIdConfig& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.rebalance() == rhs.rebalance() && + lhs.maxGroups() == rhs.maxGroups() && + lhs.ttlSeconds() == rhs.ttlSeconds(); + } + + friend bool operator!=(const MsgGroupIdConfig& lhs, + const MsgGroupIdConfig& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const MsgGroupIdConfig& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const MsgGroupIdConfig& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'MsgGroupIdConfig'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -1862,38 +1864,8 @@ class QueueConsistencyEventual { // exists, and 0 otherwise. // CREATORS - QueueConsistencyEventual(); - // Create an object of type 'QueueConsistencyEventual' having the - // default value. - - QueueConsistencyEventual(const QueueConsistencyEventual& original); - // Create an object of type 'QueueConsistencyEventual' having the value - // of the specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueConsistencyEventual(QueueConsistencyEventual&& original) = default; - // Create an object of type 'QueueConsistencyEventual' having the value - // of the specified 'original' object. After performing this action, - // the 'original' object will be left in a valid, but unspecified - // state. -#endif - - ~QueueConsistencyEventual(); - // Destroy this object. // MANIPULATORS - QueueConsistencyEventual& operator=(const QueueConsistencyEventual& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueConsistencyEventual& operator=(QueueConsistencyEventual&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -1969,33 +1941,40 @@ class QueueConsistencyEventual { // information structure. Return the value returned from the // invocation of 'accessor' if 'name' identifies an attribute of this // class, and -1 otherwise. -}; -// FREE OPERATORS -inline bool operator==(const QueueConsistencyEventual& lhs, - const QueueConsistencyEventual& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const QueueConsistencyEventual& lhs, - const QueueConsistencyEventual& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueConsistencyEventual& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + // HIDDEN FRIENDS + friend bool operator==(const QueueConsistencyEventual&, + const QueueConsistencyEventual&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, - const QueueConsistencyEventual& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'QueueConsistencyEventual'. + friend bool operator!=(const QueueConsistencyEventual& lhs, + const QueueConsistencyEventual& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueConsistencyEventual& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const QueueConsistencyEventual&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueConsistencyEventual'. + { + } +}; } // close package namespace @@ -2035,38 +2014,8 @@ class QueueConsistencyStrong { // exists, and 0 otherwise. // CREATORS - QueueConsistencyStrong(); - // Create an object of type 'QueueConsistencyStrong' having the default - // value. - - QueueConsistencyStrong(const QueueConsistencyStrong& original); - // Create an object of type 'QueueConsistencyStrong' having the value - // of the specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueConsistencyStrong(QueueConsistencyStrong&& original) = default; - // Create an object of type 'QueueConsistencyStrong' having the value - // of the specified 'original' object. After performing this action, - // the 'original' object will be left in a valid, but unspecified - // state. -#endif - - ~QueueConsistencyStrong(); - // Destroy this object. // MANIPULATORS - QueueConsistencyStrong& operator=(const QueueConsistencyStrong& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueConsistencyStrong& operator=(QueueConsistencyStrong&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -2142,33 +2091,40 @@ class QueueConsistencyStrong { // information structure. Return the value returned from the // invocation of 'accessor' if 'name' identifies an attribute of this // class, and -1 otherwise. -}; -// FREE OPERATORS -inline bool operator==(const QueueConsistencyStrong& lhs, - const QueueConsistencyStrong& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const QueueConsistencyStrong& lhs, - const QueueConsistencyStrong& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueConsistencyStrong& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + // HIDDEN FRIENDS + friend bool operator==(const QueueConsistencyStrong&, + const QueueConsistencyStrong&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const QueueConsistencyStrong& lhs, + const QueueConsistencyStrong& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, - const QueueConsistencyStrong& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'QueueConsistencyStrong'. + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueConsistencyStrong& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const QueueConsistencyStrong&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueConsistencyStrong'. + { + } +}; } // close package namespace @@ -2208,37 +2164,8 @@ class QueueModeBroadcast { // exists, and 0 otherwise. // CREATORS - QueueModeBroadcast(); - // Create an object of type 'QueueModeBroadcast' having the default - // value. - - QueueModeBroadcast(const QueueModeBroadcast& original); - // Create an object of type 'QueueModeBroadcast' having the value of - // the specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueModeBroadcast(QueueModeBroadcast&& original) = default; - // Create an object of type 'QueueModeBroadcast' having the value of - // the specified 'original' object. After performing this action, the - // 'original' object will be left in a valid, but unspecified state. -#endif - - ~QueueModeBroadcast(); - // Destroy this object. // MANIPULATORS - QueueModeBroadcast& operator=(const QueueModeBroadcast& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueModeBroadcast& operator=(QueueModeBroadcast&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -2314,32 +2241,40 @@ class QueueModeBroadcast { // information structure. Return the value returned from the // invocation of 'accessor' if 'name' identifies an attribute of this // class, and -1 otherwise. -}; -// FREE OPERATORS -inline bool operator==(const QueueModeBroadcast& lhs, - const QueueModeBroadcast& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const QueueModeBroadcast& lhs, - const QueueModeBroadcast& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueModeBroadcast& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + // HIDDEN FRIENDS + friend bool operator==(const QueueModeBroadcast&, + const QueueModeBroadcast&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } + + friend bool operator!=(const QueueModeBroadcast& lhs, + const QueueModeBroadcast& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const QueueModeBroadcast& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'QueueModeBroadcast'. + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueModeBroadcast& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const QueueModeBroadcast&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueModeBroadcast'. + { + } +}; } // close package namespace @@ -2355,22 +2290,32 @@ namespace mqbconfm { class QueueModeFanout { // Configuration for a fanout queue. - // appIDs.: List of appIDs authorized to consume from the queue. + // appIDs.............: List of appIDs authorized to consume from the + // queue. publishAppIdMetrics: Whether to publish appId metrics. // INSTANCE DATA bsl::vector d_appIDs; + bool d_publishAppIdMetrics; public: // TYPES - enum { ATTRIBUTE_ID_APP_I_DS = 0 }; + enum { + ATTRIBUTE_ID_APP_I_DS = 0, + ATTRIBUTE_ID_PUBLISH_APP_ID_METRICS = 1 + }; - enum { NUM_ATTRIBUTES = 1 }; + enum { NUM_ATTRIBUTES = 2 }; - enum { ATTRIBUTE_INDEX_APP_I_DS = 0 }; + enum { + ATTRIBUTE_INDEX_APP_I_DS = 0, + ATTRIBUTE_INDEX_PUBLISH_APP_ID_METRICS = 1 + }; // CONSTANTS static const char CLASS_NAME[]; + static const bool DEFAULT_INITIALIZER_PUBLISH_APP_ID_METRICS; + static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]; public: @@ -2468,6 +2413,10 @@ class QueueModeFanout { // Return a reference to the modifiable "AppIDs" attribute of this // object. + bool& publishAppIdMetrics(); + // Return a reference to the modifiable "PublishAppIdMetrics" attribute + // of this object. + // ACCESSORS bsl::ostream& print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const; @@ -2514,30 +2463,50 @@ class QueueModeFanout { const bsl::vector& appIDs() const; // Return a reference offering non-modifiable access to the "AppIDs" // attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const QueueModeFanout& lhs, const QueueModeFanout& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const QueueModeFanout& lhs, const QueueModeFanout& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueModeFanout& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + bool publishAppIdMetrics() const; + // Return the value of the "PublishAppIdMetrics" attribute of this + // object. -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const QueueModeFanout& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'QueueModeFanout'. + // HIDDEN FRIENDS + friend bool operator==(const QueueModeFanout& lhs, + const QueueModeFanout& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.appIDs() == rhs.appIDs() && + lhs.publishAppIdMetrics() == rhs.publishAppIdMetrics(); + } + + friend bool operator!=(const QueueModeFanout& lhs, + const QueueModeFanout& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueModeFanout& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const QueueModeFanout& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueModeFanout'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.appIDs()); + hashAppend(hashAlg, object.publishAppIdMetrics()); + } +}; } // close package namespace @@ -2577,37 +2546,8 @@ class QueueModePriority { // exists, and 0 otherwise. // CREATORS - QueueModePriority(); - // Create an object of type 'QueueModePriority' having the default - // value. - - QueueModePriority(const QueueModePriority& original); - // Create an object of type 'QueueModePriority' having the value of the - // specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueModePriority(QueueModePriority&& original) = default; - // Create an object of type 'QueueModePriority' having the value of the - // specified 'original' object. After performing this action, the - // 'original' object will be left in a valid, but unspecified state. -#endif - - ~QueueModePriority(); - // Destroy this object. // MANIPULATORS - QueueModePriority& operator=(const QueueModePriority& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - QueueModePriority& operator=(QueueModePriority&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -2683,32 +2623,39 @@ class QueueModePriority { // information structure. Return the value returned from the // invocation of 'accessor' if 'name' identifies an attribute of this // class, and -1 otherwise. -}; -// FREE OPERATORS -inline bool operator==(const QueueModePriority& lhs, - const QueueModePriority& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const QueueModePriority& lhs, - const QueueModePriority& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const QueueModePriority& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + // HIDDEN FRIENDS + friend bool operator==(const QueueModePriority&, const QueueModePriority&) + // Returns 'true' as this type has no attributes and so all objects of + // this type are considered equal. + { + return true; + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const QueueModePriority& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'QueueModePriority'. + friend bool operator!=(const QueueModePriority& lhs, + const QueueModePriority& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const QueueModePriority& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM&, const QueueModePriority&) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'QueueModePriority'. + { + } +}; } // close package namespace @@ -2735,6 +2682,12 @@ class Consistency { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Consistency& rhs) const; + public: // TYPES @@ -2899,28 +2852,43 @@ class Consistency { const char* selectionName() const; // Return the symbolic name of the current selection of this object. -}; -// FREE OPERATORS -inline bool operator==(const Consistency& lhs, const Consistency& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects have the same -// value, and 'false' otherwise. Two 'Consistency' objects have the same -// value if either the selections in both objects have the same ids and -// the same values, or both selections are undefined. + // HIDDEN FRIENDS + friend bool operator==(const Consistency& lhs, const Consistency& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'Consistency' objects have the + // same value if either the selections in both objects have the same + // ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const Consistency& lhs, const Consistency& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects do not have the -// same values, as determined by 'operator==', and 'false' otherwise. + friend bool operator!=(const Consistency& lhs, const Consistency& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Consistency& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, + const Consistency& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Consistency& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Consistency'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const Consistency& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Consistency'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -3106,32 +3074,46 @@ class DomainConfigRequest { const bsl::string& domainName() const; // Return a reference offering non-modifiable access to the // "DomainName" attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const DomainConfigRequest& lhs, - const DomainConfigRequest& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const DomainConfigRequest& lhs, - const DomainConfigRequest& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const DomainConfigRequest& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. - -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const DomainConfigRequest& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'DomainConfigRequest'. + // HIDDEN FRIENDS + friend bool operator==(const DomainConfigRequest& lhs, + const DomainConfigRequest& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.brokerIdentity() == rhs.brokerIdentity() && + lhs.domainName() == rhs.domainName(); + } + + friend bool operator!=(const DomainConfigRequest& lhs, + const DomainConfigRequest& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DomainConfigRequest& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const DomainConfigRequest& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DomainConfigRequest'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.brokerIdentity()); + hashAppend(hashAlg, object.domainName()); + } +}; } // close package namespace @@ -3318,29 +3300,41 @@ class Expression { const bsl::string& text() const; // Return a reference offering non-modifiable access to the "Text" // attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const Expression& lhs, const Expression& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. + // HIDDEN FRIENDS + friend bool operator==(const Expression& lhs, const Expression& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.version() == rhs.version() && lhs.text() == rhs.text(); + } -inline bool operator!=(const Expression& lhs, const Expression& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. + friend bool operator!=(const Expression& lhs, const Expression& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Expression& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, + const Expression& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Expression& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Expression'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Expression& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Expression'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.version()); + hashAppend(hashAlg, object.text()); + } +}; } // close package namespace @@ -3371,6 +3365,12 @@ class QueueMode { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const QueueMode& rhs) const; + public: // TYPES @@ -3576,28 +3576,41 @@ class QueueMode { const char* selectionName() const; // Return the symbolic name of the current selection of this object. -}; -// FREE OPERATORS -inline bool operator==(const QueueMode& lhs, const QueueMode& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects have the same -// value, and 'false' otherwise. Two 'QueueMode' objects have the same -// value if either the selections in both objects have the same ids and -// the same values, or both selections are undefined. + // HIDDEN FRIENDS + friend bool operator==(const QueueMode& lhs, const QueueMode& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'QueueMode' objects have the same + // value if either the selections in both objects have the same ids and + // the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const QueueMode& lhs, const QueueMode& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects do not have the -// same values, as determined by 'operator==', and 'false' otherwise. + friend bool operator!=(const QueueMode& lhs, const QueueMode& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const QueueMode& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const QueueMode& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const QueueMode& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'QueueMode'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const QueueMode& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'QueueMode'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -3623,6 +3636,12 @@ class Response { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Response& rhs) const; + public: // TYPES @@ -3801,28 +3820,41 @@ class Response { const char* selectionName() const; // Return the symbolic name of the current selection of this object. -}; -// FREE OPERATORS -inline bool operator==(const Response& lhs, const Response& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects have the same -// value, and 'false' otherwise. Two 'Response' objects have the same -// value if either the selections in both objects have the same ids and -// the same values, or both selections are undefined. + // HIDDEN FRIENDS + friend bool operator==(const Response& lhs, const Response& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'Response' objects have the same + // value if either the selections in both objects have the same ids and + // the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const Response& lhs, const Response& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects do not have the -// same values, as determined by 'operator==', and 'false' otherwise. + friend bool operator!=(const Response& lhs, const Response& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Response& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const Response& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Response& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Response'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Response& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Response'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -3849,6 +3881,12 @@ class Storage { int d_selectionId; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Storage& rhs) const; + public: // TYPES @@ -4012,28 +4050,41 @@ class Storage { const char* selectionName() const; // Return the symbolic name of the current selection of this object. -}; -// FREE OPERATORS -inline bool operator==(const Storage& lhs, const Storage& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects have the same -// value, and 'false' otherwise. Two 'Storage' objects have the same -// value if either the selections in both objects have the same ids and -// the same values, or both selections are undefined. + // HIDDEN FRIENDS + friend bool operator==(const Storage& lhs, const Storage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'Storage' objects have the same + // value if either the selections in both objects have the same ids and + // the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const Storage& lhs, const Storage& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects do not have the -// same values, as determined by 'operator==', and 'false' otherwise. + friend bool operator!=(const Storage& lhs, const Storage& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Storage& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const Storage& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Storage& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Storage'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Storage& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Storage'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -4058,6 +4109,12 @@ class Request { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Request& rhs) const; + public: // TYPES @@ -4208,28 +4265,41 @@ class Request { const char* selectionName() const; // Return the symbolic name of the current selection of this object. -}; -// FREE OPERATORS -inline bool operator==(const Request& lhs, const Request& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects have the same -// value, and 'false' otherwise. Two 'Request' objects have the same -// value if either the selections in both objects have the same ids and -// the same values, or both selections are undefined. + // HIDDEN FRIENDS + friend bool operator==(const Request& lhs, const Request& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'Request' objects have the same + // value if either the selections in both objects have the same ids and + // the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const Request& lhs, const Request& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects do not have the -// same values, as determined by 'operator==', and 'false' otherwise. + friend bool operator!=(const Request& lhs, const Request& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Request& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const Request& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Request& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Request'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Request& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Request'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -4255,6 +4325,10 @@ class StorageDefinition { Limits d_domainLimits; Limits d_queueLimits; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + public: // TYPES enum { @@ -4293,33 +4367,7 @@ class StorageDefinition { // Create an object of type 'StorageDefinition' having the default // value. - StorageDefinition(const StorageDefinition& original); - // Create an object of type 'StorageDefinition' having the value of the - // specified 'original' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - StorageDefinition(StorageDefinition&& original) = default; - // Create an object of type 'StorageDefinition' having the value of the - // specified 'original' object. After performing this action, the - // 'original' object will be left in a valid, but unspecified state. -#endif - - ~StorageDefinition(); - // Destroy this object. - // MANIPULATORS - StorageDefinition& operator=(const StorageDefinition& rhs); - // Assign to this object the value of the specified 'rhs' object. - -#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) && \ - defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT) - StorageDefinition& operator=(StorageDefinition&& rhs); - // Assign to this object the value of the specified 'rhs' object. - // After performing this action, the 'rhs' object will be left in a - // valid, but unspecified state. -#endif - void reset(); // Reset this object to the default value (i.e., its value upon // default construction). @@ -4419,32 +4467,45 @@ class StorageDefinition { const Storage& config() const; // Return a reference offering non-modifiable access to the "Config" // attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const StorageDefinition& lhs, - const StorageDefinition& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const StorageDefinition& lhs, - const StorageDefinition& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const StorageDefinition& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. - -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const StorageDefinition& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'StorageDefinition'. + // HIDDEN FRIENDS + friend bool operator==(const StorageDefinition& lhs, + const StorageDefinition& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.domainLimits() == rhs.domainLimits() && + lhs.queueLimits() == rhs.queueLimits() && + lhs.config() == rhs.config(); + } + + friend bool operator!=(const StorageDefinition& lhs, + const StorageDefinition& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const StorageDefinition& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const StorageDefinition& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'StorageDefinition'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -4461,8 +4522,8 @@ namespace mqbconfm { class Subscription { // This complex type contains various parameters required by an upstream // node to configure subscription for an app. - // appId..................: app identifier - // consumers..............: consumer parameters + // appId..................: app identifier expression.............: + // expression denoting a subscription for the app // INSTANCE DATA bsl::string d_appId; @@ -4629,29 +4690,44 @@ class Subscription { const Expression& expression() const; // Return a reference offering non-modifiable access to the // "Expression" attribute of this object. -}; - -// FREE OPERATORS -inline bool operator==(const Subscription& lhs, const Subscription& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. -inline bool operator!=(const Subscription& lhs, const Subscription& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, const Subscription& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. - -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Subscription& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Subscription'. + // HIDDEN FRIENDS + friend bool operator==(const Subscription& lhs, const Subscription& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.appId() == rhs.appId() && + lhs.expression() == rhs.expression(); + } + + friend bool operator!=(const Subscription& lhs, const Subscription& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const Subscription& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const Subscription& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'Subscription'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.appId()); + hashAppend(hashAlg, object.expression()); + } +}; } // close package namespace @@ -4704,6 +4780,12 @@ class Domain { int d_maxDeliveryAttempts; int d_deduplicationTimeMs; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const Domain& rhs) const; + public: // TYPES enum { @@ -4987,29 +5069,38 @@ class Domain { const bsl::vector& subscriptions() const; // Return a reference offering non-modifiable access to the // "Subscriptions" attribute of this object. -}; -// FREE OPERATORS -inline bool operator==(const Domain& lhs, const Domain& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. + // HIDDEN FRIENDS + friend bool operator==(const Domain& lhs, const Domain& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const Domain& lhs, const Domain& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. + friend bool operator!=(const Domain& lhs, const Domain& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, const Domain& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, const Domain& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const Domain& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'Domain'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, const Domain& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for 'Domain'. + { + object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -5196,32 +5287,46 @@ class DomainDefinition { const Domain& parameters() const; // Return a reference offering non-modifiable access to the // "Parameters" attribute of this object. -}; - -// FREE OPERATORS -inline bool operator==(const DomainDefinition& lhs, - const DomainDefinition& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects have -// the same value, and 'false' otherwise. Two attribute objects have the -// same value if each respective attribute has the same value. - -inline bool operator!=(const DomainDefinition& lhs, - const DomainDefinition& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' attribute objects do not -// have the same value, and 'false' otherwise. Two attribute objects do -// not have the same value if one or more respective attributes differ in -// values. - -inline bsl::ostream& operator<<(bsl::ostream& stream, - const DomainDefinition& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const DomainDefinition& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'DomainDefinition'. + // HIDDEN FRIENDS + friend bool operator==(const DomainDefinition& lhs, + const DomainDefinition& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' attribute objects + // have the same value, and 'false' otherwise. Two attribute objects + // have the same value if each respective attribute has the same value. + { + return lhs.location() == rhs.location() && + lhs.parameters() == rhs.parameters(); + } + + friend bool operator!=(const DomainDefinition& lhs, + const DomainDefinition& rhs) + // Returns '!(lhs == rhs)' + { + return !(lhs == rhs); + } + + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DomainDefinition& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } + + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const DomainDefinition& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DomainDefinition'. + { + using bslh::hashAppend; + hashAppend(hashAlg, object.location()); + hashAppend(hashAlg, object.parameters()); + } +}; } // close package namespace @@ -5250,6 +5355,12 @@ class DomainVariant { int d_selectionId; bslma::Allocator* d_allocator_p; + // PRIVATE ACCESSORS + template + void hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const; + + bool isEqualTo(const DomainVariant& rhs) const; + public: // TYPES @@ -5427,29 +5538,44 @@ class DomainVariant { const char* selectionName() const; // Return the symbolic name of the current selection of this object. -}; -// FREE OPERATORS -inline bool operator==(const DomainVariant& lhs, const DomainVariant& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects have the same -// value, and 'false' otherwise. Two 'DomainVariant' objects have the same -// value if either the selections in both objects have the same ids and -// the same values, or both selections are undefined. + // HIDDEN FRIENDS + friend bool operator==(const DomainVariant& lhs, const DomainVariant& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects have the same + // value, and 'false' otherwise. Two 'DomainVariant' objects have the + // same value if either the selections in both objects have the same + // ids and the same values, or both selections are undefined. + { + return lhs.isEqualTo(rhs); + } -inline bool operator!=(const DomainVariant& lhs, const DomainVariant& rhs); -// Return 'true' if the specified 'lhs' and 'rhs' objects do not have the -// same values, as determined by 'operator==', and 'false' otherwise. + friend bool operator!=(const DomainVariant& lhs, const DomainVariant& rhs) + // Return 'true' if the specified 'lhs' and 'rhs' objects do not have + // the same values, as determined by 'operator==', and 'false' + // otherwise. + { + return !(lhs == rhs); + } -inline bsl::ostream& operator<<(bsl::ostream& stream, - const DomainVariant& rhs); -// Format the specified 'rhs' to the specified output 'stream' and -// return a reference to the modifiable 'stream'. + friend bsl::ostream& operator<<(bsl::ostream& stream, + const DomainVariant& rhs) + // Format the specified 'rhs' to the specified output 'stream' and + // return a reference to the modifiable 'stream'. + { + return rhs.print(stream, 0, -1); + } -template -void hashAppend(t_HASH_ALGORITHM& hashAlg, const DomainVariant& object); -// Pass the specified 'object' to the specified 'hashAlg'. This function -// integrates with the 'bslh' modular hashing system and effectively -// provides a 'bsl::hash' specialization for 'DomainVariant'. + template + friend void hashAppend(t_HASH_ALGORITHM& hashAlg, + const DomainVariant& object) + // Pass the specified 'object' to the specified 'hashAlg'. This + // function integrates with the 'bslh' modular hashing system and + // effectively provides a 'bsl::hash' specialization for + // 'DomainVariant'. + { + return object.hashAppendImpl(hashAlg); + } +}; } // close package namespace @@ -5468,6 +5594,16 @@ namespace mqbconfm { // class BrokerIdentity // -------------------- +// PRIVATE ACCESSORS +template +void BrokerIdentity::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->hostName()); + hashAppend(hashAlgorithm, this->hostTags()); + hashAppend(hashAlgorithm, this->brokerVersion()); +} + // CLASS METHODS // MANIPULATORS template @@ -6198,6 +6334,25 @@ int InMemoryStorage::accessAttribute(t_ACCESSOR& accessor, // class Limits // ------------ +// PRIVATE ACCESSORS +template +void Limits::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->messages()); + hashAppend(hashAlgorithm, this->messagesWatermarkRatio()); + hashAppend(hashAlgorithm, this->bytes()); + hashAppend(hashAlgorithm, this->bytesWatermarkRatio()); +} + +inline bool Limits::isEqualTo(const Limits& rhs) const +{ + return this->messages() == rhs.messages() && + this->messagesWatermarkRatio() == rhs.messagesWatermarkRatio() && + this->bytes() == rhs.bytes() && + this->bytesWatermarkRatio() == rhs.bytesWatermarkRatio(); +} + // CLASS METHODS // MANIPULATORS template @@ -6397,6 +6552,16 @@ inline double Limits::bytesWatermarkRatio() const // class MsgGroupIdConfig // ---------------------- +// PRIVATE ACCESSORS +template +void MsgGroupIdConfig::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->rebalance()); + hashAppend(hashAlgorithm, this->maxGroups()); + hashAppend(hashAlgorithm, this->ttlSeconds()); +} + // CLASS METHODS // MANIPULATORS template @@ -6803,6 +6968,13 @@ int QueueModeFanout::manipulateAttributes(t_MANIPULATOR& manipulator) return ret; } + ret = manipulator( + &d_publishAppIdMetrics, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PUBLISH_APP_ID_METRICS]); + if (ret) { + return ret; + } + return 0; } @@ -6816,6 +6988,11 @@ int QueueModeFanout::manipulateAttribute(t_MANIPULATOR& manipulator, int id) return manipulator(&d_appIDs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_I_DS]); } + case ATTRIBUTE_ID_PUBLISH_APP_ID_METRICS: { + return manipulator( + &d_publishAppIdMetrics, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PUBLISH_APP_ID_METRICS]); + } default: return NOT_FOUND; } } @@ -6841,6 +7018,11 @@ inline bsl::vector& QueueModeFanout::appIDs() return d_appIDs; } +inline bool& QueueModeFanout::publishAppIdMetrics() +{ + return d_publishAppIdMetrics; +} + // ACCESSORS template int QueueModeFanout::accessAttributes(t_ACCESSOR& accessor) const @@ -6852,6 +7034,13 @@ int QueueModeFanout::accessAttributes(t_ACCESSOR& accessor) const return ret; } + ret = accessor( + d_publishAppIdMetrics, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PUBLISH_APP_ID_METRICS]); + if (ret) { + return ret; + } + return 0; } @@ -6865,6 +7054,11 @@ int QueueModeFanout::accessAttribute(t_ACCESSOR& accessor, int id) const return accessor(d_appIDs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_APP_I_DS]); } + case ATTRIBUTE_ID_PUBLISH_APP_ID_METRICS: { + return accessor( + d_publishAppIdMetrics, + ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PUBLISH_APP_ID_METRICS]); + } default: return NOT_FOUND; } } @@ -6890,6 +7084,11 @@ inline const bsl::vector& QueueModeFanout::appIDs() const return d_appIDs; } +inline bool QueueModeFanout::publishAppIdMetrics() const +{ + return d_publishAppIdMetrics; +} + // ----------------------- // class QueueModePriority // ----------------------- @@ -6970,6 +7169,42 @@ int QueueModePriority::accessAttribute(t_ACCESSOR& accessor, // ----------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void Consistency::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef Consistency Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_EVENTUAL: + hashAppend(hashAlgorithm, this->eventual()); + break; + case Class::SELECTION_ID_STRONG: + hashAppend(hashAlgorithm, this->strong()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool Consistency::isEqualTo(const Consistency& rhs) const +{ + typedef Consistency Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_EVENTUAL: + return this->eventual() == rhs.eventual(); + case Class::SELECTION_ID_STRONG: return this->strong() == rhs.strong(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline Consistency::Consistency() : d_selectionId(SELECTION_ID_UNDEFINED) @@ -7330,6 +7565,47 @@ inline const bsl::string& Expression::text() const // --------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void QueueMode::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef QueueMode Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_FANOUT: + hashAppend(hashAlgorithm, this->fanout()); + break; + case Class::SELECTION_ID_PRIORITY: + hashAppend(hashAlgorithm, this->priority()); + break; + case Class::SELECTION_ID_BROADCAST: + hashAppend(hashAlgorithm, this->broadcast()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool QueueMode::isEqualTo(const QueueMode& rhs) const +{ + typedef QueueMode Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_FANOUT: return this->fanout() == rhs.fanout(); + case Class::SELECTION_ID_PRIORITY: + return this->priority() == rhs.priority(); + case Class::SELECTION_ID_BROADCAST: + return this->broadcast() == rhs.broadcast(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline QueueMode::QueueMode(bslma::Allocator* basicAllocator) : d_selectionId(SELECTION_ID_UNDEFINED) @@ -7446,6 +7722,43 @@ inline bool QueueMode::isUndefinedValue() const // -------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void Response::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef Response Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_FAILURE: + hashAppend(hashAlgorithm, this->failure()); + break; + case Class::SELECTION_ID_DOMAIN_CONFIG: + hashAppend(hashAlgorithm, this->domainConfig()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool Response::isEqualTo(const Response& rhs) const +{ + typedef Response Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_FAILURE: + return this->failure() == rhs.failure(); + case Class::SELECTION_ID_DOMAIN_CONFIG: + return this->domainConfig() == rhs.domainConfig(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline Response::Response(bslma::Allocator* basicAllocator) : d_selectionId(SELECTION_ID_UNDEFINED) @@ -7540,23 +7853,60 @@ inline bool Response::isUndefinedValue() const // ------------- // CLASS METHODS -// CREATORS -inline Storage::Storage() -: d_selectionId(SELECTION_ID_UNDEFINED) -{ -} - -inline Storage::~Storage() +// PRIVATE ACCESSORS +template +void Storage::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const { - reset(); + typedef Storage Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_IN_MEMORY: + hashAppend(hashAlgorithm, this->inMemory()); + break; + case Class::SELECTION_ID_FILE_BACKED: + hashAppend(hashAlgorithm, this->fileBacked()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } } -// MANIPULATORS -template -int Storage::manipulateSelection(t_MANIPULATOR& manipulator) +inline bool Storage::isEqualTo(const Storage& rhs) const { - switch (d_selectionId) { - case Storage::SELECTION_ID_IN_MEMORY: + typedef Storage Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_IN_MEMORY: + return this->inMemory() == rhs.inMemory(); + case Class::SELECTION_ID_FILE_BACKED: + return this->fileBacked() == rhs.fileBacked(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + +// CREATORS +inline Storage::Storage() +: d_selectionId(SELECTION_ID_UNDEFINED) +{ +} + +inline Storage::~Storage() +{ + reset(); +} + +// MANIPULATORS +template +int Storage::manipulateSelection(t_MANIPULATOR& manipulator) +{ + switch (d_selectionId) { + case Storage::SELECTION_ID_IN_MEMORY: return manipulator(&d_inMemory.object(), SELECTION_INFO_ARRAY[SELECTION_INDEX_IN_MEMORY]); case Storage::SELECTION_ID_FILE_BACKED: @@ -7632,6 +7982,38 @@ inline bool Storage::isUndefinedValue() const // ------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void Request::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef Request Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_DOMAIN_CONFIG: + hashAppend(hashAlgorithm, this->domainConfig()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool Request::isEqualTo(const Request& rhs) const +{ + typedef Request Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_DOMAIN_CONFIG: + return this->domainConfig() == rhs.domainConfig(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline Request::Request(bslma::Allocator* basicAllocator) : d_selectionId(SELECTION_ID_UNDEFINED) @@ -7702,6 +8084,16 @@ inline bool Request::isUndefinedValue() const // class StorageDefinition // ----------------------- +// PRIVATE ACCESSORS +template +void StorageDefinition::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->domainLimits()); + hashAppend(hashAlgorithm, this->queueLimits()); + hashAppend(hashAlgorithm, this->config()); +} + // CLASS METHODS // MANIPULATORS template @@ -7998,6 +8390,42 @@ inline const Expression& Subscription::expression() const // class Domain // ------------ +// PRIVATE ACCESSORS +template +void Domain::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->name()); + hashAppend(hashAlgorithm, this->mode()); + hashAppend(hashAlgorithm, this->storage()); + hashAppend(hashAlgorithm, this->maxConsumers()); + hashAppend(hashAlgorithm, this->maxProducers()); + hashAppend(hashAlgorithm, this->maxQueues()); + hashAppend(hashAlgorithm, this->msgGroupIdConfig()); + hashAppend(hashAlgorithm, this->maxIdleTime()); + hashAppend(hashAlgorithm, this->messageTtl()); + hashAppend(hashAlgorithm, this->maxDeliveryAttempts()); + hashAppend(hashAlgorithm, this->deduplicationTimeMs()); + hashAppend(hashAlgorithm, this->consistency()); + hashAppend(hashAlgorithm, this->subscriptions()); +} + +inline bool Domain::isEqualTo(const Domain& rhs) const +{ + return this->name() == rhs.name() && this->mode() == rhs.mode() && + this->storage() == rhs.storage() && + this->maxConsumers() == rhs.maxConsumers() && + this->maxProducers() == rhs.maxProducers() && + this->maxQueues() == rhs.maxQueues() && + this->msgGroupIdConfig() == rhs.msgGroupIdConfig() && + this->maxIdleTime() == rhs.maxIdleTime() && + this->messageTtl() == rhs.messageTtl() && + this->maxDeliveryAttempts() == rhs.maxDeliveryAttempts() && + this->deduplicationTimeMs() == rhs.deduplicationTimeMs() && + this->consistency() == rhs.consistency() && + this->subscriptions() == rhs.subscriptions(); +} + // CLASS METHODS // MANIPULATORS template @@ -8607,6 +9035,43 @@ inline const Domain& DomainDefinition::parameters() const // ------------------- // CLASS METHODS +// PRIVATE ACCESSORS +template +void DomainVariant::hashAppendImpl(t_HASH_ALGORITHM& hashAlgorithm) const +{ + typedef DomainVariant Class; + using bslh::hashAppend; + hashAppend(hashAlgorithm, this->selectionId()); + switch (this->selectionId()) { + case Class::SELECTION_ID_DEFINITION: + hashAppend(hashAlgorithm, this->definition()); + break; + case Class::SELECTION_ID_REDIRECT: + hashAppend(hashAlgorithm, this->redirect()); + break; + default: BSLS_ASSERT(this->selectionId() == Class::SELECTION_ID_UNDEFINED); + } +} + +inline bool DomainVariant::isEqualTo(const DomainVariant& rhs) const +{ + typedef DomainVariant Class; + if (this->selectionId() == rhs.selectionId()) { + switch (rhs.selectionId()) { + case Class::SELECTION_ID_DEFINITION: + return this->definition() == rhs.definition(); + case Class::SELECTION_ID_REDIRECT: + return this->redirect() == rhs.redirect(); + default: + BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); + return true; + } + } + else { + return false; + } +} + // CREATORS inline DomainVariant::DomainVariant(bslma::Allocator* basicAllocator) : d_selectionId(SELECTION_ID_UNDEFINED) @@ -8698,878 +9163,13 @@ inline bool DomainVariant::isUndefinedValue() const // FREE FUNCTIONS -inline bool mqbconfm::operator==(const mqbconfm::BrokerIdentity& lhs, - const mqbconfm::BrokerIdentity& rhs) -{ - return lhs.hostName() == rhs.hostName() && - lhs.hostTags() == rhs.hostTags() && - lhs.brokerVersion() == rhs.brokerVersion(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::BrokerIdentity& lhs, - const mqbconfm::BrokerIdentity& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::BrokerIdentity& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::BrokerIdentity& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.hostName()); - hashAppend(hashAlg, object.hostTags()); - hashAppend(hashAlg, object.brokerVersion()); -} - -inline bool mqbconfm::operator==(const mqbconfm::DomainConfigRaw& lhs, - const mqbconfm::DomainConfigRaw& rhs) -{ - return lhs.domainName() == rhs.domainName() && - lhs.config() == rhs.config(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::DomainConfigRaw& lhs, - const mqbconfm::DomainConfigRaw& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::DomainConfigRaw& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::DomainConfigRaw& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.domainName()); - hashAppend(hashAlg, object.config()); -} - -inline bool mqbconfm::operator==(const mqbconfm::DomainResolver& lhs, - const mqbconfm::DomainResolver& rhs) -{ - return lhs.name() == rhs.name() && lhs.cluster() == rhs.cluster(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::DomainResolver& lhs, - const mqbconfm::DomainResolver& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::DomainResolver& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::DomainResolver& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.name()); - hashAppend(hashAlg, object.cluster()); -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - mqbconfm::ExpressionVersion::Value rhs) -{ - return mqbconfm::ExpressionVersion::print(stream, rhs); -} - -inline bool mqbconfm::operator==(const mqbconfm::Failure& lhs, - const mqbconfm::Failure& rhs) -{ - return lhs.code() == rhs.code() && lhs.message() == rhs.message(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::Failure& lhs, - const mqbconfm::Failure& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Failure& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Failure& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.code()); - hashAppend(hashAlg, object.message()); -} - -inline bool mqbconfm::operator==(const mqbconfm::FileBackedStorage&, - const mqbconfm::FileBackedStorage&) -{ - return true; -} - -inline bool mqbconfm::operator!=(const mqbconfm::FileBackedStorage&, - const mqbconfm::FileBackedStorage&) -{ - return false; -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::FileBackedStorage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::FileBackedStorage& object) -{ - (void)hashAlg; - (void)object; -} - -inline bool mqbconfm::operator==(const mqbconfm::InMemoryStorage&, - const mqbconfm::InMemoryStorage&) -{ - return true; -} - -inline bool mqbconfm::operator!=(const mqbconfm::InMemoryStorage&, - const mqbconfm::InMemoryStorage&) -{ - return false; -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::InMemoryStorage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::InMemoryStorage& object) -{ - (void)hashAlg; - (void)object; -} - -inline bool mqbconfm::operator==(const mqbconfm::Limits& lhs, - const mqbconfm::Limits& rhs) -{ - return lhs.messages() == rhs.messages() && - lhs.messagesWatermarkRatio() == rhs.messagesWatermarkRatio() && - lhs.bytes() == rhs.bytes() && - lhs.bytesWatermarkRatio() == rhs.bytesWatermarkRatio(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::Limits& lhs, - const mqbconfm::Limits& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Limits& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Limits& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.messages()); - hashAppend(hashAlg, object.messagesWatermarkRatio()); - hashAppend(hashAlg, object.bytes()); - hashAppend(hashAlg, object.bytesWatermarkRatio()); -} - -inline bool mqbconfm::operator==(const mqbconfm::MsgGroupIdConfig& lhs, - const mqbconfm::MsgGroupIdConfig& rhs) -{ - return lhs.rebalance() == rhs.rebalance() && - lhs.maxGroups() == rhs.maxGroups() && - lhs.ttlSeconds() == rhs.ttlSeconds(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::MsgGroupIdConfig& lhs, - const mqbconfm::MsgGroupIdConfig& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::MsgGroupIdConfig& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::MsgGroupIdConfig& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.rebalance()); - hashAppend(hashAlg, object.maxGroups()); - hashAppend(hashAlg, object.ttlSeconds()); -} - -inline bool mqbconfm::operator==(const mqbconfm::QueueConsistencyEventual&, - const mqbconfm::QueueConsistencyEventual&) -{ - return true; -} - -inline bool mqbconfm::operator!=(const mqbconfm::QueueConsistencyEventual&, - const mqbconfm::QueueConsistencyEventual&) -{ - return false; -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::QueueConsistencyEventual& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::QueueConsistencyEventual& object) -{ - (void)hashAlg; - (void)object; -} - -inline bool mqbconfm::operator==(const mqbconfm::QueueConsistencyStrong&, - const mqbconfm::QueueConsistencyStrong&) -{ - return true; -} - -inline bool mqbconfm::operator!=(const mqbconfm::QueueConsistencyStrong&, - const mqbconfm::QueueConsistencyStrong&) -{ - return false; -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::QueueConsistencyStrong& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::QueueConsistencyStrong& object) -{ - (void)hashAlg; - (void)object; -} - -inline bool mqbconfm::operator==(const mqbconfm::QueueModeBroadcast&, - const mqbconfm::QueueModeBroadcast&) -{ - return true; -} - -inline bool mqbconfm::operator!=(const mqbconfm::QueueModeBroadcast&, - const mqbconfm::QueueModeBroadcast&) -{ - return false; -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::QueueModeBroadcast& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::QueueModeBroadcast& object) -{ - (void)hashAlg; - (void)object; -} - -inline bool mqbconfm::operator==(const mqbconfm::QueueModeFanout& lhs, - const mqbconfm::QueueModeFanout& rhs) -{ - return lhs.appIDs() == rhs.appIDs(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::QueueModeFanout& lhs, - const mqbconfm::QueueModeFanout& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::QueueModeFanout& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::QueueModeFanout& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.appIDs()); -} - -inline bool mqbconfm::operator==(const mqbconfm::QueueModePriority&, - const mqbconfm::QueueModePriority&) -{ - return true; -} - -inline bool mqbconfm::operator!=(const mqbconfm::QueueModePriority&, - const mqbconfm::QueueModePriority&) -{ - return false; -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::QueueModePriority& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::QueueModePriority& object) -{ - (void)hashAlg; - (void)object; -} - -inline bool mqbconfm::operator==(const mqbconfm::Consistency& lhs, - const mqbconfm::Consistency& rhs) -{ - typedef mqbconfm::Consistency Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_EVENTUAL: - return lhs.eventual() == rhs.eventual(); - case Class::SELECTION_ID_STRONG: return lhs.strong() == rhs.strong(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool mqbconfm::operator!=(const mqbconfm::Consistency& lhs, - const mqbconfm::Consistency& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Consistency& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Consistency& object) -{ - typedef mqbconfm::Consistency Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_EVENTUAL: - hashAppend(hashAlg, object.eventual()); - break; - case Class::SELECTION_ID_STRONG: - hashAppend(hashAlg, object.strong()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - -inline bool mqbconfm::operator==(const mqbconfm::DomainConfigRequest& lhs, - const mqbconfm::DomainConfigRequest& rhs) -{ - return lhs.brokerIdentity() == rhs.brokerIdentity() && - lhs.domainName() == rhs.domainName(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::DomainConfigRequest& lhs, - const mqbconfm::DomainConfigRequest& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::DomainConfigRequest& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::DomainConfigRequest& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.brokerIdentity()); - hashAppend(hashAlg, object.domainName()); -} - -inline bool mqbconfm::operator==(const mqbconfm::Expression& lhs, - const mqbconfm::Expression& rhs) -{ - return lhs.version() == rhs.version() && lhs.text() == rhs.text(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::Expression& lhs, - const mqbconfm::Expression& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Expression& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Expression& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.version()); - hashAppend(hashAlg, object.text()); -} - -inline bool mqbconfm::operator==(const mqbconfm::QueueMode& lhs, - const mqbconfm::QueueMode& rhs) -{ - typedef mqbconfm::QueueMode Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_FANOUT: return lhs.fanout() == rhs.fanout(); - case Class::SELECTION_ID_PRIORITY: - return lhs.priority() == rhs.priority(); - case Class::SELECTION_ID_BROADCAST: - return lhs.broadcast() == rhs.broadcast(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool mqbconfm::operator!=(const mqbconfm::QueueMode& lhs, - const mqbconfm::QueueMode& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::QueueMode& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::QueueMode& object) -{ - typedef mqbconfm::QueueMode Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_FANOUT: - hashAppend(hashAlg, object.fanout()); - break; - case Class::SELECTION_ID_PRIORITY: - hashAppend(hashAlg, object.priority()); - break; - case Class::SELECTION_ID_BROADCAST: - hashAppend(hashAlg, object.broadcast()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - -inline bool mqbconfm::operator==(const mqbconfm::Response& lhs, - const mqbconfm::Response& rhs) -{ - typedef mqbconfm::Response Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_FAILURE: - return lhs.failure() == rhs.failure(); - case Class::SELECTION_ID_DOMAIN_CONFIG: - return lhs.domainConfig() == rhs.domainConfig(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool mqbconfm::operator!=(const mqbconfm::Response& lhs, - const mqbconfm::Response& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Response& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Response& object) -{ - typedef mqbconfm::Response Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_FAILURE: - hashAppend(hashAlg, object.failure()); - break; - case Class::SELECTION_ID_DOMAIN_CONFIG: - hashAppend(hashAlg, object.domainConfig()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - -inline bool mqbconfm::operator==(const mqbconfm::Storage& lhs, - const mqbconfm::Storage& rhs) -{ - typedef mqbconfm::Storage Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_IN_MEMORY: - return lhs.inMemory() == rhs.inMemory(); - case Class::SELECTION_ID_FILE_BACKED: - return lhs.fileBacked() == rhs.fileBacked(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool mqbconfm::operator!=(const mqbconfm::Storage& lhs, - const mqbconfm::Storage& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Storage& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Storage& object) -{ - typedef mqbconfm::Storage Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_IN_MEMORY: - hashAppend(hashAlg, object.inMemory()); - break; - case Class::SELECTION_ID_FILE_BACKED: - hashAppend(hashAlg, object.fileBacked()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - -inline bool mqbconfm::operator==(const mqbconfm::Request& lhs, - const mqbconfm::Request& rhs) -{ - typedef mqbconfm::Request Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_DOMAIN_CONFIG: - return lhs.domainConfig() == rhs.domainConfig(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool mqbconfm::operator!=(const mqbconfm::Request& lhs, - const mqbconfm::Request& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Request& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Request& object) -{ - typedef mqbconfm::Request Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_DOMAIN_CONFIG: - hashAppend(hashAlg, object.domainConfig()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - -inline bool mqbconfm::operator==(const mqbconfm::StorageDefinition& lhs, - const mqbconfm::StorageDefinition& rhs) -{ - return lhs.domainLimits() == rhs.domainLimits() && - lhs.queueLimits() == rhs.queueLimits() && - lhs.config() == rhs.config(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::StorageDefinition& lhs, - const mqbconfm::StorageDefinition& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::StorageDefinition& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::StorageDefinition& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.domainLimits()); - hashAppend(hashAlg, object.queueLimits()); - hashAppend(hashAlg, object.config()); -} - -inline bool mqbconfm::operator==(const mqbconfm::Subscription& lhs, - const mqbconfm::Subscription& rhs) -{ - return lhs.appId() == rhs.appId() && lhs.expression() == rhs.expression(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::Subscription& lhs, - const mqbconfm::Subscription& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Subscription& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Subscription& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.appId()); - hashAppend(hashAlg, object.expression()); -} - -inline bool mqbconfm::operator==(const mqbconfm::Domain& lhs, - const mqbconfm::Domain& rhs) -{ - return lhs.name() == rhs.name() && lhs.mode() == rhs.mode() && - lhs.storage() == rhs.storage() && - lhs.maxConsumers() == rhs.maxConsumers() && - lhs.maxProducers() == rhs.maxProducers() && - lhs.maxQueues() == rhs.maxQueues() && - lhs.msgGroupIdConfig() == rhs.msgGroupIdConfig() && - lhs.maxIdleTime() == rhs.maxIdleTime() && - lhs.messageTtl() == rhs.messageTtl() && - lhs.maxDeliveryAttempts() == rhs.maxDeliveryAttempts() && - lhs.deduplicationTimeMs() == rhs.deduplicationTimeMs() && - lhs.consistency() == rhs.consistency() && - lhs.subscriptions() == rhs.subscriptions(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::Domain& lhs, - const mqbconfm::Domain& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::Domain& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::Domain& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.name()); - hashAppend(hashAlg, object.mode()); - hashAppend(hashAlg, object.storage()); - hashAppend(hashAlg, object.maxConsumers()); - hashAppend(hashAlg, object.maxProducers()); - hashAppend(hashAlg, object.maxQueues()); - hashAppend(hashAlg, object.msgGroupIdConfig()); - hashAppend(hashAlg, object.maxIdleTime()); - hashAppend(hashAlg, object.messageTtl()); - hashAppend(hashAlg, object.maxDeliveryAttempts()); - hashAppend(hashAlg, object.deduplicationTimeMs()); - hashAppend(hashAlg, object.consistency()); - hashAppend(hashAlg, object.subscriptions()); -} - -inline bool mqbconfm::operator==(const mqbconfm::DomainDefinition& lhs, - const mqbconfm::DomainDefinition& rhs) -{ - return lhs.location() == rhs.location() && - lhs.parameters() == rhs.parameters(); -} - -inline bool mqbconfm::operator!=(const mqbconfm::DomainDefinition& lhs, - const mqbconfm::DomainDefinition& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& -mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::DomainDefinition& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::DomainDefinition& object) -{ - using bslh::hashAppend; - hashAppend(hashAlg, object.location()); - hashAppend(hashAlg, object.parameters()); -} - -inline bool mqbconfm::operator==(const mqbconfm::DomainVariant& lhs, - const mqbconfm::DomainVariant& rhs) -{ - typedef mqbconfm::DomainVariant Class; - if (lhs.selectionId() == rhs.selectionId()) { - switch (rhs.selectionId()) { - case Class::SELECTION_ID_DEFINITION: - return lhs.definition() == rhs.definition(); - case Class::SELECTION_ID_REDIRECT: - return lhs.redirect() == rhs.redirect(); - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId()); - return true; - } - } - else { - return false; - } -} - -inline bool mqbconfm::operator!=(const mqbconfm::DomainVariant& lhs, - const mqbconfm::DomainVariant& rhs) -{ - return !(lhs == rhs); -} - -inline bsl::ostream& mqbconfm::operator<<(bsl::ostream& stream, - const mqbconfm::DomainVariant& rhs) -{ - return rhs.print(stream, 0, -1); -} - -template -void mqbconfm::hashAppend(t_HASH_ALGORITHM& hashAlg, - const mqbconfm::DomainVariant& object) -{ - typedef mqbconfm::DomainVariant Class; - using bslh::hashAppend; - hashAppend(hashAlg, object.selectionId()); - switch (object.selectionId()) { - case Class::SELECTION_ID_DEFINITION: - hashAppend(hashAlg, object.definition()); - break; - case Class::SELECTION_ID_REDIRECT: - hashAppend(hashAlg, object.redirect()); - break; - default: - BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId()); - } -} - } // close enterprise namespace #endif -// GENERATED BY BLP_BAS_CODEGEN_2023.11.25 +// GENERATED BY @BLP_BAS_CODEGEN_VERSION@ // USING bas_codegen.pl -m msg --noAggregateConversion --noExternalization // --noIdent --package mqbconfm --msgComponent messages mqbconf.xsd SERVICE -// SERVICE VERSION bmqconf:183474-1.0 +// VERSION bmqconf:183474-1.0 // ---------------------------------------------------------------------------- // NOTICE: // Copyright 2024 Bloomberg Finance L.P. All rights reserved. diff --git a/src/groups/mqb/mqbstat/mqbstat_queuestats.cpp b/src/groups/mqb/mqbstat/mqbstat_queuestats.cpp index 7350b1808..0b5c01c0e 100644 --- a/src/groups/mqb/mqbstat/mqbstat_queuestats.cpp +++ b/src/groups/mqb/mqbstat/mqbstat_queuestats.cpp @@ -489,25 +489,20 @@ void QueueStatsDomain::initialize(const bmqt::Uri& uri, // `e_CONFIRM_TIME_MAX` or `e_QUEUE_TIME_MAX`, so the metrics can be // inspected separately for each application. if (!domain->cluster()->isRemote() && - domain->config().mode().isFanoutValue()) { - const bsl::vector& appIdTagDomains = - mqbcfg::BrokerConfig::get().stats().appIdTagDomains(); - if (bsl::find(appIdTagDomains.begin(), - appIdTagDomains.end(), - uri.domain()) != appIdTagDomains.end()) { - d_subContexts_mp.load(new (*allocator) - bsl::list(allocator), - allocator); - const bsl::vector& appIDs = - domain->config().mode().fanout().appIDs(); - for (bsl::vector::const_iterator cit = appIDs.begin(); - cit != appIDs.end(); - ++cit) { - StatSubContextMp subContext = d_statContext_mp->addSubcontext( - mwcst::StatContextConfiguration(*cit, &localAllocator)); - d_subContexts_mp->emplace_back( - bslmf::MovableRefUtil::move(subContext)); - } + domain->config().mode().isFanoutValue() && + domain->config().mode().fanout().publishAppIdMetrics()) { + d_subContexts_mp.load(new (*allocator) + bsl::list(allocator), + allocator); + const bsl::vector& appIDs = + domain->config().mode().fanout().appIDs(); + for (bsl::vector::const_iterator cit = appIDs.begin(); + cit != appIDs.end(); + ++cit) { + StatSubContextMp subContext = d_statContext_mp->addSubcontext( + mwcst::StatContextConfiguration(*cit, &localAllocator)); + d_subContexts_mp->emplace_back( + bslmf::MovableRefUtil::move(subContext)); } } } diff --git a/src/integration-tests/test_admin_client.py b/src/integration-tests/test_admin_client.py index 010d63df0..882fbff5c 100644 --- a/src/integration-tests/test_admin_client.py +++ b/src/integration-tests/test_admin_client.py @@ -158,7 +158,6 @@ def test_breathing(single_node: Cluster) -> None: admin.stop() -@tweak.broker.app_config.stats.app_id_tag_domains([tc.DOMAIN_FANOUT]) def test_queue_stats(single_node: Cluster) -> None: """ Test: queue metrics via admin command. @@ -184,6 +183,12 @@ def test_queue_stats(single_node: Cluster) -> None: - Safeguarding mechanism prevents from getting stats too often. """ + domains = {domain.name: domain for domain in single_node.configurator.domains} + domains[ + tc.DOMAIN_FANOUT + ].definition.parameters.mode.fanout.publish_app_id_metrics = True + single_node.deploy_domains() + # Preconditions admin = AdminClient() admin.connect(*single_node.admin_endpoint) diff --git a/src/python/blazingmq/dev/configurator/__init__.py b/src/python/blazingmq/dev/configurator/__init__.py index 80bab3e9f..4d73f78df 100644 --- a/src/python/blazingmq/dev/configurator/__init__.py +++ b/src/python/blazingmq/dev/configurator/__init__.py @@ -407,7 +407,6 @@ class Proto: ), ), stats=mqbcfg.StatsConfig( - app_id_tag_domains=[], plugins=[], snapshot_interval=1, printer=mqbcfg.StatsPrinterConfig( diff --git a/src/python/blazingmq/dev/it/tweaks/generated.py b/src/python/blazingmq/dev/it/tweaks/generated.py index c39c3dcf7..7f635a042 100644 --- a/src/python/blazingmq/dev/it/tweaks/generated.py +++ b/src/python/blazingmq/dev/it/tweaks/generated.py @@ -40,6 +40,7 @@ def __call__(self, tweak: Callable) -> Callable: class Broker: class TaskConfig(metaclass=TweakMetaclass): class AllocatorType(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -50,12 +51,14 @@ def __call__( allocator_type = AllocatorType() class AllocationLimit(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... allocation_limit = AllocationLimit() class LogController(metaclass=TweakMetaclass): class FileName(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -63,6 +66,7 @@ def __call__( file_name = FileName() class FileMaxAgeDays(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -70,6 +74,7 @@ def __call__( file_max_age_days = FileMaxAgeDays() class RotationBytes(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -77,6 +82,7 @@ def __call__( rotation_bytes = RotationBytes() class LogfileFormat(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -84,6 +90,7 @@ def __call__( logfile_format = LogfileFormat() class ConsoleFormat(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -91,6 +98,7 @@ def __call__( console_format = ConsoleFormat() class LoggingVerbosity(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -98,11 +106,13 @@ def __call__( logging_verbosity = LoggingVerbosity() class BslsLogSeverityThreshold(metaclass=TweakMetaclass): + def __call__(self, value: str) -> Callable: ... bsls_log_severity_threshold = BslsLogSeverityThreshold() class ConsoleSeverityThreshold(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -110,17 +120,20 @@ def __call__( console_severity_threshold = ConsoleSeverityThreshold() class Categories(metaclass=TweakMetaclass): + def __call__(self, value: None) -> Callable: ... categories = Categories() class Syslog(metaclass=TweakMetaclass): class Enabled(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... enabled = Enabled() class AppName(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -128,6 +141,7 @@ def __call__( app_name = AppName() class LogFormat(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -135,6 +149,7 @@ def __call__( log_format = LogFormat() class Verbosity(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -167,51 +182,61 @@ def __call__( class AppConfig(metaclass=TweakMetaclass): class BrokerInstanceName(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... broker_instance_name = BrokerInstanceName() class BrokerVersion(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... broker_version = BrokerVersion() class ConfigVersion(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... config_version = ConfigVersion() class EtcDir(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... etc_dir = EtcDir() class HostName(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... host_name = HostName() class HostTags(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... host_tags = HostTags() class HostDataCenter(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... host_data_center = HostDataCenter() class IsRunningOnDev(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[bool, NoneType]) -> Callable: ... is_running_on_dev = IsRunningOnDev() class LogsObserverMaxSize(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... logs_observer_max_size = LogsObserverMaxSize() class LatencyMonitorDomain(metaclass=TweakMetaclass): + def __call__(self, value: str) -> Callable: ... latency_monitor_domain = LatencyMonitorDomain() @@ -219,6 +244,7 @@ def __call__(self, value: str) -> Callable: ... class DispatcherConfig(metaclass=TweakMetaclass): class Sessions(metaclass=TweakMetaclass): class NumProcessors(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -227,6 +253,7 @@ def __call__( class ProcessorConfig(metaclass=TweakMetaclass): class QueueSize(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -234,6 +261,7 @@ def __call__( queue_size = QueueSize() class QueueSizeLowWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -241,6 +269,7 @@ def __call__( queue_size_low_watermark = QueueSizeLowWatermark() class QueueSizeHighWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -268,6 +297,7 @@ def __call__( class Queues(metaclass=TweakMetaclass): class NumProcessors(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -276,6 +306,7 @@ def __call__( class ProcessorConfig(metaclass=TweakMetaclass): class QueueSize(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -283,6 +314,7 @@ def __call__( queue_size = QueueSize() class QueueSizeLowWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -290,6 +322,7 @@ def __call__( queue_size_low_watermark = QueueSizeLowWatermark() class QueueSizeHighWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -317,6 +350,7 @@ def __call__( class Clusters(metaclass=TweakMetaclass): class NumProcessors(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -325,6 +359,7 @@ def __call__( class ProcessorConfig(metaclass=TweakMetaclass): class QueueSize(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -332,6 +367,7 @@ def __call__( queue_size = QueueSize() class QueueSizeLowWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -339,6 +375,7 @@ def __call__( queue_size_low_watermark = QueueSizeLowWatermark() class QueueSizeHighWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -375,59 +412,63 @@ def __call__( class Stats(metaclass=TweakMetaclass): class SnapshotInterval(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... snapshot_interval = SnapshotInterval() - class AppIdTagDomains(metaclass=TweakMetaclass): - - def __call__(self, value: None) -> Callable: ... - - app_id_tag_domains = AppIdTagDomains() - class Plugins(metaclass=TweakMetaclass): class Name(metaclass=TweakMetaclass): + def __call__(self, value: str) -> Callable: ... name = Name() class QueueSize(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... queue_size = QueueSize() class QueueHighWatermark(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... queue_high_watermark = QueueHighWatermark() class QueueLowWatermark(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... queue_low_watermark = QueueLowWatermark() class PublishInterval(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... publish_interval = PublishInterval() class NamespacePrefix(metaclass=TweakMetaclass): + def __call__(self, value: str) -> Callable: ... namespace_prefix = NamespacePrefix() class Hosts(metaclass=TweakMetaclass): + def __call__(self, value: None) -> Callable: ... hosts = Hosts() class InstanceId(metaclass=TweakMetaclass): + def __call__(self, value: str) -> Callable: ... instance_id = InstanceId() class PrometheusSpecific(metaclass=TweakMetaclass): class Mode(metaclass=TweakMetaclass): + def __call__( self, value: blazingmq.schemas.mqbcfg.ExportMode ) -> Callable: ... @@ -435,11 +476,13 @@ def __call__( mode = Mode() class Host(metaclass=TweakMetaclass): + def __call__(self, value: str) -> Callable: ... host = Host() class Port(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... port = Port() @@ -460,11 +503,13 @@ def __call__(self, value: None) -> Callable: ... class Printer(metaclass=TweakMetaclass): class PrintInterval(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... print_interval = PrintInterval() class File(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -472,6 +517,7 @@ def __call__( file = File() class MaxAgeDays(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -479,11 +525,13 @@ def __call__( max_age_days = MaxAgeDays() class RotateBytes(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... rotate_bytes = RotateBytes() class RotateDays(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... rotate_days = RotateDays() @@ -507,21 +555,25 @@ def __call__( class NetworkInterfaces(metaclass=TweakMetaclass): class Heartbeats(metaclass=TweakMetaclass): class Client(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... client = Client() class DownstreamBroker(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... downstream_broker = DownstreamBroker() class UpstreamBroker(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... upstream_broker = UpstreamBroker() class ClusterPeer(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... cluster_peer = ClusterPeer() @@ -537,6 +589,7 @@ def __call__( class TcpInterface(metaclass=TweakMetaclass): class Name(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -544,6 +597,7 @@ def __call__( name = Name() class Port(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -551,6 +605,7 @@ def __call__( port = Port() class IoThreads(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -558,11 +613,13 @@ def __call__( io_threads = IoThreads() class MaxConnections(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_connections = MaxConnections() class LowWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -570,6 +627,7 @@ def __call__( low_watermark = LowWatermark() class HighWatermark(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -577,16 +635,19 @@ def __call__( high_watermark = HighWatermark() class NodeLowWatermark(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... node_low_watermark = NodeLowWatermark() class NodeHighWatermark(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... node_high_watermark = NodeHighWatermark() class HeartbeatIntervalMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... heartbeat_interval_ms = HeartbeatIntervalMs() @@ -611,6 +672,7 @@ def __call__( class BmqconfConfig(metaclass=TweakMetaclass): class CacheTtlseconds(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -628,11 +690,13 @@ def __call__( class Plugins(metaclass=TweakMetaclass): class Libraries(metaclass=TweakMetaclass): + def __call__(self, value: None) -> Callable: ... libraries = Libraries() class Enabled(metaclass=TweakMetaclass): + def __call__(self, value: None) -> Callable: ... enabled = Enabled() @@ -646,16 +710,19 @@ def __call__( class MessagePropertiesV2(metaclass=TweakMetaclass): class AdvertiseV2Support(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... advertise_v2_support = AdvertiseV2Support() class MinCppSdkVersion(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... min_cpp_sdk_version = MinCppSdkVersion() class MinJavaSdkVersion(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... min_java_sdk_version = MinJavaSdkVersion() @@ -670,6 +737,7 @@ def __call__( message_properties_v2 = MessagePropertiesV2() class ConfigureStream(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... configure_stream = ConfigureStream() @@ -688,6 +756,7 @@ def __call__( class Domain: class Name(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... name = Name() @@ -695,10 +764,17 @@ def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... class Mode(metaclass=TweakMetaclass): class Fanout(metaclass=TweakMetaclass): class AppIds(metaclass=TweakMetaclass): + def __call__(self, value: None) -> Callable: ... app_ids = AppIds() + class PublishAppIdMetrics(metaclass=TweakMetaclass): + + def __call__(self, value: bool) -> Callable: ... + + publish_app_id_metrics = PublishAppIdMetrics() + def __call__( self, value: typing.Union[ @@ -709,6 +785,7 @@ def __call__( fanout = Fanout() class Priority(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -719,6 +796,7 @@ def __call__( priority = Priority() class Broadcast(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -737,6 +815,7 @@ def __call__( class Storage(metaclass=TweakMetaclass): class DomainLimits(metaclass=TweakMetaclass): class Messages(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -744,11 +823,13 @@ def __call__( messages = Messages() class MessagesWatermarkRatio(metaclass=TweakMetaclass): + def __call__(self, value: decimal.Decimal) -> Callable: ... messages_watermark_ratio = MessagesWatermarkRatio() class Bytes(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -756,6 +837,7 @@ def __call__( bytes = Bytes() class BytesWatermarkRatio(metaclass=TweakMetaclass): + def __call__(self, value: decimal.Decimal) -> Callable: ... bytes_watermark_ratio = BytesWatermarkRatio() @@ -769,6 +851,7 @@ def __call__( class QueueLimits(metaclass=TweakMetaclass): class Messages(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -776,11 +859,13 @@ def __call__( messages = Messages() class MessagesWatermarkRatio(metaclass=TweakMetaclass): + def __call__(self, value: decimal.Decimal) -> Callable: ... messages_watermark_ratio = MessagesWatermarkRatio() class Bytes(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[int, NoneType] ) -> Callable: ... @@ -788,6 +873,7 @@ def __call__( bytes = Bytes() class BytesWatermarkRatio(metaclass=TweakMetaclass): + def __call__(self, value: decimal.Decimal) -> Callable: ... bytes_watermark_ratio = BytesWatermarkRatio() @@ -801,6 +887,7 @@ def __call__( class Config(metaclass=TweakMetaclass): class InMemory(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -811,6 +898,7 @@ def __call__( in_memory = InMemory() class FileBacked(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -837,32 +925,38 @@ def __call__( storage = Storage() class MaxConsumers(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_consumers = MaxConsumers() class MaxProducers(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_producers = MaxProducers() class MaxQueues(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_queues = MaxQueues() class MsgGroupIdConfig(metaclass=TweakMetaclass): class Rebalance(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... rebalance = Rebalance() class MaxGroups(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_groups = MaxGroups() class TtlSeconds(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... ttl_seconds = TtlSeconds() @@ -877,27 +971,32 @@ def __call__( msg_group_id_config = MsgGroupIdConfig() class MaxIdleTime(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_idle_time = MaxIdleTime() class MessageTtl(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... message_ttl = MessageTtl() class MaxDeliveryAttempts(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_delivery_attempts = MaxDeliveryAttempts() class DeduplicationTimeMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... deduplication_time_ms = DeduplicationTimeMs() class Consistency(metaclass=TweakMetaclass): class Eventual(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -908,6 +1007,7 @@ def __call__( eventual = Eventual() class Strong(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -926,12 +1026,14 @@ def __call__( class Subscriptions(metaclass=TweakMetaclass): class AppId(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... app_id = AppId() class Expression(metaclass=TweakMetaclass): class Version(metaclass=TweakMetaclass): + def __call__( self, value: blazingmq.schemas.mqbconf.ExpressionVersion ) -> Callable: ... @@ -939,6 +1041,7 @@ def __call__( version = Version() class Text(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -958,22 +1061,26 @@ def __call__(self, value: None) -> Callable: ... class Cluster: class Name(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... name = Name() class Nodes(metaclass=TweakMetaclass): class Id(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... id = Id() class Name(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... name = Name() class DataCenter(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... data_center = DataCenter() @@ -981,6 +1088,7 @@ def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... class Transport(metaclass=TweakMetaclass): class Tcp(metaclass=TweakMetaclass): class Endpoint(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[str, NoneType] ) -> Callable: ... @@ -1011,97 +1119,116 @@ def __call__(self, value: None) -> Callable: ... class PartitionConfig(metaclass=TweakMetaclass): class NumPartitions(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... num_partitions = NumPartitions() class Location(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... location = Location() class ArchiveLocation(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[str, NoneType]) -> Callable: ... archive_location = ArchiveLocation() class MaxDataFileSize(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... max_data_file_size = MaxDataFileSize() class MaxJournalFileSize(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... max_journal_file_size = MaxJournalFileSize() class MaxQlistFileSize(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... max_qlist_file_size = MaxQlistFileSize() class Preallocate(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... preallocate = Preallocate() class MaxArchivedFileSets(metaclass=TweakMetaclass): + def __call__(self, value: typing.Union[int, NoneType]) -> Callable: ... max_archived_file_sets = MaxArchivedFileSets() class PrefaultPages(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... prefault_pages = PrefaultPages() class FlushAtShutdown(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... flush_at_shutdown = FlushAtShutdown() class SyncConfig(metaclass=TweakMetaclass): class StartupRecoveryMaxDurationMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... startup_recovery_max_duration_ms = StartupRecoveryMaxDurationMs() class MaxAttemptsStorageSync(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_attempts_storage_sync = MaxAttemptsStorageSync() class StorageSyncReqTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... storage_sync_req_timeout_ms = StorageSyncReqTimeoutMs() class MasterSyncMaxDurationMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... master_sync_max_duration_ms = MasterSyncMaxDurationMs() class PartitionSyncStateReqTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... partition_sync_state_req_timeout_ms = PartitionSyncStateReqTimeoutMs() class PartitionSyncDataReqTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... partition_sync_data_req_timeout_ms = PartitionSyncDataReqTimeoutMs() class StartupWaitDurationMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... startup_wait_duration_ms = StartupWaitDurationMs() class FileChunkSize(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... file_chunk_size = FileChunkSize() class PartitionSyncEventSize(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... partition_sync_event_size = PartitionSyncEventSize() @@ -1123,6 +1250,7 @@ def __call__( partition_config = PartitionConfig() class MasterAssignment(metaclass=TweakMetaclass): + def __call__( self, value: typing.Union[ @@ -1134,46 +1262,55 @@ def __call__( class Elector(metaclass=TweakMetaclass): class InitialWaitTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... initial_wait_timeout_ms = InitialWaitTimeoutMs() class MaxRandomWaitTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_random_wait_timeout_ms = MaxRandomWaitTimeoutMs() class ScoutingResultTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... scouting_result_timeout_ms = ScoutingResultTimeoutMs() class ElectionResultTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... election_result_timeout_ms = ElectionResultTimeoutMs() class HeartbeatBroadcastPeriodMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... heartbeat_broadcast_period_ms = HeartbeatBroadcastPeriodMs() class HeartbeatCheckPeriodMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... heartbeat_check_period_ms = HeartbeatCheckPeriodMs() class HeartbeatMissCount(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... heartbeat_miss_count = HeartbeatMissCount() class Quorum(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... quorum = Quorum() class LeaderSyncDelayMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... leader_sync_delay_ms = LeaderSyncDelayMs() @@ -1187,61 +1324,73 @@ def __call__( class QueueOperations(metaclass=TweakMetaclass): class OpenTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... open_timeout_ms = OpenTimeoutMs() class ConfigureTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... configure_timeout_ms = ConfigureTimeoutMs() class CloseTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... close_timeout_ms = CloseTimeoutMs() class ReopenTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... reopen_timeout_ms = ReopenTimeoutMs() class ReopenRetryIntervalMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... reopen_retry_interval_ms = ReopenRetryIntervalMs() class ReopenMaxAttempts(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... reopen_max_attempts = ReopenMaxAttempts() class AssignmentTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... assignment_timeout_ms = AssignmentTimeoutMs() class KeepaliveDurationMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... keepalive_duration_ms = KeepaliveDurationMs() class ConsumptionMonitorPeriodMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... consumption_monitor_period_ms = ConsumptionMonitorPeriodMs() class StopTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... stop_timeout_ms = StopTimeoutMs() class ShutdownTimeoutMs(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... shutdown_timeout_ms = ShutdownTimeoutMs() class AckWindowSize(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... ack_window_size = AckWindowSize() @@ -1257,11 +1406,13 @@ def __call__( class ClusterAttributes(metaclass=TweakMetaclass): class IsCslmodeEnabled(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... is_cslmode_enabled = IsCslmodeEnabled() class IsFsmworkflow(metaclass=TweakMetaclass): + def __call__(self, value: bool) -> Callable: ... is_fsmworkflow = IsFsmworkflow() @@ -1277,41 +1428,49 @@ def __call__( class ClusterMonitorConfig(metaclass=TweakMetaclass): class MaxTimeLeader(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_time_leader = MaxTimeLeader() class MaxTimeMaster(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_time_master = MaxTimeMaster() class MaxTimeNode(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_time_node = MaxTimeNode() class MaxTimeFailover(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... max_time_failover = MaxTimeFailover() class ThresholdLeader(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... threshold_leader = ThresholdLeader() class ThresholdMaster(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... threshold_master = ThresholdMaster() class ThresholdNode(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... threshold_node = ThresholdNode() class ThresholdFailover(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... threshold_failover = ThresholdFailover() @@ -1327,21 +1486,25 @@ def __call__( class MessageThrottleConfig(metaclass=TweakMetaclass): class LowThreshold(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... low_threshold = LowThreshold() class HighThreshold(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... high_threshold = HighThreshold() class LowInterval(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... low_interval = LowInterval() class HighInterval(metaclass=TweakMetaclass): + def __call__(self, value: int) -> Callable: ... high_interval = HighInterval() diff --git a/src/python/blazingmq/schemas/mqbcfg.py b/src/python/blazingmq/schemas/mqbcfg.py index c7b82076e..35d9b2c41 100644 --- a/src/python/blazingmq/schemas/mqbcfg.py +++ b/src/python/blazingmq/schemas/mqbcfg.py @@ -1773,15 +1773,6 @@ class StatsConfig: "required": True, }, ) - app_id_tag_domains: List[str] = field( - default_factory=list, - metadata={ - "name": "appIdTagDomains", - "type": "Element", - "namespace": "http://bloomberg.com/schemas/mqbcfg", - "min_occurs": 1, - }, - ) plugins: List[StatPluginConfig] = field( default_factory=list, metadata={ diff --git a/src/python/blazingmq/schemas/mqbconf.py b/src/python/blazingmq/schemas/mqbconf.py index 70d114118..b16a744d0 100644 --- a/src/python/blazingmq/schemas/mqbconf.py +++ b/src/python/blazingmq/schemas/mqbconf.py @@ -284,7 +284,9 @@ class QueueModeBroadcast: class QueueModeFanout: """Configuration for a fanout queue. - appIDs.: List of appIDs authorized to consume from the queue. + appIDs.............: List of appIDs authorized to consume from the + queue. + publishAppIdMetrics: Whether to publish appId metrics. """ app_ids: List[str] = field( @@ -296,6 +298,15 @@ class QueueModeFanout: "min_occurs": 1, }, ) + publish_app_id_metrics: bool = field( + default=False, + metadata={ + "name": "publishAppIdMetrics", + "type": "Element", + "namespace": "urn:x-bloomberg-com:mqbconfm", + "required": True, + }, + ) @dataclass