diff options
Diffstat (limited to 'vespa-http-client')
14 files changed, 18 insertions, 121 deletions
diff --git a/vespa-http-client/abi-spec.json b/vespa-http-client/abi-spec.json index 72ae6588d8f..22c8ce9b7fc 100644 --- a/vespa-http-client/abi-spec.json +++ b/vespa-http-client/abi-spec.json @@ -94,7 +94,6 @@ "public void <init>(com.yahoo.vespa.http.client.config.Endpoint)", "public com.yahoo.vespa.http.client.config.Endpoint getEndpoint()", "public boolean isSuccess()", - "public boolean isTransient()", "public com.yahoo.vespa.http.client.Result$ResultType getResultType()", "public java.lang.Exception getException()", "public java.lang.String getTraceMessage()", @@ -133,7 +132,6 @@ "public java.lang.CharSequence getDocumentDataAsCharSequence()", "public java.lang.Object getContext()", "public boolean isSuccess()", - "public boolean isTransient()", "public java.util.List getDetails()", "public boolean hasLocalTrace()", "public java.lang.String toString()" @@ -278,7 +276,6 @@ "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setUseCompression(boolean)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setMaxRetries(int)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setDryRun(boolean)", - "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setEnableV3Protocol(boolean)", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setMinTimeBetweenRetries(long, java.util.concurrent.TimeUnit)", "public long getMinTimeBetweenRetriesMs()", "public com.yahoo.vespa.http.client.config.ConnectionParams$Builder setTraceLevel(int)", @@ -330,7 +327,6 @@ "public int getMaxRetries()", "public long getMinTimeBetweenRetriesMs()", "public boolean isDryRun()", - "public boolean isEnableV3Protocol()", "public int getTraceLevel()", "public int getTraceEveryXOperation()", "public boolean getPrintTraceToStdErr()" diff --git a/vespa-http-client/pom.xml b/vespa-http-client/pom.xml index 1b70ea7cba5..f98b39c70b1 100644 --- a/vespa-http-client/pom.xml +++ b/vespa-http-client/pom.xml @@ -6,11 +6,11 @@ <parent> <groupId>com.yahoo.vespa</groupId> <artifactId>parent</artifactId> - <version>6-SNAPSHOT</version> + <version>7-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> <artifactId>vespa-http-client</artifactId> - <version>6-SNAPSHOT</version> + <version>7-SNAPSHOT</version> <name>${project.artifactId}</name> <description>Independent external feeding API towards Vespa.</description> diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClient.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClient.java index e35c0316433..bde637a3e39 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClient.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClient.java @@ -62,7 +62,6 @@ public interface FeedClient extends AutoCloseable { * @see FeedEndpointException * @param exception An exception specifying endpoint and cause. See {@link FeedEndpointException} for details. */ - // TODO Vespa 7: Remove empty default implementation default void onEndpointException(FeedEndpointException exception) {} } diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Result.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Result.java index efa609a2d59..3abae261f5e 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Result.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Result.java @@ -30,7 +30,6 @@ public class Result { private final Document document; private final boolean success; - private final boolean _transient; private final List<Detail> details; private final String localTrace; @@ -38,13 +37,10 @@ public class Result { this.document = document; this.details = Collections.unmodifiableList(new ArrayList<>(values)); boolean totalSuccess = true; - boolean totalTransient = true; for (Detail d : details) { if (d.getResultType() != ResultType.OPERATION_EXECUTED) {totalSuccess = false; } - if (d.getResultType() != ResultType.TRANSITIVE_ERROR) {totalTransient = false; } } this.success = totalSuccess; - this._transient = totalTransient; this.localTrace = localTrace == null ? null : localTrace.toString(); } @@ -83,17 +79,6 @@ public class Result { public boolean isSuccess() { return success; } - /** - * @deprecated use resultType on items getDetails() to check operations. - * Returns true if an error is transient, false if it is permanent. Irrelevant - * if {@link #isSuccess()} is true (returns true in those cases). - * - * @return true if an error is transient (or there is no error), false otherwise. - */ - @Deprecated - public boolean isTransient() { - return _transient; - } public List<Detail> getDetails() { return details; } @@ -150,18 +135,6 @@ public class Result { } /** - * @deprecated use getResultType. - * Returns true if an error is transient, false if it is permanent. Irrelevant - * if {@link #isSuccess()} is true (returns true in those cases). - * - * @return true if an error is transient (or there is no error), false otherwise. - */ - @Deprecated - public boolean isTransient() { - return resultType == ResultType.TRANSITIVE_ERROR || resultType == ResultType.OPERATION_EXECUTED; - } - - /** * Returns the result of the operation. */ public ResultType getResultType() { diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/ConnectionParams.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/ConnectionParams.java index d5f362ce1d1..9e34d4d1747 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/ConnectionParams.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/ConnectionParams.java @@ -46,7 +46,6 @@ public final class ConnectionParams { private int maxRetries = 100; private long minTimeBetweenRetriesMs = 700; private boolean dryRun = false; - private boolean enableV3Protocol = true; private int traceLevel = 0; private int traceEveryXOperation = 0; private boolean printTraceToStdErr = true; @@ -175,12 +174,6 @@ public final class ConnectionParams { return this; } - @Beta - public Builder setEnableV3Protocol(boolean enableV3Protocol) { - this.enableV3Protocol = enableV3Protocol; - return this; - } - /** * Set the min time between retries when temporarily failing against a gateway. * @@ -245,7 +238,6 @@ public final class ConnectionParams { maxRetries, minTimeBetweenRetriesMs, dryRun, - enableV3Protocol, traceLevel, traceEveryXOperation, printTraceToStdErr); @@ -301,7 +293,6 @@ public final class ConnectionParams { private final int maxRetries; private final long minTimeBetweenRetriesMs; private final boolean dryRun; - private final boolean enableV3Protocol; private final int traceLevel; private final int traceEveryXOperation; private final boolean printTraceToStdErr; @@ -319,7 +310,6 @@ public final class ConnectionParams { int maxRetries, long minTimeBetweenRetriesMs, boolean dryRun, - boolean enableV3Protocol, int traceLevel, int traceEveryXOperation, boolean printTraceToStdErr) { @@ -335,7 +325,6 @@ public final class ConnectionParams { this.maxRetries = maxRetries; this.minTimeBetweenRetriesMs = minTimeBetweenRetriesMs; this.dryRun = dryRun; - this.enableV3Protocol = enableV3Protocol; this.traceLevel = traceLevel; this.traceEveryXOperation = traceEveryXOperation; this.printTraceToStdErr = printTraceToStdErr; @@ -387,8 +376,6 @@ public final class ConnectionParams { return dryRun; } - public boolean isEnableV3Protocol() { return enableV3Protocol; } - public int getTraceLevel() { return traceLevel; } diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java index 06edd222be2..4adf3912dbd 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java @@ -39,13 +39,11 @@ public final class FeedParams { * Mutable class used to instantiate a {@link FeedParams}. */ public static final class Builder { - private DataFormat dataFormat = DataFormat.XML_UTF8; + private DataFormat dataFormat = DataFormat.JSON_UTF8; private long serverTimeout = TimeUnit.SECONDS.toMillis(180); private long clientTimeout = TimeUnit.SECONDS.toMillis(20); private String route = null; private int maxChunkSizeBytes = 50 * 1024; - // This value is deprecated, and the default is no longer used. - private int clientQueueSize = -1; private int maxInFlightRequests = 5000; private long localQueueTimeOut = 180000; private String priority = null; diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java index e9852de215a..57007743b1b 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java @@ -78,7 +78,7 @@ class ApacheGatewayConnection implements GatewayConnection { ConnectionParams connectionParams, HttpClientFactory httpClientFactory, String clientId) { - SUPPORTED_VERSIONS.add(2); + SUPPORTED_VERSIONS.add(3); this.endpoint = endpoint; this.feedParams = feedParams; this.clusterSpecificRoute = clusterSpecificRoute; @@ -94,11 +94,8 @@ class ApacheGatewayConnection implements GatewayConnection { endOfFeed = END_OF_FEED_XML; } this.clientId = clientId; - if (connectionParams.isEnableV3Protocol()) { - if (this.clientId == null) { - throw new RuntimeException("Set to support version 3, but got no client Id."); - } - SUPPORTED_VERSIONS.add(3); + if (this.clientId == null) { + throw new RuntimeException("Got no client Id."); } } @@ -161,7 +158,7 @@ class ApacheGatewayConnection implements GatewayConnection { private ByteBuffer[] getDataWithStartAndEndOfFeed(List<Document> docs, int version) { List<ByteBuffer> data = new ArrayList<>(); - if (version == 2 || version == 3) { // TODO: Vespa 7: Remove support for version 2 + if (version == 3) { for (Document doc : docs) { int operationSize = doc.size() + startOfFeed.length + endOfFeed.length; StringBuilder envelope = new StringBuilder(); @@ -344,10 +341,6 @@ class ApacheGatewayConnection implements GatewayConnection { log.log(Level.FINE, "Server decided upon protocol version " + serverVersion + "."); } } - if (this.connectionParams.isEnableV3Protocol() && serverVersion != 3) { - throw new ServerResponseException("Client was set up to use v3 of protocol, however, gateway wants to " + - "use version " + serverVersion + ". Already set up structures for v3 so can not do v2 now."); - } this.negotiatedVersion = serverVersion; } diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ClusterConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ClusterConnection.java index d124475e3a5..da45acc5687 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ClusterConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ClusterConnection.java @@ -79,12 +79,8 @@ public class ClusterConnection implements AutoCloseable { operationProcessor.getClientId() ); } - if (connectionParams.isEnableV3Protocol()) { - if (documentQueue == null) { - documentQueue = new DocumentQueue(clientQueueSizePerCluster); - } - } else { - documentQueue = new DocumentQueue(clientQueueSizePerCluster / cluster.getEndpoints().size()); + if (documentQueue == null) { + documentQueue = new DocumentQueue(clientQueueSizePerCluster); } final IOThread ioThread = new IOThread( operationProcessor.getIoThreadGroup(), @@ -95,7 +91,7 @@ public class ClusterConnection implements AutoCloseable { maxInFlightPerSession, feedParams.getLocalQueueTimeOut(), documentQueue, - connectionParams.isEnableV3Protocol() ? feedParams.getMaxSleepTimeMs() : 0); + feedParams.getMaxSleepTimeMs()); ioThreads.add(ioThread); } } diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java index 7ead0c4a37f..45133901567 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java @@ -51,7 +51,6 @@ public class OperationProcessor { private final long minTimeBetweenRetriesMs; private final Random random = new SecureRandom(); private final int traceEveryXOperation; - private final boolean blockOperationsToSameDocument; private int traceCounter = 0; private final boolean traceToStderr; private final ThreadGroup ioThreadGroup; @@ -66,7 +65,6 @@ public class OperationProcessor { this.resultCallback = resultCallback; this.incompleteResultsThrottler = incompleteResultsThrottler; this.timeoutExecutor = timeoutExecutor; - this.blockOperationsToSameDocument = sessionParams.getConnectionParams().isEnableV3Protocol(); this.ioThreadGroup = new ThreadGroup("operationprocessor"); if (sessionParams.getClusters().isEmpty()) { @@ -243,7 +241,7 @@ public class OperationProcessor { incompleteResultsThrottler.operationStart(); synchronized (monitor) { - if (blockOperationsToSameDocument && inflightDocumentIds.contains(document.getDocumentId())) { + if (inflightDocumentIds.contains(document.getDocumentId())) { blockedDocumentsByDocumentId.put(document.getDocumentId(), document); return; } diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/runner/CommandLineArguments.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/runner/CommandLineArguments.java index 837df3c98ef..98cd13a226d 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/runner/CommandLineArguments.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/runner/CommandLineArguments.java @@ -66,16 +66,6 @@ public class CommandLineArguments { return null; } } - if (cmdArgs.enableV2Protocol) { - if (cmdArgs.enableV3Protocol) { - System.err.println("both --useV2Protocol and --useV3Protocol options specified, ignoring deprecated --useV2Protocol option"); - cmdArgs.enableV2Protocol = false; - } else { - System.err.println("--useV2Protocol option is deprecated"); - } - } else { - cmdArgs.enableV3Protocol = true; - } return cmdArgs; } @@ -110,10 +100,7 @@ public class CommandLineArguments { private HelpOption helpOption; @Option(name = {"--useV3Protocol"}, description = "Use V3 protocol to gateway. This is the default protocol.") - private boolean enableV3Protocol = false; - - @Option(name = {"--useV2Protocol"}, description = "Use old V2 protocol to gateway. This option is deprecated.") - private boolean enableV2Protocol = false; + private boolean enableV3Protocol = true; @Option(name = {"--file"}, description = "The name of the input file to read.") @@ -152,10 +139,6 @@ public class CommandLineArguments { "to be pending at any given time.") private int maxPendingOperationCountArg = 10000; - @Option(name = {"--debugport"}, - description = "Deprecated, not used.") - private int debugportArg = 9988; - @Option(name = {"-v", "--verbose"}, description = "Enable verbose output of progress.") private boolean verboaseArg = false; @@ -244,7 +227,6 @@ public class CommandLineArguments { .setHostnameVerifier(insecure ? NoopHostnameVerifier.INSTANCE : SSLConnectionSocketFactory.getDefaultHostnameVerifier()) .setNumPersistentConnectionsPerEndpoint(16) - .setEnableV3Protocol(! enableV2Protocol) .setUseCompression(useCompressionArg) .setMaxRetries(noRetryArg ? 0 : 100) .setMinTimeBetweenRetries(retrydelayArg, TimeUnit.SECONDS) diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/config/FeedParamsTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/config/FeedParamsTest.java index f2dd9a44878..3af73dbf47a 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/config/FeedParamsTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/config/FeedParamsTest.java @@ -20,7 +20,7 @@ public class FeedParamsTest { public void testDefaults() { FeedParams params = new FeedParams.Builder().build(); - assertThat(params.getDataFormat(), equalTo(FeedParams.DataFormat.XML_UTF8)); + assertThat(params.getDataFormat(), equalTo(FeedParams.DataFormat.JSON_UTF8)); assertThat(params.getMaxChunkSizeBytes(), is(50 * 1024)); assertThat(params.getRoute(), nullValue()); assertThat(params.getServerTimeout(TimeUnit.SECONDS), is(180L)); diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java index 1e2d37884ef..90d2fa28833 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnectionTest.java @@ -55,7 +55,6 @@ public class ApacheGatewayConnectionTest { final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build(); final String clusterSpecificRoute = ""; final ConnectionParams connectionParams = new ConnectionParams.Builder() - .setEnableV3Protocol(true) .build(); final List<Document> documents = new ArrayList<>(); @@ -90,7 +89,6 @@ public class ApacheGatewayConnectionTest { final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build(); final String clusterSpecificRoute = ""; final ConnectionParams connectionParams = new ConnectionParams.Builder() - .setEnableV3Protocol(true) .build(); // This is the fake server, returns wrong session Id. @@ -115,7 +113,6 @@ public class ApacheGatewayConnectionTest { final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.JSON_UTF8).build(); final String clusterSpecificRoute = ""; final ConnectionParams connectionParams = new ConnectionParams.Builder() - .setEnableV3Protocol(true) .build(); final ApacheGatewayConnection.HttpClientFactory mockFactory = @@ -192,7 +189,7 @@ public class ApacheGatewayConnectionTest { @Test public void testCompressedWriteOperations() throws Exception { final Endpoint endpoint = Endpoint.create("hostname", 666, false); - final FeedParams feedParams = new FeedParams.Builder().build(); + final FeedParams feedParams = new FeedParams.Builder().setDataFormat(FeedParams.DataFormat.XML_UTF8).build(); final String clusterSpecificRoute = ""; final ConnectionParams connectionParams = new ConnectionParams.Builder() .setUseCompression(true) diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java index 3a335aa5da0..5c58aa347e8 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessorTest.java @@ -124,7 +124,7 @@ public class OperationProcessorTest { SessionParams sessionParams = new SessionParams.Builder() .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("host")).build()) .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("host")).build()) - .setConnectionParams(new ConnectionParams.Builder().setEnableV3Protocol(true).build()) + .setConnectionParams(new ConnectionParams.Builder().build()) .build(); OperationProcessor operationProcessor = new OperationProcessor( new IncompleteResultsThrottler(1000, 1000, null, null), @@ -161,7 +161,7 @@ public class OperationProcessorTest { public void testBlockingOfOperationsToSameDocIdWithTwoOperations() { SessionParams sessionParams = new SessionParams.Builder() .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("host")).build()) - .setConnectionParams(new ConnectionParams.Builder().setEnableV3Protocol(true).build()) + .setConnectionParams(new ConnectionParams.Builder().build()) .build(); OperationProcessor operationProcessor = new OperationProcessor( @@ -194,7 +194,7 @@ public class OperationProcessorTest { public void testBlockingOfOperationsToSameDocIdMany() { SessionParams sessionParams = new SessionParams.Builder() .addCluster(new Cluster.Builder().addEndpoint(Endpoint.create("host")).build()) - .setConnectionParams(new ConnectionParams.Builder().setEnableV3Protocol(true).build()) + .setConnectionParams(new ConnectionParams.Builder().build()) .build(); OperationProcessor operationProcessor = new OperationProcessor( @@ -229,7 +229,7 @@ public class OperationProcessorTest { Endpoint endpoint = Endpoint.create("host"); SessionParams sessionParams = new SessionParams.Builder() .addCluster(new Cluster.Builder().addEndpoint(endpoint).build()) - .setConnectionParams(new ConnectionParams.Builder().setEnableV3Protocol(true).build()) + .setConnectionParams(new ConnectionParams.Builder().build()) .build(); OperationProcessor operationProcessor = new OperationProcessor( diff --git a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java index fd10aeb6100..ec80dd53a4b 100644 --- a/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java +++ b/vespa-http-client/src/test/java/com/yahoo/vespa/http/client/runner/CommandLineArgumentsTest.java @@ -95,7 +95,6 @@ public class CommandLineArgumentsTest { assertThat(params.getClusters().get(0).getEndpoints().get(0).isUseSsl(), is(false)); assertThat(params.getConnectionParams().getUseCompression(), is(false)); assertThat(params.getConnectionParams().getNumPersistentConnectionsPerEndpoint(), is(16)); - assertThat(params.getConnectionParams().isEnableV3Protocol(), is(true)); assertThat(params.getFeedParams().getRoute(), is("default")); assertThat(params.getFeedParams().getDataFormat(), is(FeedParams.DataFormat.XML_UTF8)); assertThat(params.getFeedParams().getLocalQueueTimeOut(), is(180000L)); @@ -113,7 +112,6 @@ public class CommandLineArgumentsTest { args.add("--useCompression"); args.add("--useDynamicThrottling"); add("maxpending", "3456"); - add("debugport", "7890"); args.add("--verbose"); args.add("--useTls"); add("header", "Header-Name: Header-Value"); @@ -177,30 +175,10 @@ public class CommandLineArgumentsTest { } @Test - public void testDeprecatedUseV2Protocol() { - addMinimum(); - args.add("--useV2Protocol"); - CommandLineArguments arguments = CommandLineArguments.build(asArray()); - SessionParams params = arguments.createSessionParams(true /* use json */); - assertThat(params.getConnectionParams().isEnableV3Protocol(), is(false)); - } - - @Test public void testUseV3Protocol() { addMinimum(); args.add("--useV3Protocol"); CommandLineArguments arguments = CommandLineArguments.build(asArray()); SessionParams params = arguments.createSessionParams(true /* use json */); - assertThat(params.getConnectionParams().isEnableV3Protocol(), is(true)); - } - - @Test - public void testDeprecatedUseV2ProtocolAndUseV3Protocol() { - addMinimum(); - args.add("--useV2Protocol"); - args.add("--useV3Protocol"); - CommandLineArguments arguments = CommandLineArguments.build(asArray()); - SessionParams params = arguments.createSessionParams(true /* use json */); - assertThat(params.getConnectionParams().isEnableV3Protocol(), is(true)); } } |