aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-http-client/src/main/java
diff options
context:
space:
mode:
authorGeir Storli <geirstorli@yahoo.no>2019-01-21 16:06:53 +0100
committerGitHub <noreply@github.com>2019-01-21 16:06:53 +0100
commit8372a883c5a5fa100f88fc9b80824359b5bb70cd (patch)
tree660ce3ef61f060b33bd97eac1185715606b8e2bd /vespa-http-client/src/main/java
parent3722c1cdd91fce30d1c2538b2a8749d9321e194b (diff)
parenteb0b1134a66507e3bd8f09793c22cd824d01dff5 (diff)
Merge pull request #8198 from vespa-engine/7
7 MERGEOK
Diffstat (limited to 'vespa-http-client/src/main/java')
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClient.java1
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Result.java27
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/ConnectionParams.java13
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/config/FeedParams.java4
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java15
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ClusterConnection.java10
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/operationProcessor/OperationProcessor.java4
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/runner/CommandLineArguments.java20
8 files changed, 10 insertions, 84 deletions
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)