Skip to content

Commit e19ff33

Browse files
authored
Fix[BMQ,MQB]: ensure Solaris build (#561)
Signed-off-by: Evgeny Malygin <[email protected]>
1 parent e9661a3 commit e19ff33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+366
-344
lines changed

Diff for: src/applications/bmqstoragetool/bmqstoragetool.m.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ static bool parseArgs(CommandLineArguments& arguments,
3838
{
3939
bool showHelp = false;
4040

41+
bsl::vector<bsl::string> defaultRecordType(allocator);
42+
defaultRecordType.push_back(CommandLineArguments::k_MESSAGE_TYPE);
43+
4144
balcl::OptionInfo specTable[] = {
4245
{"r|record-type",
4346
"record type",
4447
"record type to search {message|queue-op|journal-op}",
4548
balcl::TypeInfo(&arguments.d_recordType,
4649
CommandLineArguments::isValidRecordType),
47-
balcl::OccurrenceInfo(bsl::vector<bsl::string>(
48-
{CommandLineArguments::k_MESSAGE_TYPE}))},
50+
balcl::OccurrenceInfo(defaultRecordType)},
4951
{"journal-path",
5052
"journal path",
5153
"'*'-ended file path pattern, where the tool will try to find "

Diff for: src/applications/bmqstoragetool/m_bmqstoragetool_journalfileprocessor.t.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ static void test12_printMessagesDetailsTest()
923923
bmqtst::TestHelper::printTestName("PRINT MESSAGE DETAILS TEST");
924924

925925
#if defined(BSLS_PLATFORM_OS_SOLARIS)
926-
s_ignoreCheckDefAlloc = true;
926+
bmqtst::TestHelperUtil::ignoreCheckDefAlloc() = true;
927927
// Disable default allocator check for this test until we can debug
928928
// it on Solaris
929929
#endif

Diff for: src/groups/bmq/bmqa/bmqa_message.t.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void test2_validPushMessagePrint()
166166
bdlbb::PooledBlobBufferFactory bufferFactory(
167167
4 * 1024,
168168
bmqtst::TestHelperUtil::allocator());
169-
bmqp::BlobPoolUtil::BlobSpPool blobSpPool(
169+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
170170
bmqp::BlobPoolUtil::createBlobPool(
171171
&bufferFactory,
172172
bmqtst::TestHelperUtil::allocator()));
@@ -192,7 +192,7 @@ static void test2_validPushMessagePrint()
192192
bsl::strlen(buffer));
193193

194194
// Create PushEventBuilder
195-
bmqp::PushEventBuilder peb(&blobSpPool,
195+
bmqp::PushEventBuilder peb(blobSpPool.get(),
196196
bmqtst::TestHelperUtil::allocator());
197197
BMQTST_ASSERT_EQ(sizeof(bmqp::EventHeader),
198198
static_cast<size_t>(peb.eventSize()));
@@ -256,7 +256,7 @@ static void test3_messageProperties()
256256
bdlbb::PooledBlobBufferFactory bufferFactory(
257257
4 * 1024,
258258
bmqtst::TestHelperUtil::allocator());
259-
bmqp::BlobPoolUtil::BlobSpPool blobSpPool(
259+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
260260
bmqp::BlobPoolUtil::createBlobPool(
261261
&bufferFactory,
262262
bmqtst::TestHelperUtil::allocator()));
@@ -290,7 +290,7 @@ static void test3_messageProperties()
290290
bdlbb::BlobUtil::append(&payload, buffer, bsl::strlen(buffer));
291291

292292
// Create PushEventBuilder
293-
bmqp::PushEventBuilder peb(&blobSpPool,
293+
bmqp::PushEventBuilder peb(blobSpPool.get(),
294294
bmqtst::TestHelperUtil::allocator());
295295

296296
// Add SubQueueInfo option
@@ -432,7 +432,7 @@ static void test4_subscriptionHandle()
432432
bdlbb::PooledBlobBufferFactory bufferFactory(
433433
4 * 1024,
434434
bmqtst::TestHelperUtil::allocator());
435-
bmqp::BlobPoolUtil::BlobSpPool blobSpPool(
435+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
436436
bmqp::BlobPoolUtil::createBlobPool(
437437
&bufferFactory,
438438
bmqtst::TestHelperUtil::allocator()));
@@ -459,7 +459,7 @@ static void test4_subscriptionHandle()
459459
bmqtst::TestHelperUtil::allocator());
460460

461461
// Create PushEventBuilder
462-
bmqp::PushEventBuilder peb(&blobSpPool,
462+
bmqp::PushEventBuilder peb(blobSpPool.get(),
463463
bmqtst::TestHelperUtil::allocator());
464464
BMQTST_ASSERT_EQ(0, peb.messageCount());
465465

@@ -525,7 +525,7 @@ static void test4_subscriptionHandle()
525525
bmqtst::TestHelperUtil::allocator());
526526

527527
// Create PushEventBuilder
528-
bmqp::PushEventBuilder peb(&blobSpPool,
528+
bmqp::PushEventBuilder peb(blobSpPool.get(),
529529
bmqtst::TestHelperUtil::allocator());
530530
BMQTST_ASSERT_EQ(0, peb.messageCount());
531531

@@ -573,7 +573,7 @@ static void test4_subscriptionHandle()
573573
bmqtst::TestHelperUtil::allocator());
574574

575575
// Create PutEventBuilder
576-
bmqp::PutEventBuilder builder(&blobSpPool,
576+
bmqp::PutEventBuilder builder(blobSpPool.get(),
577577
bmqtst::TestHelperUtil::allocator());
578578
BMQTST_ASSERT_EQ(0, builder.messageCount());
579579

@@ -614,7 +614,7 @@ static void test4_subscriptionHandle()
614614
bmqtst::TestHelperUtil::allocator());
615615

616616
// Create AckEventBuilder
617-
bmqp::AckEventBuilder builder(&blobSpPool,
617+
bmqp::AckEventBuilder builder(blobSpPool.get(),
618618
bmqtst::TestHelperUtil::allocator());
619619
BMQTST_ASSERT_EQ(0, builder.messageCount());
620620

Diff for: src/groups/bmq/bmqa/bmqa_messageevent.t.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ static void test2_ackMesageIteratorTest()
167167
bdlbb::PooledBlobBufferFactory bufferFactory(
168168
256,
169169
bmqtst::TestHelperUtil::allocator());
170-
bmqp::BlobPoolUtil::BlobSpPool blobSpPool(
170+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
171171
bmqp::BlobPoolUtil::createBlobPool(
172172
&bufferFactory,
173173
bmqtst::TestHelperUtil::allocator()));
174-
bmqp::AckEventBuilder builder(&blobSpPool,
174+
bmqp::AckEventBuilder builder(blobSpPool.get(),
175175
bmqtst::TestHelperUtil::allocator());
176176
bsl::vector<AckData> messages(bmqtst::TestHelperUtil::allocator());
177177

@@ -234,11 +234,11 @@ static void test3_putMessageIteratorTest()
234234
bdlbb::PooledBlobBufferFactory bufferFactory(
235235
256,
236236
bmqtst::TestHelperUtil::allocator());
237-
bmqp::BlobPoolUtil::BlobSpPool blobSpPool(
237+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
238238
bmqp::BlobPoolUtil::createBlobPool(
239239
&bufferFactory,
240240
bmqtst::TestHelperUtil::allocator()));
241-
bmqp::PutEventBuilder builder(&blobSpPool,
241+
bmqp::PutEventBuilder builder(blobSpPool.get(),
242242
bmqtst::TestHelperUtil::allocator());
243243
bsl::vector<PutData> messages(bmqtst::TestHelperUtil::allocator());
244244

Diff for: src/groups/bmq/bmqa/bmqa_mocksession.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,10 @@ Event MockSessionUtil::createAckEvent(const bsl::vector<AckParams>& acks,
292292

293293
// TODO: deprecate `createAckEvent` with bufferFactory arg and introduce
294294
// another function with BlobSpPool arg.
295-
BlobSpPool blobSpPool(
295+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
296296
bmqp::BlobPoolUtil::createBlobPool(bufferFactory, allocator));
297297

298-
bmqp::AckEventBuilder ackBuilder(&blobSpPool, alloc);
298+
bmqp::AckEventBuilder ackBuilder(blobSpPool.get(), alloc);
299299
for (size_t i = 0; i != acks.size(); ++i) {
300300
const AckParams& params = acks[i];
301301
const QueueImplSp& impQueue = reinterpret_cast<const QueueImplSp&>(
@@ -335,10 +335,10 @@ Event MockSessionUtil::createPushEvent(
335335

336336
// TODO: deprecate `createPushEvent` with bufferFactory arg and introduce
337337
// another function with BlobSpPool arg.
338-
BlobSpPool blobSpPool(
338+
bmqp::BlobPoolUtil::BlobSpPoolSp blobSpPool(
339339
bmqp::BlobPoolUtil::createBlobPool(bufferFactory, allocator));
340340

341-
bmqp::PushEventBuilder pushBuilder(&blobSpPool, alloc);
341+
bmqp::PushEventBuilder pushBuilder(blobSpPool.get(), alloc);
342342

343343
for (size_t i = 0; i != pushEventParams.size(); ++i) {
344344
const QueueImplSp& queueImplPtr = reinterpret_cast<const QueueImplSp&>(
@@ -948,7 +948,7 @@ int MockSession::start(const bsls::TimeInterval& timeout)
948948
MockSession::MockSession(const bmqt::SessionOptions& options,
949949
bslma::Allocator* allocator)
950950
: d_blobBufferFactory(1024, allocator)
951-
, d_blobSpPool(
951+
, d_blobSpPool_sp(
952952
bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, allocator))
953953
, d_eventHandler_mp(0)
954954
, d_calls(allocator)
@@ -994,7 +994,7 @@ MockSession::MockSession(bslma::ManagedPtr<SessionEventHandler> eventHandler,
994994
const bmqt::SessionOptions& options,
995995
bslma::Allocator* allocator)
996996
: d_blobBufferFactory(1024, allocator)
997-
, d_blobSpPool(
997+
, d_blobSpPool_sp(
998998
bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory, allocator))
999999
, d_eventHandler_mp(eventHandler)
10001000
, d_calls(bslma::Default::allocator(allocator))
@@ -1520,7 +1520,7 @@ void MockSession::loadMessageEventBuilder(MessageEventBuilder* builder)
15201520
g_bufferFactory_p,
15211521
d_allocator_p);
15221522

1523-
eventImplSpRef->configureAsMessageEvent(&d_blobSpPool);
1523+
eventImplSpRef->configureAsMessageEvent(d_blobSpPool_sp.get());
15241524
eventImplSpRef->setMessageCorrelationIdContainer(
15251525
d_corrIdContainer_sp.get());
15261526
}
@@ -1544,7 +1544,7 @@ void MockSession::loadConfirmEventBuilder(ConfirmEventBuilder* builder)
15441544
}
15451545

15461546
new (builderImplRef.d_buffer.buffer())
1547-
bmqp::ConfirmEventBuilder(&d_blobSpPool, d_allocator_p);
1547+
bmqp::ConfirmEventBuilder(d_blobSpPool_sp.get(), d_allocator_p);
15481548

15491549
builderImplRef.d_builder_p = reinterpret_cast<bmqp::ConfirmEventBuilder*>(
15501550
builderImplRef.d_buffer.buffer());

Diff for: src/groups/bmq/bmqa/bmqa_mocksession.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,9 @@ class MockSession : public AbstractSession {
823823
bdlcc::ObjectPoolFunctors::RemoveAll<bdlbb::Blob> >
824824
BlobSpPool;
825825

826+
/// Shared pointer to a pool of shared pointers to Blobs
827+
typedef bsl::shared_ptr<BlobSpPool> BlobSpPoolSp;
828+
826829
/// Aligned buffer holding the two key hash map
827830
typedef bsls::AlignedBuffer<k_MAX_SIZEOF_BMQC_TWOKEYHASHMAP>
828831
TwoKeyHashMapBuffer;
@@ -1035,8 +1038,8 @@ class MockSession : public AbstractSession {
10351038
/// Buffer factory used to build Blobs with `d_blobSpPool`
10361039
bdlbb::PooledBlobBufferFactory d_blobBufferFactory;
10371040

1038-
/// Pool of shared pointers to blobs
1039-
BlobSpPool d_blobSpPool;
1041+
/// Shared pointer to the pool of shared pointers to blobs
1042+
BlobSpPoolSp d_blobSpPool_sp;
10401043

10411044
/// Event handler (set only in asynchronous mode)
10421045
bslma::ManagedPtr<SessionEventHandler> d_eventHandler_mp;

Diff for: src/groups/bmq/bmqimp/bmqimp_application.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ Application::Application(
553553
, d_channelsTip(&d_allocator)
554554
, d_blobBufferFactory(sessionOptions.blobBufferSize(),
555555
d_allocators.get("BlobBufferFactory"))
556-
, d_blobSpPool(
556+
, d_blobSpPool_sp(
557557
bmqp::BlobPoolUtil::createBlobPool(&d_blobBufferFactory,
558558
d_allocators.get("BlobSpPool")))
559559
, d_scheduler(bsls::SystemClockType::e_MONOTONIC, &d_allocator)
@@ -584,13 +584,13 @@ Application::Application(
584584
NegotiatedChannelFactoryConfig(&d_statChannelFactory,
585585
negotiationMessage,
586586
sessionOptions.connectTimeout(),
587-
&d_blobSpPool,
587+
d_blobSpPool_sp.get(),
588588
allocator),
589589
allocator)
590590
, d_connectHandle_mp()
591591
, d_brokerSession(&d_scheduler,
592592
&d_blobBufferFactory,
593-
&d_blobSpPool,
593+
d_blobSpPool_sp.get(),
594594
d_sessionOptions,
595595
eventHandlerCB,
596596
bdlf::MemFnUtil::memFn(&Application::stateCb, this),

Diff for: src/groups/bmq/bmqimp/bmqimp_application.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class Application {
8181
public:
8282
// PUBLIC TYPES
8383
typedef bmqp::BlobPoolUtil::BlobSpPool BlobSpPool;
84+
typedef bmqp::BlobPoolUtil::BlobSpPoolSp BlobSpPoolSp;
8485

8586
private:
8687
// PRIVATE TYPES
@@ -118,8 +119,8 @@ class Application {
118119
bdlbb::PooledBlobBufferFactory d_blobBufferFactory;
119120
// Factory for blob buffers
120121

121-
/// Pool of shared pointers to blobs.
122-
BlobSpPool d_blobSpPool;
122+
/// Shared pointer to the pool of shared pointers to blobs.
123+
BlobSpPoolSp d_blobSpPool_sp;
123124

124125
bdlmt::EventScheduler d_scheduler;
125126
// Scheduler
@@ -324,7 +325,7 @@ inline bool Application::isStarted() const
324325

325326
inline Application::BlobSpPool* Application::blobSpPool()
326327
{
327-
return &d_blobSpPool;
328+
return d_blobSpPool_sp.get();
328329
}
329330

330331
} // close package namespace

0 commit comments

Comments
 (0)