@@ -345,16 +345,16 @@ struct BuildAckOverflowFunctor {
345345// -------------------------
346346
347347ClientSessionState::ClientSessionState (
348- bslma::ManagedPtr <bmqst::StatContext>& clientStatContext,
349- BlobSpPool* blobSpPool,
350- bdlbb::BlobBufferFactory* bufferFactory,
351- bmqp::EncodingType::Enum encodingType,
352- bslma::Allocator* allocator)
348+ const bsl::shared_ptr <bmqst::StatContext>& clientStatContext,
349+ BlobSpPool* blobSpPool,
350+ bdlbb::BlobBufferFactory* bufferFactory,
351+ bmqp::EncodingType::Enum encodingType,
352+ bslma::Allocator* allocator)
353353: d_allocator_p(allocator)
354354, d_channelBufferQueue(allocator)
355355, d_unackedMessageInfos(d_allocator_p)
356356, d_dispatcherClientData()
357- , d_statContext_mp (clientStatContext)
357+ , d_statContext_sp (clientStatContext)
358358, d_bufferFactory_p(bufferFactory)
359359, d_blobSpPool_p(blobSpPool)
360360, d_schemaEventBuilder(blobSpPool, encodingType, allocator)
@@ -662,7 +662,7 @@ void ClientSession::sendAck(bmqt::AckResult::Enum status,
662662 queueStats = invalidQueueStats ();
663663 }
664664 else {
665- queueStats = subQueueCiter->value ().d_stats .get ();
665+ queueStats = subQueueCiter->value ().d_stats_sp .get ();
666666 }
667667 }
668668
@@ -1906,23 +1906,10 @@ bool ClientSession::validateMessage(mqbi::QueueHandle** queueHandle,
19061906 return false ; // RETURN
19071907 }
19081908
1909- StreamsMap::iterator subQueueIt =
1910- queueIt->second .d_subQueueInfosMap .findBySubIdSafe (queueId.subId ());
1911- if (BSLS_PERFORMANCEHINT_PREDICT_UNLIKELY (
1912- subQueueIt == queueIt->second .d_subQueueInfosMap .end ())) {
1913- BSLS_PERFORMANCEHINT_UNLIKELY_HINT;
1914-
1915- if (eventType == bmqp::EventType::e_CONFIRM) {
1916- // Update invalid queue stats
1917- invalidQueueStats ()->onEvent (
1918- mqbstat::QueueStatsClient::EventType::e_CONFIRM,
1919- 1 );
1920- }
1921-
1922- *errorStream << " for an unknown subQueueId" ;
1923-
1924- return false ; // RETURN
1925- }
1909+ // Do not lookup 'queueId.subId()'.
1910+ // 'QueueHandle::confirmMessageDispatched' does the check.
1911+ // Note, that it does not update stats (on "bmq://invalid/queue").
1912+ // It does log warnings.
19261913
19271914 *queueHandle = queueIt->second .d_handle_p ;
19281915 BSLS_ASSERT_SAFE (queueHandle);
@@ -1968,13 +1955,6 @@ bool ClientSession::validateMessage(mqbi::QueueHandle** queueHandle,
19681955 return false ; // RETURN
19691956 }
19701957
1971- if (eventType == bmqp::EventType::e_CONFIRM) {
1972- // Update stats for the queue (or subStream of the queue)
1973- subQueueIt->value ().d_stats ->onEvent (
1974- mqbstat::QueueStatsClient::EventType::e_CONFIRM,
1975- 1 );
1976- }
1977-
19781958 return true ;
19791959}
19801960
@@ -2116,7 +2096,7 @@ void ClientSession::onPushEvent(const mqbi::DispatcherPushEvent& event)
21162096 blob->length ());
21172097 }
21182098 else {
2119- subQueueCiter->value ().d_stats -> onEvent (
2099+ subQueueCiter->value ().onEvent (
21202100 mqbstat::QueueStatsClient::EventType::e_PUSH,
21212101 blob->length ());
21222102 }
@@ -2267,9 +2247,8 @@ void ClientSession::onPutEvent(const mqbi::DispatcherPutEvent& event)
22672247 BSLS_ASSERT_SAFE (queueStatePtr && subQueueInfoPtr);
22682248 BSLS_ASSERT_SAFE (queueStatePtr->d_handle_p );
22692249
2270- subQueueInfoPtr->d_stats ->onEvent (
2271- mqbstat::QueueStatsClient::EventType::e_PUT,
2272- appDataSp->length ());
2250+ subQueueInfoPtr->onEvent (mqbstat::QueueStatsClient::EventType::e_PUT,
2251+ appDataSp->length ());
22732252
22742253 const bool isAtMostOnce =
22752254 queueStatePtr->d_handle_p ->queue ()->isAtMostOnce ();
@@ -2436,7 +2415,7 @@ mqbstat::QueueStatsClient* ClientSession::invalidQueueStats()
24362415 d_state.d_invalidQueueStats .makeValue ();
24372416 d_state.d_invalidQueueStats .value ().initialize (
24382417 " bmq://invalid/queue" ,
2439- d_state.d_statContext_mp .get (),
2418+ d_state.d_statContext_sp .get (),
24402419 d_state.d_allocator_p );
24412420 // TBD: The queue uri should be '** INVALID QUEUE **', but that can
24422421 // only be done once the stats UI panel has been updated to
@@ -2639,17 +2618,17 @@ bool ClientSession::validatePutMessage(QueueState** queueState,
26392618
26402619// CREATORS
26412620ClientSession::ClientSession (
2642- const bsl::shared_ptr<bmqio::Channel>& channel,
2643- const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage,
2644- const bsl::string& sessionDescription,
2645- mqbi::Dispatcher* dispatcher,
2646- mqbblp::ClusterCatalog* clusterCatalog,
2647- mqbi::DomainFactory* domainFactory,
2648- bslma::ManagedPtr <bmqst::StatContext>& clientStatContext,
2649- ClientSessionState::BlobSpPool* blobSpPool,
2650- bdlbb::BlobBufferFactory* bufferFactory,
2651- bdlmt::EventScheduler* scheduler,
2652- bslma::Allocator* allocator)
2621+ const bsl::shared_ptr<bmqio::Channel>& channel,
2622+ const bmqp_ctrlmsg::NegotiationMessage& negotiationMessage,
2623+ const bsl::string& sessionDescription,
2624+ mqbi::Dispatcher* dispatcher,
2625+ mqbblp::ClusterCatalog* clusterCatalog,
2626+ mqbi::DomainFactory* domainFactory,
2627+ const bsl::shared_ptr <bmqst::StatContext>& clientStatContext,
2628+ ClientSessionState::BlobSpPool* blobSpPool,
2629+ bdlbb::BlobBufferFactory* bufferFactory,
2630+ bdlmt::EventScheduler* scheduler,
2631+ bslma::Allocator* allocator)
26532632: d_self(this ) // use default allocator
26542633, d_operationState(e_RUNNING)
26552634, d_isDisconnecting(false )
@@ -2670,7 +2649,7 @@ ClientSession::ClientSession(
26702649 allocator)
26712650, d_queueSessionManager(this ,
26722651 *d_clientIdentity_p,
2673- d_state.d_statContext_mp.get() ,
2652+ d_state.d_statContext_sp ,
26742653 domainFactory,
26752654 allocator)
26762655, d_clusterCatalog_p(clusterCatalog)
0 commit comments