You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by ch...@apache.org on 2023/03/21 07:48:22 UTC
[bookkeeper] branch master updated: Add V2 protocol support for BenchReadThroughputLatency (#3878)
This is an automated email from the ASF dual-hosted git repository.
chenhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git
The following commit(s) were added to refs/heads/master by this push:
new 9fe07bb1fd Add V2 protocol support for BenchReadThroughputLatency (#3878)
9fe07bb1fd is described below
commit 9fe07bb1fdba0b9a8f26b79e547e23c99d4b7be7
Author: Hang Chen <ch...@apache.org>
AuthorDate: Tue Mar 21 15:48:15 2023 +0800
Add V2 protocol support for BenchReadThroughputLatency (#3878)
### Motivation
The `BenchReadThroughputLatency` only supports the V3 protocol to read ledgers from the bookie server. Add the V2 protocol support.
### Changes
Add V2 protocol support for BenchReadThroughputLatency
---
.../org/apache/bookkeeper/benchmark/BenchReadThroughputLatency.java | 5 +++++
.../java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchReadThroughputLatency.java b/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchReadThroughputLatency.java
index 15a7db250b..f3247ab621 100644
--- a/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchReadThroughputLatency.java
+++ b/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchReadThroughputLatency.java
@@ -157,6 +157,7 @@ public class BenchReadThroughputLatency {
options.addOption("password", true, "Password used to access ledgers (default 'benchPasswd')");
options.addOption("zookeeper", true, "Zookeeper ensemble, default \"localhost:2181\"");
options.addOption("sockettimeout", true, "Socket timeout for bookkeeper client. In seconds. Default 5");
+ options.addOption("useV2", false, "Whether use V2 protocol to read ledgers from the bookie server.");
options.addOption("help", false, "This message");
CommandLineParser parser = new PosixParser();
@@ -194,6 +195,10 @@ public class BenchReadThroughputLatency {
final ClientConfiguration conf = new ClientConfiguration();
conf.setReadTimeout(sockTimeout).setZkServers(servers);
+ if (cmd.hasOption("useV2")) {
+ conf.setUseV2WireProtocol(true);
+ }
+
try (ZooKeeperClient zk = ZooKeeperClient.newBuilder()
.connectString(servers)
.sessionTimeoutMs(3000)
diff --git a/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java b/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java
index ca2afd11c2..3c4294e721 100644
--- a/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java
+++ b/bookkeeper-benchmark/src/main/java/org/apache/bookkeeper/benchmark/BenchThroughputLatency.java
@@ -259,7 +259,7 @@ public class BenchThroughputLatency implements AddCallback, Runnable {
options.addOption("skipwarmup", false, "Skip warm up, default false");
options.addOption("sendlimit", true, "Max number of entries to send. Default 20000000");
options.addOption("latencyFile", true, "File to dump latencies. Default is latencyDump.dat");
- options.addOption("useV2", false, "Whether use V2 protocol to send requests to the bookie server");
+ options.addOption("useV2", false, "Whether use V2 protocol to send requests to the bookie server.");
options.addOption("warmupMessages", true, "Number of messages to warm up. Default 10000");
options.addOption("help", false, "This message");