From 6099e88f7ab03e86306536d1f4bead11edcc0631 Mon Sep 17 00:00:00 2001 From: jai1 Date: Sun, 16 Apr 2017 17:50:59 -0700 Subject: [PATCH] Removed ability to disable connection pool (#337) --- .../com/yahoo/pulsar/client/api/ClientConfiguration.java | 5 +++-- .../com/yahoo/pulsar/testclient/PerformanceConsumer.java | 2 +- .../com/yahoo/pulsar/testclient/PerformanceProducer.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pulsar-client/src/main/java/com/yahoo/pulsar/client/api/ClientConfiguration.java b/pulsar-client/src/main/java/com/yahoo/pulsar/client/api/ClientConfiguration.java index 8b8ca088d5b..e908cbe570b 100644 --- a/pulsar-client/src/main/java/com/yahoo/pulsar/client/api/ClientConfiguration.java +++ b/pulsar-client/src/main/java/com/yahoo/pulsar/client/api/ClientConfiguration.java @@ -211,12 +211,13 @@ public class ClientConfiguration implements Serializable { * By default, the connection pool will use a single connection for all the producers and consumers. Increasing this * parameter may improve throughput when using many producers over a high latency connection. *

- * Setting connections per broker to 0 will disable the connection pooling. * * @param connectionsPerBroker - * max number of connections + * max number of connections per broker (needs to be greater than 0) */ public void setConnectionsPerBroker(int connectionsPerBroker) { + checkArgument(connectionsPerBroker > 0, + "Connections per broker need to be greater than 0"); this.connectionsPerBroker = connectionsPerBroker; } diff --git a/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceConsumer.java b/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceConsumer.java index e412996e7f6..63d00138977 100644 --- a/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceConsumer.java +++ b/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceConsumer.java @@ -84,7 +84,7 @@ public class PerformanceConsumer { @Parameter(names = { "-c", "--max-connections" }, description = "Max number of TCP connections to a single broker") - public int maxConnections = 0; + public int maxConnections = 100; @Parameter(names = { "-i", "--stats-interval-seconds" }, description = "Statistics Interval Seconds. If 0, statistics will be disabled") diff --git a/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceProducer.java b/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceProducer.java index e93236dbe7b..3679ff2e0e9 100644 --- a/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceProducer.java +++ b/pulsar-testclient/src/main/java/com/yahoo/pulsar/testclient/PerformanceProducer.java @@ -111,7 +111,7 @@ public class PerformanceProducer { @Parameter(names = { "-c", "--max-connections" }, description = "Max number of TCP connections to a single broker") - public int maxConnections = 0; + public int maxConnections = 100; @Parameter(names = { "-m", "--num-messages" }, description = "Number of messages to publish in total. If 0, it will keep publishing") -- GitLab