You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by "slbotbm (via GitHub)" <gi...@apache.org> on 2026/04/23 18:10:20 UTC
[PR] feat(java-bench): Implement CLI and resource provisioner for pinned producer [iggy]
slbotbm opened a new pull request, #3159:
URL: https://github.com/apache/iggy/pull/3159
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #
## Rationale
<!--
Why is this change needed? If the issue explains it well, a one-liner is fine.
-->
This PR introduces the CLI for Pinned Producer benchmark, and the ResourceProvisioner class to create stream/topics on the server.
## What changed?
## Local Execution
- Passed / not passed
- Pre-commit hooks ran / not ran
<!--
You must run your code locally before submitting.
"Relying on CI" is not acceptable - PRs from authors who haven't run the code will be closed.
Did you have `prek` installed? It runs automatically on commit and covers all project languages. See [CONTRIBUTING.md](https://github.com/apache/iggy/blob/master/CONTRIBUTING.md).
-->
## AI Usage
If AI tools were used, please answer:
1. Which tools? codex
2. Scope of usage? code generation
3. How did you verify the generated code works correctly? Ran it, read through and understood it myself.
4. Can you explain every line of the code if asked? yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "mmodzelewski (via GitHub)" <gi...@apache.org>.
mmodzelewski merged PR #3159:
URL: https://github.com/apache/iggy/pull/3159
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "mmodzelewski (via GitHub)" <gi...@apache.org>.
mmodzelewski commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3147255197
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
+
+ @Option(
+ names = {"--messages-per-batch", "-P"},
+ defaultValue = "1000",
+ description = "Messages per batch.")
+ private int messagesPerBatch = 1000;
+
+ @Option(
+ names = {"--message-batches", "-b"},
+ defaultValue = "1000",
+ description = "Number of message batches.")
+ private int messageBatches = 1000;
+
+ @Option(
+ names = {"--total-data", "-T"},
+ defaultValue = "0",
+ description = "Total data volume in bytes.")
+ private long totalData;
+
+ @Option(
+ names = {"--rate-limit", "-r"},
+ defaultValue = "0",
+ description = "(NOT USED CURRENTLY) Optional total rate limit in bytes per second.")
+ private long rateLimit;
Review Comment:
Agreed. Let's keep them consistent, ideally we should be able to copy/paste the args between rust/java/any other benchmark runner that we'll create.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #3159:
URL: https://github.com/apache/iggy/pull/3159#issuecomment-4306776460
## [Codecov](https://app.codecov.io/gh/apache/iggy/pull/3159?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `0%` with `92 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 72.66%. Comparing base ([`af92730`](https://app.codecov.io/gh/apache/iggy/commit/af9273081b6f0771a48e4b58ec08f1d513bb271c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5c4422e`](https://app.codecov.io/gh/apache/iggy/commit/5c4422ef667ff9bafb7b455eb5ba7a111952c459?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 34 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/3159?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...ache/iggy/bench/provision/ResourceProvisioner.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fprovision%2FResourceProvisioner.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL3Byb3Zpc2lvbi9SZXNvdXJjZVByb3Zpc2lvbmVyLmphdmE=) | 0.00% | [38 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...rg/apache/iggy/bench/models/cli/GlobalCliArgs.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fmodels%2Fcli%2FGlobalCliArgs.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL21vZGVscy9jbGkvR2xvYmFsQ2xpQXJncy5qYXZh) | 0.00% | [24 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...e/iggy/bench/models/cli/PinnedProducerCliArgs.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fmodels%2Fcli%2FPinnedProducerCliArgs.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL21vZGVscy9jbGkvUGlubmVkUHJvZHVjZXJDbGlBcmdzLmphdmE=) | 0.00% | [12 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...ggy/bench/benchmarks/tcp/async/PinnedProducer.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fbenchmarks%2Ftcp%2Fasync%2FPinnedProducer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL2JlbmNobWFya3MvdGNwL2FzeW5jL1Bpbm5lZFByb2R1Y2VyLmphdmE=) | 0.00% | [10 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...src/main/java/org/apache/iggy/bench/IggyBench.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2FIggyBench.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL0lnZ3lCZW5jaC5qYXZh) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...pache/iggy/bench/exception/BenchmarkException.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fexception%2FBenchmarkException.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL2V4Y2VwdGlvbi9CZW5jaG1hcmtFeGNlcHRpb24uamF2YQ==) | 0.00% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
:x: Your patch check has failed because the patch coverage (0.00%) is below the target coverage (50.00%). You can increase the patch coverage or adjust the [target](https://docs.codecov.com/docs/commit-status#target) coverage.
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #3159 +/- ##
============================================
- Coverage 72.73% 72.66% -0.07%
Complexity 943 943
============================================
Files 1117 1123 +6
Lines 96342 96434 +92
Branches 73541 73561 +20
============================================
Hits 70070 70070
- Misses 23722 23814 +92
Partials 2550 2550
```
| [Components](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [Rust Core](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.49% <ø> (ø)` | |
| [Java SDK](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.93% <0.00%> (-1.37%)` | :arrow_down: |
| [C# SDK](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.42% <ø> (ø)` | |
| [Python SDK](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.43% <ø> (ø)` | |
| [Node SDK](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.31% <ø> (ø)` | |
| [Go SDK](https://app.codecov.io/gh/apache/iggy/pull/3159/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.97% <ø> (ø)` | |
| [Files with missing lines](https://app.codecov.io/gh/apache/iggy/pull/3159?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...src/main/java/org/apache/iggy/bench/IggyBench.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2FIggyBench.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL0lnZ3lCZW5jaC5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...pache/iggy/bench/exception/BenchmarkException.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fexception%2FBenchmarkException.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL2V4Y2VwdGlvbi9CZW5jaG1hcmtFeGNlcHRpb24uamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...ggy/bench/benchmarks/tcp/async/PinnedProducer.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fbenchmarks%2Ftcp%2Fasync%2FPinnedProducer.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL2JlbmNobWFya3MvdGNwL2FzeW5jL1Bpbm5lZFByb2R1Y2VyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...e/iggy/bench/models/cli/PinnedProducerCliArgs.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fmodels%2Fcli%2FPinnedProducerCliArgs.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL21vZGVscy9jbGkvUGlubmVkUHJvZHVjZXJDbGlBcmdzLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...rg/apache/iggy/bench/models/cli/GlobalCliArgs.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fmodels%2Fcli%2FGlobalCliArgs.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL21vZGVscy9jbGkvR2xvYmFsQ2xpQXJncy5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...ache/iggy/bench/provision/ResourceProvisioner.java](https://app.codecov.io/gh/apache/iggy/pull/3159?src=pr&el=tree&filepath=foreign%2Fjava%2Fbench%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Figgy%2Fbench%2Fprovision%2FResourceProvisioner.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-Zm9yZWlnbi9qYXZhL2JlbmNoL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9pZ2d5L2JlbmNoL3Byb3Zpc2lvbi9SZXNvdXJjZVByb3Zpc2lvbmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "atharvalade (via GitHub)" <gi...@apache.org>.
atharvalade commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3155929195
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/PinnedProducerCommand.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import org.apache.iggy.bench.benchmarks.tcp.async.TcpAsyncPinnedProducer;
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.ParentCommand;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "pinned-producer",
+ aliases = {"pp"},
+ mixinStandardHelpOptions = true,
+ description = "Pinned producer benchmark.")
+public final class PinnedProducerCommand implements Callable<Integer> {
+
+ private static final Logger log = LoggerFactory.getLogger(PinnedProducerCommand.class);
+ private static final long DEFAULT_MAX_TOPIC_SIZE = 0L;
+ private static final long DEFAULT_MESSAGE_EXPIRY = 0L;
+
+ @ParentCommand
+ private IggyBenchCommand rootCommand;
+
+ @Spec
+ private CommandSpec spec;
+
+ @Option(
+ names = {"--streams", "-s"},
+ description = "Number of streams. Defaults to the number of producers.")
+ private Integer streams;
+
+ @Option(
+ names = {"--producers", "-p"},
+ defaultValue = "8",
+ description = "Number of producers.")
+ private int producers = 8;
+
+ @Option(
+ names = {"--max-topic-size", "-T"},
+ defaultValue = "0",
+ description = "Max topic size in bytes. Use 0 for the server default.")
+ private long maxTopicSize = DEFAULT_MAX_TOPIC_SIZE;
+
+ @Option(
+ names = {"--message-expiry", "-e"},
+ defaultValue = "0",
+ description = "Topic message expiry in microseconds. Use 0 to never expire.")
+ private long messageExpiry = DEFAULT_MESSAGE_EXPIRY;
+
+ @Override
+ public Integer call() {
+ try {
+ var messageBatches = rootCommand.totalData() > 0 ? 0 : rootCommand.messageBatches();
+ var globalCliArgs = new GlobalCliArgs(
+ rootCommand.messageSize(),
+ rootCommand.messagesPerBatch(),
+ messageBatches,
+ rootCommand.totalData(),
+ rootCommand.rateLimit(),
+ rootCommand.warmupTimeMs(),
+ rootCommand.samplingTimeMs(),
+ rootCommand.movingAverageWindow(),
+ rootCommand.username(),
+ rootCommand.password(),
+ rootCommand.reuseStreams());
+
+ var pinnedProducerCliArgs = new PinnedProducerCliArgs(
+ streams != null ? streams : producers, producers, maxTopicSize, messageExpiry);
+
+ globalCliArgs.validate();
+ pinnedProducerCliArgs.validate();
+
+ log.info("Starting the Pinned Producer benchmark...");
+ var benchmark = new TcpAsyncPinnedProducer(globalCliArgs, pinnedProducerCliArgs);
+ benchmark.provisionResources();
+ benchmark.run();
+
+ return ExitCode.OK;
+ } catch (RuntimeException exception) {
+ var message = exception.getMessage() != null ? exception.getMessage() : exception.toString();
+ spec.commandLine().getErr().println(message);
+ return ExitCode.SOFTWARE;
Review Comment:
The catch block only prints `getMessage()` from the wrapper `BenchmarkException`, so the actual root cause (connection refused, auth failure, etc.) is completely lost. I think walking the cause chain or at least appending `exception.getCause().getMessage()` would save a lot of debugging headaches here.
Thoughts? @mmodzelewski @spetz
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3156001146
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/PinnedProducerCommand.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import org.apache.iggy.bench.benchmarks.tcp.async.TcpAsyncPinnedProducer;
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.ParentCommand;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "pinned-producer",
+ aliases = {"pp"},
+ mixinStandardHelpOptions = true,
+ description = "Pinned producer benchmark.")
+public final class PinnedProducerCommand implements Callable<Integer> {
+
+ private static final Logger log = LoggerFactory.getLogger(PinnedProducerCommand.class);
+ private static final long DEFAULT_MAX_TOPIC_SIZE = 0L;
+ private static final long DEFAULT_MESSAGE_EXPIRY = 0L;
+
+ @ParentCommand
+ private IggyBenchCommand rootCommand;
+
+ @Spec
+ private CommandSpec spec;
+
+ @Option(
+ names = {"--streams", "-s"},
+ description = "Number of streams. Defaults to the number of producers.")
+ private Integer streams;
+
+ @Option(
+ names = {"--producers", "-p"},
+ defaultValue = "8",
+ description = "Number of producers.")
+ private int producers = 8;
+
+ @Option(
+ names = {"--max-topic-size", "-T"},
+ defaultValue = "0",
+ description = "Max topic size in bytes. Use 0 for the server default.")
+ private long maxTopicSize = DEFAULT_MAX_TOPIC_SIZE;
+
+ @Option(
+ names = {"--message-expiry", "-e"},
+ defaultValue = "0",
+ description = "Topic message expiry in microseconds. Use 0 to never expire.")
+ private long messageExpiry = DEFAULT_MESSAGE_EXPIRY;
+
+ @Override
+ public Integer call() {
+ try {
+ var messageBatches = rootCommand.totalData() > 0 ? 0 : rootCommand.messageBatches();
+ var globalCliArgs = new GlobalCliArgs(
+ rootCommand.messageSize(),
+ rootCommand.messagesPerBatch(),
+ messageBatches,
+ rootCommand.totalData(),
+ rootCommand.rateLimit(),
+ rootCommand.warmupTimeMs(),
+ rootCommand.samplingTimeMs(),
+ rootCommand.movingAverageWindow(),
+ rootCommand.username(),
+ rootCommand.password(),
+ rootCommand.reuseStreams());
+
+ var pinnedProducerCliArgs = new PinnedProducerCliArgs(
+ streams != null ? streams : producers, producers, maxTopicSize, messageExpiry);
+
+ globalCliArgs.validate();
+ pinnedProducerCliArgs.validate();
+
+ log.info("Starting the Pinned Producer benchmark...");
+ var benchmark = new TcpAsyncPinnedProducer(globalCliArgs, pinnedProducerCliArgs);
+ benchmark.provisionResources();
+ benchmark.run();
+
+ return ExitCode.OK;
+ } catch (RuntimeException exception) {
+ var message = exception.getMessage() != null ? exception.getMessage() : exception.toString();
+ spec.commandLine().getErr().println(message);
+ return ExitCode.SOFTWARE;
Review Comment:
IMHO not really that important for benchmark. its not prod code. worth fixing in follow ups.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "atharvalade (via GitHub)" <gi...@apache.org>.
atharvalade commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3139433830
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
+
+ @Option(
+ names = {"--messages-per-batch", "-P"},
+ defaultValue = "1000",
+ description = "Messages per batch.")
+ private int messagesPerBatch = 1000;
+
+ @Option(
+ names = {"--message-batches", "-b"},
+ defaultValue = "1000",
+ description = "Number of message batches.")
+ private int messageBatches = 1000;
+
+ @Option(
+ names = {"--total-data", "-T"},
+ defaultValue = "0",
+ description = "Total data volume in bytes.")
+ private long totalData;
Review Comment:
Parent command defines `-p` for `--password` (`IggyBenchCommand` L92). Subcommand defines `-p `for `--producers` (PinnedProducerCommand L59). In picocli, subcommand scope shadows parent scope. If a user writes `iggy-bench pp` `-p` `secretpass` intending to set password, picocli will attempt to parse "secretpass" as an integer for `--producers` and throw a confusing type-conversion error. The user would need to know to write `iggy-bench -p secretpass pp` instead.
and also the same for `IggyBenchCommand.java` L92
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
+
+ @Option(
+ names = {"--messages-per-batch", "-P"},
+ defaultValue = "1000",
+ description = "Messages per batch.")
+ private int messagesPerBatch = 1000;
+
+ @Option(
+ names = {"--message-batches", "-b"},
+ defaultValue = "1000",
+ description = "Number of message batches.")
+ private int messageBatches = 1000;
+
+ @Option(
+ names = {"--total-data", "-T"},
+ defaultValue = "0",
+ description = "Total data volume in bytes.")
+ private long totalData;
+
+ @Option(
+ names = {"--rate-limit", "-r"},
+ defaultValue = "0",
+ description = "(NOT USED CURRENTLY) Optional total rate limit in bytes per second.")
+ private long rateLimit;
Review Comment:
Both the parent `(--total-data)` and this subcommand `(--max-topic-size)` bind `-T`. Since both are long, iggy-bench pp `-T` 5000 quietly sets topic size instead of total data with zero indication anything went wrong. I think it would be better to pick a different short flag for one of them.
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/provision/ResourceProvisioner.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.provision;
+
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.apache.iggy.bench.models.provision.ProvisionedResources;
+import org.apache.iggy.client.blocking.tcp.IggyTcpClient;
+import org.apache.iggy.identifier.StreamId;
+import org.apache.iggy.topic.CompressionAlgorithm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+public final class ResourceProvisioner {
+
+ private static final Logger log = LoggerFactory.getLogger(ResourceProvisioner.class);
+
+ public ProvisionedResources provisionResources(
+ GlobalCliArgs globalCliArgs, PinnedProducerCliArgs pinnedProducerCliArgs) {
+ var streamNames = new ArrayList<String>();
+ var topicNames = List.of("topic-1");
+
+ var client = IggyTcpClient.builder()
+ .credentials(globalCliArgs.username(), globalCliArgs.password())
+ .buildAndLogin();
+
+ var existingStreamNames = client.streams().getStreams().stream()
+ .map(stream -> stream.name())
+ .toList();
+
+ for (var i = 1; i <= pinnedProducerCliArgs.producers(); i++) {
+ var streamName = "bench-stream-" + i;
+ streamNames.add(streamName);
+
+ if (existingStreamNames.contains(streamName) && !globalCliArgs.reuseStreams()) {
+ log.info("Deleting pre-existing stream '{}'", streamName);
+ client.streams().deleteStream(StreamId.of(streamName));
+ }
+
+ if (existingStreamNames.contains(streamName) && globalCliArgs.reuseStreams()) {
+ log.info("Appending to existing stream '{}'", streamName);
+ } else {
+ log.info("Creating the test stream '{}'", streamName);
+
+ client.streams().createStream(streamName);
+
+ var maxTopicSize = pinnedProducerCliArgs.maxTopicSize() == 0L
+ ? "server default"
+ : Long.toString(pinnedProducerCliArgs.maxTopicSize());
+ var messageExpiry = pinnedProducerCliArgs.messageExpiry() == 0L
+ ? "never"
+ : Long.toString(pinnedProducerCliArgs.messageExpiry());
+
+ log.info(
+ "Creating the test topic '{}' for stream '{}' with max topic size: {}, message expiry: {}",
+ topicNames.get(0),
+ streamName,
+ maxTopicSize,
+ messageExpiry);
+
+ client.topics()
+ .createTopic(
+ StreamId.of(streamName),
+ 1L,
+ CompressionAlgorithm.None,
+ BigInteger.valueOf(pinnedProducerCliArgs.messageExpiry()),
+ BigInteger.valueOf(pinnedProducerCliArgs.maxTopicSize()),
+ Optional.empty(),
+ topicNames.get(0));
+ }
+ }
+
+ client.close();
Review Comment:
`IggyTcpClient` implements `Closeable`. The client is created at L45 but `client.close()` only runs at L95 on the happy path. If any operation between L49-93 throws (e.g., server rejects `createStream`, network error), the TCP connection and its underlying NIO/connection-pool resources leak. For a benchmark tool that may be run repeatedly, this compounds.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on PR #3159:
URL: https://github.com/apache/iggy/pull/3159#issuecomment-4328575777
The latest commits enforce the mutual exclusitivity of --message-batches and --total-data through picocli. This was previously done using hand-rolled code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3140729118
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
+
+ @Option(
+ names = {"--messages-per-batch", "-P"},
+ defaultValue = "1000",
+ description = "Messages per batch.")
+ private int messagesPerBatch = 1000;
+
+ @Option(
+ names = {"--message-batches", "-b"},
+ defaultValue = "1000",
+ description = "Number of message batches.")
+ private int messageBatches = 1000;
+
+ @Option(
+ names = {"--total-data", "-T"},
+ defaultValue = "0",
+ description = "Total data volume in bytes.")
+ private long totalData;
+
+ @Option(
+ names = {"--rate-limit", "-r"},
+ defaultValue = "0",
+ description = "(NOT USED CURRENTLY) Optional total rate limit in bytes per second.")
+ private long rateLimit;
Review Comment:
hmm, I've basically replicated the `rust-bench` args in java. If the option needs to be changed, it would be better to change it in the rust bench as well.
What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "mmodzelewski (via GitHub)" <gi...@apache.org>.
mmodzelewski commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3149341833
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/provision/ResourceProvisioner.java:
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.provision;
+
+import org.apache.iggy.bench.exception.BenchmarkException;
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.apache.iggy.bench.models.provision.ProvisionedResources;
+import org.apache.iggy.client.blocking.tcp.IggyTcpClient;
+import org.apache.iggy.identifier.StreamId;
+import org.apache.iggy.topic.CompressionAlgorithm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+public final class ResourceProvisioner {
+
+ private static final Logger log = LoggerFactory.getLogger(ResourceProvisioner.class);
+
+ public ProvisionedResources provisionResources(
+ GlobalCliArgs globalCliArgs, PinnedProducerCliArgs pinnedProducerCliArgs) {
+ var streamNames = new ArrayList<String>();
+ var topicNames = List.of("topic-1");
+
+ try {
+ try (var client = IggyTcpClient.builder()
Review Comment:
both `try` blocks cover the same scope, so we can merge them into one
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.ArgGroup;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
Review Comment:
Some options are initialized, some are not. Let's keep it consistent. I'd drop the values, as we already have `defaultValue` in the annotation - I suppose it will initialize the variable, right?
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/IggyBench.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench;
+
+import org.apache.iggy.bench.cli.IggyBenchCommand;
+import picocli.CommandLine;
+
+public final class IggyBench {
+
+ private IggyBench() {}
+
+ public static void main(String[] args) {
+ var exitCode = new CommandLine(new IggyBenchCommand()).execute(args);
+ if (exitCode != 0) {
+ System.exit(exitCode);
Review Comment:
I think we can run System.exit for all the codes, no need to exclude `0`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "hubcio (via GitHub)" <gi...@apache.org>.
hubcio commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3156001146
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/PinnedProducerCommand.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import org.apache.iggy.bench.benchmarks.tcp.async.TcpAsyncPinnedProducer;
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.ParentCommand;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "pinned-producer",
+ aliases = {"pp"},
+ mixinStandardHelpOptions = true,
+ description = "Pinned producer benchmark.")
+public final class PinnedProducerCommand implements Callable<Integer> {
+
+ private static final Logger log = LoggerFactory.getLogger(PinnedProducerCommand.class);
+ private static final long DEFAULT_MAX_TOPIC_SIZE = 0L;
+ private static final long DEFAULT_MESSAGE_EXPIRY = 0L;
+
+ @ParentCommand
+ private IggyBenchCommand rootCommand;
+
+ @Spec
+ private CommandSpec spec;
+
+ @Option(
+ names = {"--streams", "-s"},
+ description = "Number of streams. Defaults to the number of producers.")
+ private Integer streams;
+
+ @Option(
+ names = {"--producers", "-p"},
+ defaultValue = "8",
+ description = "Number of producers.")
+ private int producers = 8;
+
+ @Option(
+ names = {"--max-topic-size", "-T"},
+ defaultValue = "0",
+ description = "Max topic size in bytes. Use 0 for the server default.")
+ private long maxTopicSize = DEFAULT_MAX_TOPIC_SIZE;
+
+ @Option(
+ names = {"--message-expiry", "-e"},
+ defaultValue = "0",
+ description = "Topic message expiry in microseconds. Use 0 to never expire.")
+ private long messageExpiry = DEFAULT_MESSAGE_EXPIRY;
+
+ @Override
+ public Integer call() {
+ try {
+ var messageBatches = rootCommand.totalData() > 0 ? 0 : rootCommand.messageBatches();
+ var globalCliArgs = new GlobalCliArgs(
+ rootCommand.messageSize(),
+ rootCommand.messagesPerBatch(),
+ messageBatches,
+ rootCommand.totalData(),
+ rootCommand.rateLimit(),
+ rootCommand.warmupTimeMs(),
+ rootCommand.samplingTimeMs(),
+ rootCommand.movingAverageWindow(),
+ rootCommand.username(),
+ rootCommand.password(),
+ rootCommand.reuseStreams());
+
+ var pinnedProducerCliArgs = new PinnedProducerCliArgs(
+ streams != null ? streams : producers, producers, maxTopicSize, messageExpiry);
+
+ globalCliArgs.validate();
+ pinnedProducerCliArgs.validate();
+
+ log.info("Starting the Pinned Producer benchmark...");
+ var benchmark = new TcpAsyncPinnedProducer(globalCliArgs, pinnedProducerCliArgs);
+ benchmark.provisionResources();
+ benchmark.run();
+
+ return ExitCode.OK;
+ } catch (RuntimeException exception) {
+ var message = exception.getMessage() != null ? exception.getMessage() : exception.toString();
+ spec.commandLine().getErr().println(message);
+ return ExitCode.SOFTWARE;
Review Comment:
not really that important for benchmark. its not prod code. worth fixing in follow ups.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3140701580
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,152 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
+
+ @Option(
+ names = {"--messages-per-batch", "-P"},
+ defaultValue = "1000",
+ description = "Messages per batch.")
+ private int messagesPerBatch = 1000;
+
+ @Option(
+ names = {"--message-batches", "-b"},
+ defaultValue = "1000",
+ description = "Number of message batches.")
+ private int messageBatches = 1000;
+
+ @Option(
+ names = {"--total-data", "-T"},
+ defaultValue = "0",
+ description = "Total data volume in bytes.")
+ private long totalData;
Review Comment:
> Parent command defines -p for --password (IggyBenchCommand L92). Subcommand defines -p for --producers (PinnedProducerCommand L59). In picocli, subcommand scope shadows parent scope. If a user writes iggy-bench pp -p secretpass intending to set password, picocli will attempt to parse "secretpass" as an integer for --producers and throw a confusing type-conversion error. The user would need to know to write iggy-bench -p secretpass pp instead.
This is the intended behaviour. The rust `iggy-bench` also behaves this way.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3150078462
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/provision/ResourceProvisioner.java:
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.provision;
+
+import org.apache.iggy.bench.exception.BenchmarkException;
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.apache.iggy.bench.models.provision.ProvisionedResources;
+import org.apache.iggy.client.blocking.tcp.IggyTcpClient;
+import org.apache.iggy.identifier.StreamId;
+import org.apache.iggy.topic.CompressionAlgorithm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+public final class ResourceProvisioner {
+
+ private static final Logger log = LoggerFactory.getLogger(ResourceProvisioner.class);
+
+ public ProvisionedResources provisionResources(
+ GlobalCliArgs globalCliArgs, PinnedProducerCliArgs pinnedProducerCliArgs) {
+ var streamNames = new ArrayList<String>();
+ var topicNames = List.of("topic-1");
+
+ try {
+ try (var client = IggyTcpClient.builder()
Review Comment:
done
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/IggyBench.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench;
+
+import org.apache.iggy.bench.cli.IggyBenchCommand;
+import picocli.CommandLine;
+
+public final class IggyBench {
+
+ private IggyBench() {}
+
+ public static void main(String[] args) {
+ var exitCode = new CommandLine(new IggyBenchCommand()).execute(args);
+ if (exitCode != 0) {
+ System.exit(exitCode);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3150082476
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/IggyBenchCommand.java:
##########
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import picocli.CommandLine.ArgGroup;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "iggy-bench",
+ mixinStandardHelpOptions = true,
+ subcommands = {PinnedProducerCommand.class},
+ description = "Benchmark CLI for the Apache Iggy Java SDK.")
+public final class IggyBenchCommand implements Callable<Integer> {
+ @Option(
+ names = {"--message-size", "-m"},
+ defaultValue = "1000",
+ description = "Message size in bytes.")
+ private int messageSize = 1000;
Review Comment:
yeah it initializes the variable with the default value as long as we use picocli. Applied the change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "mmodzelewski (via GitHub)" <gi...@apache.org>.
mmodzelewski commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3156072807
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/cli/PinnedProducerCommand.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.cli;
+
+import org.apache.iggy.bench.benchmarks.tcp.async.TcpAsyncPinnedProducer;
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.ExitCode;
+import picocli.CommandLine.Model.CommandSpec;
+import picocli.CommandLine.Option;
+import picocli.CommandLine.ParentCommand;
+import picocli.CommandLine.Spec;
+
+import java.util.concurrent.Callable;
+
+@Command(
+ name = "pinned-producer",
+ aliases = {"pp"},
+ mixinStandardHelpOptions = true,
+ description = "Pinned producer benchmark.")
+public final class PinnedProducerCommand implements Callable<Integer> {
+
+ private static final Logger log = LoggerFactory.getLogger(PinnedProducerCommand.class);
+ private static final long DEFAULT_MAX_TOPIC_SIZE = 0L;
+ private static final long DEFAULT_MESSAGE_EXPIRY = 0L;
+
+ @ParentCommand
+ private IggyBenchCommand rootCommand;
+
+ @Spec
+ private CommandSpec spec;
+
+ @Option(
+ names = {"--streams", "-s"},
+ description = "Number of streams. Defaults to the number of producers.")
+ private Integer streams;
+
+ @Option(
+ names = {"--producers", "-p"},
+ defaultValue = "8",
+ description = "Number of producers.")
+ private int producers = 8;
+
+ @Option(
+ names = {"--max-topic-size", "-T"},
+ defaultValue = "0",
+ description = "Max topic size in bytes. Use 0 for the server default.")
+ private long maxTopicSize = DEFAULT_MAX_TOPIC_SIZE;
+
+ @Option(
+ names = {"--message-expiry", "-e"},
+ defaultValue = "0",
+ description = "Topic message expiry in microseconds. Use 0 to never expire.")
+ private long messageExpiry = DEFAULT_MESSAGE_EXPIRY;
+
+ @Override
+ public Integer call() {
+ try {
+ var messageBatches = rootCommand.totalData() > 0 ? 0 : rootCommand.messageBatches();
+ var globalCliArgs = new GlobalCliArgs(
+ rootCommand.messageSize(),
+ rootCommand.messagesPerBatch(),
+ messageBatches,
+ rootCommand.totalData(),
+ rootCommand.rateLimit(),
+ rootCommand.warmupTimeMs(),
+ rootCommand.samplingTimeMs(),
+ rootCommand.movingAverageWindow(),
+ rootCommand.username(),
+ rootCommand.password(),
+ rootCommand.reuseStreams());
+
+ var pinnedProducerCliArgs = new PinnedProducerCliArgs(
+ streams != null ? streams : producers, producers, maxTopicSize, messageExpiry);
+
+ globalCliArgs.validate();
+ pinnedProducerCliArgs.validate();
+
+ log.info("Starting the Pinned Producer benchmark...");
+ var benchmark = new TcpAsyncPinnedProducer(globalCliArgs, pinnedProducerCliArgs);
+ benchmark.provisionResources();
+ benchmark.run();
+
+ return ExitCode.OK;
+ } catch (RuntimeException exception) {
+ var message = exception.getMessage() != null ? exception.getMessage() : exception.toString();
+ spec.commandLine().getErr().println(message);
+ return ExitCode.SOFTWARE;
Review Comment:
we can also consider having different verbosity options, like many tools have, but let's take that as an improvement for next commits
cc @slbotbm
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(java): Implement CLI and resource provisioner for pinned producer benchmark [iggy]
Posted by "slbotbm (via GitHub)" <gi...@apache.org>.
slbotbm commented on code in PR #3159:
URL: https://github.com/apache/iggy/pull/3159#discussion_r3140754751
##########
foreign/java/bench/src/main/java/org/apache/iggy/bench/provision/ResourceProvisioner.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, 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.
+ */
+
+package org.apache.iggy.bench.provision;
+
+import org.apache.iggy.bench.models.cli.GlobalCliArgs;
+import org.apache.iggy.bench.models.cli.PinnedProducerCliArgs;
+import org.apache.iggy.bench.models.provision.ProvisionedResources;
+import org.apache.iggy.client.blocking.tcp.IggyTcpClient;
+import org.apache.iggy.identifier.StreamId;
+import org.apache.iggy.topic.CompressionAlgorithm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Optional;
+
+public final class ResourceProvisioner {
+
+ private static final Logger log = LoggerFactory.getLogger(ResourceProvisioner.class);
+
+ public ProvisionedResources provisionResources(
+ GlobalCliArgs globalCliArgs, PinnedProducerCliArgs pinnedProducerCliArgs) {
+ var streamNames = new ArrayList<String>();
+ var topicNames = List.of("topic-1");
+
+ var client = IggyTcpClient.builder()
+ .credentials(globalCliArgs.username(), globalCliArgs.password())
+ .buildAndLogin();
+
+ var existingStreamNames = client.streams().getStreams().stream()
+ .map(stream -> stream.name())
+ .toList();
+
+ for (var i = 1; i <= pinnedProducerCliArgs.producers(); i++) {
+ var streamName = "bench-stream-" + i;
+ streamNames.add(streamName);
+
+ if (existingStreamNames.contains(streamName) && !globalCliArgs.reuseStreams()) {
+ log.info("Deleting pre-existing stream '{}'", streamName);
+ client.streams().deleteStream(StreamId.of(streamName));
+ }
+
+ if (existingStreamNames.contains(streamName) && globalCliArgs.reuseStreams()) {
+ log.info("Appending to existing stream '{}'", streamName);
+ } else {
+ log.info("Creating the test stream '{}'", streamName);
+
+ client.streams().createStream(streamName);
+
+ var maxTopicSize = pinnedProducerCliArgs.maxTopicSize() == 0L
+ ? "server default"
+ : Long.toString(pinnedProducerCliArgs.maxTopicSize());
+ var messageExpiry = pinnedProducerCliArgs.messageExpiry() == 0L
+ ? "never"
+ : Long.toString(pinnedProducerCliArgs.messageExpiry());
+
+ log.info(
+ "Creating the test topic '{}' for stream '{}' with max topic size: {}, message expiry: {}",
+ topicNames.get(0),
+ streamName,
+ maxTopicSize,
+ messageExpiry);
+
+ client.topics()
+ .createTopic(
+ StreamId.of(streamName),
+ 1L,
+ CompressionAlgorithm.None,
+ BigInteger.valueOf(pinnedProducerCliArgs.messageExpiry()),
+ BigInteger.valueOf(pinnedProducerCliArgs.maxTopicSize()),
+ Optional.empty(),
+ topicNames.get(0));
+ }
+ }
+
+ client.close();
Review Comment:
Wrapped the code inside a try-catch block to catch the errors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@iggy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org