Skip to content

Commit

Permalink
Merge branch 'bloomberg:main' into appids
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-e1off authored Apr 23, 2024
2 parents f9af96c + 397bdc8 commit 2e4175f
Show file tree
Hide file tree
Showing 63 changed files with 7,375 additions and 7,765 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ jobs:
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/deps/srcs/bde-tools/BdeBuildSystem \
-DCMAKE_INSTALL_LIBDIR=lib64
cmake --build build/blazingmq --parallel 8 --target all all.t
- name: Run C++ Unit Tests
run: |
cd ${{ github.workspace }}/build/blazingmq
ctest -E mwcsys_executil.t --output-on-failure
- name: Clean-up build directories before caching
run: |
find . -name "*.o" -type f -delete
find . -name "*.a" -type f -delete
find . -name "*.t.tsk" -type f -delete
- uses: actions/cache@v4
with:
path: |
Expand Down Expand Up @@ -82,10 +91,6 @@ jobs:
src/python/bin/schemagen
src/python/bin/tweakgen
pytest src/python
- name: Run C++ Unit Tests
run: |
cd ${{ github.workspace }}/build/blazingmq
ctest -E mwcsys_executil.t --output-on-failure
integration_tests_ubuntu:
name: BlazingMQ integration tests
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ if( "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang" )
"-Wno-padded"
"-Wno-global-constructors" # bmqp_protocol mask constants
"-Wno-conversion"
"-Wno-undef" # BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
"-Wno-float-equal" # operator== in generated classes
)

Expand Down
877 changes: 581 additions & 296 deletions Doxyfile

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/build-darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ CMAKE_OPTIONS=(\
-DCMAKE_INSTALL_PREFIX="${DIR_INSTALL}" \
-DCMAKE_MODULE_PATH="${DIR_THIRDPARTY}/bde-tools/cmake;${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem" \
-DCMAKE_PREFIX_PATH="${DIR_INSTALL}" \
-DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/gcc-default.cmake" \
-DCMAKE_TOOLCHAIN_FILE="${DIR_THIRDPARTY}/bde-tools/BdeBuildSystem/toolchains/darwin/clang-default.cmake" \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DFLEX_ROOT="${FLEX_ROOT}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ class CommandProcessor {
// CREATORS

/// Default constructor.
CommandProcessor(){};
CommandProcessor() {}

virtual ~CommandProcessor(){};
virtual ~CommandProcessor() {}

// MANIPULATORS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ static void test1_breathingTest()
fileManager,
bsl::cout,
s_allocator_p);
ASSERT_NE(dynamic_cast<JournalFileProcessor*>(cmdProcessor.get()),
bsl::nullptr_t());
ASSERT(dynamic_cast<JournalFileProcessor*>(cmdProcessor.get()) != 0);
}

// ============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class FileManager {
virtual mqbs::JournalFileIterator* journalFileIterator() = 0;
virtual mqbs::DataFileIterator* dataFileIterator() = 0;

virtual ~FileManager(){};
virtual ~FileManager() {}
};

class FileManagerImpl : public FileManager {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,8 @@ static void test8_searchMessagesByQueueKeyTest()
queueKey2);

// Configure parameters to search messages by queueKey1
Parameters params(s_allocator_p);
bsl::vector<bsl::string> queueKeys(1, queueKey1, s_allocator_p);
params.d_queueKey = bsl::move(queueKeys);
Parameters params(s_allocator_p);
params.d_queueKey.push_back(queueKey1);
// Prepare file manager
bslma::ManagedPtr<FileManager> fileManager(
new (*s_allocator_p) FileManagerMock(journalFile, s_allocator_p),
Expand Down Expand Up @@ -652,9 +651,7 @@ static void test10_searchMessagesByQueueNameAndQueueKeyTest()
Parameters params(s_allocator_p);
params.d_queueName.push_back("queue1");
params.d_queueMap.insert(queueInfo);

bsl::vector<bsl::string> queueKeys(1, queueKey2, s_allocator_p);
params.d_queueKey = bsl::move(queueKeys);
params.d_queueKey.push_back(queueKey2);

// Prepare file manager
bslma::ManagedPtr<FileManager> fileManager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SearchResult {
// CREATORS

/// Destructor
virtual ~SearchResult(){};
virtual ~SearchResult() {}

// MANIPULATORS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ static void test1_breathingTest()
fileManager,
bsl::cout,
s_allocator_p);
ASSERT_NE(dynamic_cast<SearchResult*>(searchResult.get()),
bsl::nullptr_t());
ASSERT(dynamic_cast<SearchResult*>(searchResult.get()) != 0);
}

// ============================================================================
Expand Down
6 changes: 4 additions & 2 deletions src/applications/bmqstoragetool/m_bmqstoragetool_testutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ class FileManagerMock : public FileManager {

mqbs::JournalFileIterator d_journalFileIt;
// Journal file iterator.
mqbs::DataFileIterator d_dataFileIt;
// Data file iterator.

public:
// CREATORS
Expand All @@ -234,7 +236,7 @@ class FileManagerMock : public FileManager {
explicit FileManagerMock(bslma::Allocator* allocator = 0)
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(Return(bsl::nullptr_t()));
.WillRepeatedly(Return(&d_dataFileIt));
}

/// Constructor using the specified `journalFile` and `allocator`.
Expand All @@ -245,7 +247,7 @@ class FileManagerMock : public FileManager {
false)
{
EXPECT_CALL(*this, dataFileIterator())
.WillRepeatedly(Return(bsl::nullptr_t()));
.WillRepeatedly(Return(&d_dataFileIt));
}

// MANIPULATORS
Expand Down
2 changes: 1 addition & 1 deletion src/applications/bmqtool/bmqtoolcmd.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
<element name='latencyReport' type='string' default=""/>
<element name='dumpMsg' type='boolean' default="false"/>
<element name='confirmMsg' type='boolean' default="false"/>
<element name='eventSize' type='int' default="1"/>
<element name='eventSize' type='long' default="1"/>
<element name='msgSize' type='int' default="1024"/>
<element name='postRate' type='int' default="1"/>
<element name='eventsCount' type='string' default="0"/>
Expand Down
23 changes: 15 additions & 8 deletions src/applications/bmqtool/m_bmqtool_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,12 @@ void Application::onMessageEvent(const bmqa::MessageEvent& event)

// Write to log file
d_fileLogger.writeAckMessage(message);

if (d_numExpectedAcks != 0 &&
d_numExpectedAcks == ++d_numAcknowledged) {
BALL_LOG_INFO << "All posted messages have been acknowledged";
d_shutdownSemaphore_p->post();
}
}
else {
// Message is a push message
Expand Down Expand Up @@ -931,7 +937,7 @@ void Application::producerThread()
}

eventBuilder.reset();
for (int msgId = 0; msgId < d_parameters_p->eventSize();
for (bsl::uint64_t msgId = 0; msgId < d_parameters_p->eventSize();
++msgId, ++msgSeqId) {
bmqa::Message& msg = eventBuilder.startMessage();
int length = 0;
Expand Down Expand Up @@ -1046,12 +1052,7 @@ void Application::producerThread()
}
}

// Finished posting messages in auto mode?
// If shutDownGrace is set, signal to the main thread to exit.
if (d_parameters_p->mode() == ParametersMode::e_AUTO &&
d_parameters_p->shutdownGrace() != 0) {
// We do not need to sleep the grace period, since it is done
// by the main thread, in the stop() function.
if (!bmqt::QueueFlagsUtil::isAck(d_parameters_p->queueFlags())) {
d_shutdownSemaphore_p->post();
}
}
Expand Down Expand Up @@ -1131,6 +1132,8 @@ Application::Application(Parameters* parameters,
, d_latencies(allocator)
, d_autoReadInProgress(false)
, d_autoReadActivity(false)
, d_numExpectedAcks(0)
, d_numAcknowledged(0)
{
// NOTHING
}
Expand Down Expand Up @@ -1194,8 +1197,12 @@ int Application::run()
d_shutdownSemaphore_p->post();
}
else {
// Start the thread
if (bmqt::QueueFlagsUtil::isWriter(d_parameters_p->queueFlags())) {
d_numExpectedAcks = d_parameters_p->eventsCount() *
d_parameters_p->eventSize();
d_numAcknowledged = 0;

// Start the thread
rc = bslmt::ThreadUtil::create(
&d_runningThread,
bdlf::MemFnUtil::memFn(&Application::producerThread, this));
Expand Down
13 changes: 13 additions & 0 deletions src/applications/bmqtool/m_bmqtool_application.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@ class Application : public bmqa::SessionEventHandler {
// message was seen during the current
// grace period.

bsl::uint64_t d_numExpectedAcks;
// Auto-produce mode only. The total number of messages
// the tool will send. After posting is finished
// the tool will be waiting for this number of ACK
// messages, after which the shutdown semaphore will
// be posted.

bsl::uint64_t d_numAcknowledged;
// Auto-produce mode only. The number of acknowledged
// messages. When the value of this field becomes equal
// to d_numExpectedAcks, the shutdown semaphore will be
// posted.

// PRIVATE MANIPULATORS
// (virtual: bmqa::SessionEventHandler)

Expand Down
Loading

0 comments on commit 2e4175f

Please sign in to comment.