Skip to content

Commit

Permalink
Merge branch 'bloomberg:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-e1off authored Jul 30, 2024
2 parents 8142686 + f99b265 commit 2b5eaad
Show file tree
Hide file tree
Showing 21 changed files with 349 additions and 264 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/formatting-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ on:
jobs:
cpp_formatting_check:
name: C++ Formatting Check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: clang-format style check
run: |
git clang-format-14 --diff -q origin/main | tee format_diff.txt
git clang-format-18 --diff -q origin/main | tee format_diff.txt
if [ -s format_diff.txt ]; then exit 1; fi
python_formatting_check:
Expand Down
2 changes: 1 addition & 1 deletion src/applications/bmqtool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ opened regularly (without specifying a mode). To run the `bmqtool`, you invoke
| `open` | `uri=string [async=true] [maxUnconfirmedMessages=N) (maxUnconfirmedByes=M)` | Open a connection with the queue at the given `uri`. |
| `close` | `uri=string [async=true]` | Close connection with the queue at the given `uri`. |
| `post` | `uri=string payload=string [, ...] [async=true]` | Post a message (the `payload`) to the queue at the given `uri`. |
| `batch-post` | `uri=string payload=string [, ...] (msgSize=S) (eventSize=N) (eventsCount=M) (postInterval=P) (postRate=R)` | Post `M` events containing `N` messages containing provided `payload` or auto-generated and containing `S` bytes each to the queue at the given `uri` at a rate of `R/P` (where `P` is expressed in ms). `M=0` means endless posting. |
| `batch-post` | `uri=string payload=string [, ...] (msgSize=S) (eventSize=N) (eventsCount=M) (postInterval=P) (postRate=R) (autoIncremented=F)` | Post `M` events containing `N` messages containing provided `payload` or auto-generated and containing `S` bytes each to the queue at the given `uri` at a rate of `R/P` (where `P` is expressed in ms). `M=0` means endless posting. Each message can have an integer property F which will be auto-incremented (0, 1, 2, ...).|
| `list` | N/A | List the messages that have yet to be ACKed by the tool. |
| `confirm` | `guid=string` | Confirm (ACK) the message matching the given GUID. |
| `help` | N/A | Show the help dialog. |
Expand Down
1 change: 1 addition & 0 deletions src/applications/bmqtool/bmqtoolcmd.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
<element name='eventsCount' type='long' default="0"/>
<element name='postInterval' type='int' default="1000"/>
<element name='postRate' type='int' default="1"/>
<element name='autoIncremented' type='string' default=""/>
</sequence>
</complexType>

Expand Down
6 changes: 4 additions & 2 deletions src/applications/bmqtool/m_bmqtool_interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ void Interactive::printHelp()
"\"type\": \"\"}])"
<< bsl::endl
<< " batch-post uri=\"\" payload=[\"\",\"\"] (msgSize=u) "
"(eventSize=v) (eventsCount=w) (postInterval=x) (postRate=y)"
"(eventSize=v) (eventsCount=w) (postInterval=x) (postRate=y) "
"(autoIncremented=\"field\")"
<< bsl::endl
<< " list (uri=\"\")" << bsl::endl
<< " confirm uri=\"\" guid=\"\" "
Expand Down Expand Up @@ -152,7 +153,7 @@ void Interactive::printHelp()
<< bsl::endl
<< " batch-post uri=\"bmq://bmq.test.persistent.priority/qqq\" "
"payload=[\"sample message\"] eventsCount=300 postInterval=5000 "
"postRate=10"
"postRate=10 autoIncremented=\"x\""
<< bsl::endl
<< " - 'batch-post' command requires 'uri' argument, "
"all the rest are optional"
Expand Down Expand Up @@ -716,6 +717,7 @@ void Interactive::processCommand(const BatchPostCommand& command)
parameters.setEventSize(command.eventSize());
parameters.setPostInterval(command.postInterval());
parameters.setMsgSize(command.msgSize());
parameters.setAutoIncrementedField(command.autoIncremented());

// Lookup the Queue by URI
bmqa::QueueId queueId;
Expand Down
62 changes: 39 additions & 23 deletions src/applications/bmqtool/m_bmqtool_messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// m_bmqtool_messages.cpp *DO NOT EDIT* @generated -*-C++-*-

#include <m_bmqtool_messages.h>
Expand Down Expand Up @@ -58,6 +57,8 @@ const int BatchPostCommand::DEFAULT_INITIALIZER_POST_INTERVAL = 1000;

const int BatchPostCommand::DEFAULT_INITIALIZER_POST_RATE = 1;

const char BatchPostCommand::DEFAULT_INITIALIZER_AUTO_INCREMENTED[] = "";

const bdlat_AttributeInfo BatchPostCommand::ATTRIBUTE_INFO_ARRAY[] = {
{ATTRIBUTE_ID_URI,
"uri",
Expand Down Expand Up @@ -93,14 +94,19 @@ const bdlat_AttributeInfo BatchPostCommand::ATTRIBUTE_INFO_ARRAY[] = {
"postRate",
sizeof("postRate") - 1,
"",
bdlat_FormattingMode::e_DEC}};
bdlat_FormattingMode::e_DEC},
{ATTRIBUTE_ID_AUTO_INCREMENTED,
"autoIncremented",
sizeof("autoIncremented") - 1,
"",
bdlat_FormattingMode::e_TEXT}};

// CLASS METHODS

const bdlat_AttributeInfo*
BatchPostCommand::lookupAttributeInfo(const char* name, int nameLength)
{
for (int i = 0; i < 7; ++i) {
for (int i = 0; i < 8; ++i) {
const bdlat_AttributeInfo& attributeInfo =
BatchPostCommand::ATTRIBUTE_INFO_ARRAY[i];

Expand Down Expand Up @@ -129,6 +135,8 @@ const bdlat_AttributeInfo* BatchPostCommand::lookupAttributeInfo(int id)
return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_POST_INTERVAL];
case ATTRIBUTE_ID_POST_RATE:
return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_POST_RATE];
case ATTRIBUTE_ID_AUTO_INCREMENTED:
return &ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_AUTO_INCREMENTED];
default: return 0;
}
}
Expand All @@ -140,6 +148,7 @@ BatchPostCommand::BatchPostCommand(bslma::Allocator* basicAllocator)
, d_eventsCount(DEFAULT_INITIALIZER_EVENTS_COUNT)
, d_payload(basicAllocator)
, d_uri(basicAllocator)
, d_autoIncremented(DEFAULT_INITIALIZER_AUTO_INCREMENTED, basicAllocator)
, d_msgSize(DEFAULT_INITIALIZER_MSG_SIZE)
, d_postInterval(DEFAULT_INITIALIZER_POST_INTERVAL)
, d_postRate(DEFAULT_INITIALIZER_POST_RATE)
Expand All @@ -152,6 +161,7 @@ BatchPostCommand::BatchPostCommand(const BatchPostCommand& original,
, d_eventsCount(original.d_eventsCount)
, d_payload(original.d_payload, basicAllocator)
, d_uri(original.d_uri, basicAllocator)
, d_autoIncremented(original.d_autoIncremented, basicAllocator)
, d_msgSize(original.d_msgSize)
, d_postInterval(original.d_postInterval)
, d_postRate(original.d_postRate)
Expand All @@ -165,6 +175,7 @@ BatchPostCommand::BatchPostCommand(BatchPostCommand&& original) noexcept
d_eventsCount(bsl::move(original.d_eventsCount)),
d_payload(bsl::move(original.d_payload)),
d_uri(bsl::move(original.d_uri)),
d_autoIncremented(bsl::move(original.d_autoIncremented)),
d_msgSize(bsl::move(original.d_msgSize)),
d_postInterval(bsl::move(original.d_postInterval)),
d_postRate(bsl::move(original.d_postRate))
Expand All @@ -177,6 +188,7 @@ BatchPostCommand::BatchPostCommand(BatchPostCommand&& original,
, d_eventsCount(bsl::move(original.d_eventsCount))
, d_payload(bsl::move(original.d_payload), basicAllocator)
, d_uri(bsl::move(original.d_uri), basicAllocator)
, d_autoIncremented(bsl::move(original.d_autoIncremented), basicAllocator)
, d_msgSize(bsl::move(original.d_msgSize))
, d_postInterval(bsl::move(original.d_postInterval))
, d_postRate(bsl::move(original.d_postRate))
Expand All @@ -193,13 +205,14 @@ BatchPostCommand::~BatchPostCommand()
BatchPostCommand& BatchPostCommand::operator=(const BatchPostCommand& rhs)
{
if (this != &rhs) {
d_uri = rhs.d_uri;
d_payload = rhs.d_payload;
d_msgSize = rhs.d_msgSize;
d_eventSize = rhs.d_eventSize;
d_eventsCount = rhs.d_eventsCount;
d_postInterval = rhs.d_postInterval;
d_postRate = rhs.d_postRate;
d_uri = rhs.d_uri;
d_payload = rhs.d_payload;
d_msgSize = rhs.d_msgSize;
d_eventSize = rhs.d_eventSize;
d_eventsCount = rhs.d_eventsCount;
d_postInterval = rhs.d_postInterval;
d_postRate = rhs.d_postRate;
d_autoIncremented = rhs.d_autoIncremented;
}

return *this;
Expand All @@ -210,13 +223,14 @@ BatchPostCommand& BatchPostCommand::operator=(const BatchPostCommand& rhs)
BatchPostCommand& BatchPostCommand::operator=(BatchPostCommand&& rhs)
{
if (this != &rhs) {
d_uri = bsl::move(rhs.d_uri);
d_payload = bsl::move(rhs.d_payload);
d_msgSize = bsl::move(rhs.d_msgSize);
d_eventSize = bsl::move(rhs.d_eventSize);
d_eventsCount = bsl::move(rhs.d_eventsCount);
d_postInterval = bsl::move(rhs.d_postInterval);
d_postRate = bsl::move(rhs.d_postRate);
d_uri = bsl::move(rhs.d_uri);
d_payload = bsl::move(rhs.d_payload);
d_msgSize = bsl::move(rhs.d_msgSize);
d_eventSize = bsl::move(rhs.d_eventSize);
d_eventsCount = bsl::move(rhs.d_eventsCount);
d_postInterval = bsl::move(rhs.d_postInterval);
d_postRate = bsl::move(rhs.d_postRate);
d_autoIncremented = bsl::move(rhs.d_autoIncremented);
}

return *this;
Expand All @@ -227,11 +241,12 @@ void BatchPostCommand::reset()
{
bdlat_ValueTypeFunctions::reset(&d_uri);
bdlat_ValueTypeFunctions::reset(&d_payload);
d_msgSize = DEFAULT_INITIALIZER_MSG_SIZE;
d_eventSize = DEFAULT_INITIALIZER_EVENT_SIZE;
d_eventsCount = DEFAULT_INITIALIZER_EVENTS_COUNT;
d_postInterval = DEFAULT_INITIALIZER_POST_INTERVAL;
d_postRate = DEFAULT_INITIALIZER_POST_RATE;
d_msgSize = DEFAULT_INITIALIZER_MSG_SIZE;
d_eventSize = DEFAULT_INITIALIZER_EVENT_SIZE;
d_eventsCount = DEFAULT_INITIALIZER_EVENTS_COUNT;
d_postInterval = DEFAULT_INITIALIZER_POST_INTERVAL;
d_postRate = DEFAULT_INITIALIZER_POST_RATE;
d_autoIncremented = DEFAULT_INITIALIZER_AUTO_INCREMENTED;
}

// ACCESSORS
Expand All @@ -249,6 +264,7 @@ bsl::ostream& BatchPostCommand::print(bsl::ostream& stream,
printer.printAttribute("eventsCount", this->eventsCount());
printer.printAttribute("postInterval", this->postInterval());
printer.printAttribute("postRate", this->postRate());
printer.printAttribute("autoIncremented", this->autoIncremented());
printer.end();
return stream;
}
Expand Down Expand Up @@ -6799,6 +6815,6 @@ const char* Command::selectionName() const
} // close package namespace
} // close enterprise namespace

// GENERATED BY BLP_BAS_CODEGEN_2024.05.16
// GENERATED BY BLP_BAS_CODEGEN_2024.07.04.1
// USING bas_codegen.pl -m msg --noAggregateConversion --noExternalization
// --noIdent --package m_bmqtool --msgComponent messages bmqtoolcmd.xsd
Loading

0 comments on commit 2b5eaad

Please sign in to comment.