Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Commit

Permalink
[improve][cli] Remove cli unnecessary code (apache#22161)
Browse files Browse the repository at this point in the history
  • Loading branch information
crossoverJie authored Mar 10, 2024
1 parent 4effaa7 commit b8d53aa
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import org.apache.pulsar.client.api.MessageListener;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.client.api.SizeUnit;
import org.apache.pulsar.client.api.SubscriptionInitialPosition;
import org.apache.pulsar.client.api.SubscriptionType;
import org.apache.pulsar.client.api.transaction.Transaction;
Expand Down Expand Up @@ -230,7 +229,6 @@ public static void main(String[] args) throws Exception {
long testEndTime = startTime + (long) (arguments.testTime * 1e9);

ClientBuilder clientBuilder = PerfClientUtils.createClientBuilderFromArguments(arguments)
.memoryLimit(arguments.memoryLimit, SizeUnit.BYTES)
.enableTransaction(arguments.isEnableTransaction);

PulsarClient pulsarClient = clientBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import org.apache.pulsar.client.api.ProducerBuilder;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.SizeUnit;
import org.apache.pulsar.client.api.TypedMessageBuilder;
import org.apache.pulsar.client.api.transaction.Transaction;
import org.apache.pulsar.common.partition.PartitionedTopicMetadata;
Expand Down Expand Up @@ -513,7 +512,6 @@ private static void runProducer(int producerId,


ClientBuilder clientBuilder = PerfClientUtils.createClientBuilderFromArguments(arguments)
.memoryLimit(arguments.memoryLimit, SizeUnit.BYTES)
.enableTransaction(arguments.isEnableTransaction);

client = clientBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.apache.pulsar.client.api.Reader;
import org.apache.pulsar.client.api.ReaderBuilder;
import org.apache.pulsar.client.api.ReaderListener;
import org.apache.pulsar.client.api.SizeUnit;
import org.apache.pulsar.client.impl.MessageIdImpl;
import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.common.util.FutureUtil;
Expand Down Expand Up @@ -141,7 +140,6 @@ public static void main(String[] args) throws Exception {
};

ClientBuilder clientBuilder = PerfClientUtils.createClientBuilderFromArguments(arguments)
.memoryLimit(arguments.memoryLimit, SizeUnit.BYTES)
.enableTls(arguments.useTls);

PulsarClient pulsarClient = clientBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.client.api.SizeUnit;
import org.apache.pulsar.client.api.SubscriptionInitialPosition;
import org.apache.pulsar.client.api.SubscriptionType;
import org.apache.pulsar.client.api.transaction.Transaction;
Expand Down Expand Up @@ -224,7 +223,6 @@ public static void main(String[] args)
}

ClientBuilder clientBuilder = PerfClientUtils.createClientBuilderFromArguments(arguments)
.memoryLimit(arguments.memoryLimit, SizeUnit.BYTES)
.enableTransaction(!arguments.isDisableTransaction);

try (PulsarClient client = clientBuilder.build()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public void testClientCreation() throws Exception {
args.tlsTrustCertsFilePath = "path";
args.tlsAllowInsecureConnection = true;
args.maxLookupRequest = 100000;
args.memoryLimit = 10240;

final ClientBuilderImpl builder = (ClientBuilderImpl)PerfClientUtils.createClientBuilderFromArguments(args);
final ClientConfigurationData conf = builder.getClientConfigurationData();
Expand All @@ -89,6 +90,7 @@ public void testClientCreation() throws Exception {
Assert.assertEquals(conf.getMaxLookupRequest(), 100000);
Assert.assertNull(conf.getProxyServiceUrl());
Assert.assertNull(conf.getProxyProtocol());
Assert.assertEquals(conf.getMemoryLimitBytes(), 10240L);

}

Expand Down

0 comments on commit b8d53aa

Please sign in to comment.