aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-12-15 11:43:23 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-12-15 11:43:23 +0100
commitbbb84555acd2911de0fc94f56cd696ee222c3e91 (patch)
treeff9780d20261b7c4fbb1b999dbc14a6e5b362a40
parent93510e7705a94af9f86e5bfa88b79f58631c44e2 (diff)
Deprecate vespa-http-client
-rw-r--r--vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/LegacyVespaRecordWriter.java19
-rw-r--r--vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/VespaOutputFormat.java1
-rw-r--r--vespa-http-client/pom.xml2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClient.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClientFactory.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedConnectException.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedEndpointException.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedProtocolException.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Result.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Session.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SessionFactory.java2
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SimpleLoggerResultCallback.java3
-rw-r--r--vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SyncFeedClient.java2
13 files changed, 29 insertions, 14 deletions
diff --git a/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/LegacyVespaRecordWriter.java b/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/LegacyVespaRecordWriter.java
index 19e98e8373d..89e48a16909 100644
--- a/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/LegacyVespaRecordWriter.java
+++ b/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/LegacyVespaRecordWriter.java
@@ -8,9 +8,6 @@ import com.fasterxml.jackson.core.JsonToken;
import com.yahoo.vespa.hadoop.mapreduce.util.VespaConfiguration;
import com.yahoo.vespa.hadoop.mapreduce.util.VespaCounters;
import com.yahoo.vespa.hadoop.pig.VespaDocumentOperation;
-import com.yahoo.vespa.http.client.FeedClient;
-import com.yahoo.vespa.http.client.FeedClientFactory;
-import com.yahoo.vespa.http.client.Result;
import com.yahoo.vespa.http.client.config.Cluster;
import com.yahoo.vespa.http.client.config.ConnectionParams;
import com.yahoo.vespa.http.client.config.Endpoint;
@@ -39,14 +36,16 @@ import java.util.logging.Logger;
* {@link LegacyVespaRecordWriter} sends the output &lt;key, value&gt; to one or more Vespa endpoints using vespa-http-client.
*
* @author lesters
+ * @deprecated Replaced by {@link VespaRecordWriter}
*/
-@SuppressWarnings("rawtypes")
+@SuppressWarnings({"rawtypes", "deprecation"})
+@Deprecated
public class LegacyVespaRecordWriter extends RecordWriter {
private final static Logger log = Logger.getLogger(LegacyVespaRecordWriter.class.getCanonicalName());
private boolean initialized = false;
- private FeedClient feedClient;
+ private com.yahoo.vespa.http.client.FeedClient feedClient;
private final VespaCounters counters;
private final int progressInterval;
@@ -154,7 +153,7 @@ public class LegacyVespaRecordWriter extends RecordWriter {
}
ResultCallback resultCallback = new ResultCallback(counters);
- feedClient = FeedClientFactory.create(sessionParams.build(), resultCallback);
+ feedClient = com.yahoo.vespa.http.client.FeedClientFactory.create(sessionParams.build(), resultCallback);
initialized = true;
log.info("VespaStorage configuration:\n" + configuration.toString());
@@ -204,7 +203,7 @@ public class LegacyVespaRecordWriter extends RecordWriter {
}
- static class ResultCallback implements FeedClient.ResultCallback {
+ static class ResultCallback implements com.yahoo.vespa.http.client.FeedClient.ResultCallback {
final VespaCounters counters;
public ResultCallback(VespaCounters counters) {
@@ -212,15 +211,15 @@ public class LegacyVespaRecordWriter extends RecordWriter {
}
@Override
- public void onCompletion(String docId, Result documentResult) {
+ public void onCompletion(String docId, com.yahoo.vespa.http.client.Result documentResult) {
if (!documentResult.isSuccess()) {
counters.incrementDocumentsFailed(1);
StringBuilder sb = new StringBuilder();
sb.append("Problems with docid ");
sb.append(docId);
sb.append(": ");
- List<Result.Detail> details = documentResult.getDetails();
- for (Result.Detail detail : details) {
+ List<com.yahoo.vespa.http.client.Result.Detail> details = documentResult.getDetails();
+ for (com.yahoo.vespa.http.client.Result.Detail detail : details) {
sb.append(detail.toString());
sb.append(" ");
}
diff --git a/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/VespaOutputFormat.java b/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/VespaOutputFormat.java
index 9dd21aee557..00ce396fd09 100644
--- a/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/VespaOutputFormat.java
+++ b/vespa-hadoop/src/main/java/com/yahoo/vespa/hadoop/mapreduce/VespaOutputFormat.java
@@ -32,6 +32,7 @@ public class VespaOutputFormat extends OutputFormat {
@Override
+ @SuppressWarnings("deprecation")
public RecordWriter getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException {
VespaCounters counters = VespaCounters.get(context);
VespaConfiguration configuration = VespaConfiguration.get(context.getConfiguration(), configOverride);
diff --git a/vespa-http-client/pom.xml b/vespa-http-client/pom.xml
index eefb07d4ece..b25f54362ed 100644
--- a/vespa-http-client/pom.xml
+++ b/vespa-http-client/pom.xml
@@ -151,9 +151,9 @@
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${vespaClients.jdk.releaseVersion}</release>
- <showDeprecation>true</showDeprecation>
<compilerArgs>
<arg>-Xlint:all</arg>
+ <arg>-Xlint:-deprecation</arg>
<arg>-Xlint:-serial</arg>
<arg>-Werror</arg>
</compilerArgs>
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 0b16f37744a..d9ff09552ef 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
@@ -21,7 +21,9 @@ import java.util.concurrent.atomic.AtomicInteger;
*
* @author dybis
* @see FeedClientFactory
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public interface FeedClient extends AutoCloseable {
/**
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClientFactory.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClientFactory.java
index 842cf503f3a..ce2f9e0b140 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClientFactory.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedClientFactory.java
@@ -14,7 +14,9 @@ import java.util.concurrent.ThreadFactory;
* Factory for creating FeedClient.
*
* @author dybis
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public class FeedClientFactory {
/**
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedConnectException.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedConnectException.java
index c2f3bb089c5..822a670ae08 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedConnectException.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedConnectException.java
@@ -7,7 +7,9 @@ import com.yahoo.vespa.http.client.config.Endpoint;
* An exception thrown when the client is unable to connect to a feed endpoint.
*
* @author bjorncs
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public class FeedConnectException extends FeedEndpointException {
public FeedConnectException(Throwable cause, Endpoint endpoint) {
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedEndpointException.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedEndpointException.java
index b696864749c..304e2ea321b 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedEndpointException.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedEndpointException.java
@@ -9,7 +9,9 @@ import com.yahoo.vespa.http.client.config.Endpoint;
* @see FeedConnectException
* @see FeedProtocolException
* @author bjorncs
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public abstract class FeedEndpointException extends RuntimeException {
private final Endpoint endpoint;
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedProtocolException.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedProtocolException.java
index b428259fdf1..93041cced1c 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedProtocolException.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/FeedProtocolException.java
@@ -7,7 +7,9 @@ import com.yahoo.vespa.http.client.config.Endpoint;
* An exception thrown when a feed endpoint returns an error during feeding.
*
* @author bjorncs
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public class FeedProtocolException extends FeedEndpointException {
private final int httpStatusCode;
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 93a3b43c211..5db592da02f 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
@@ -16,7 +16,9 @@ import java.util.List;
* single endpoint, and a Result may wrap data for multiple endpoints.
*
* @author Einar M R Rosenvinge
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public class Result {
public enum ResultType {
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Session.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Session.java
index 8c79aa90517..203f2d3b462 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Session.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/Session.java
@@ -15,7 +15,7 @@ import java.util.concurrent.BlockingQueue;
*
* @author Einar M R Rosenvinge
* @see SessionFactory
- * @deprecated use either FeedClient or SyncFeedClient // TODO: Remove on Vespa 8
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
@Deprecated
public interface Session extends AutoCloseable {
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SessionFactory.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SessionFactory.java
index 159a4e78289..ef231ccc713 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SessionFactory.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SessionFactory.java
@@ -14,7 +14,7 @@ import java.util.concurrent.ThreadFactory;
* Factory for creating {@link Session} instances.
*
* @author Einar M R Rosenvinge
- * @deprecated use either FeedClient or SyncFeedClient // TODO: Remove on Vespa 8
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
@Deprecated
public final class SessionFactory {
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SimpleLoggerResultCallback.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SimpleLoggerResultCallback.java
index eba7fbef483..e03bfd2b816 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SimpleLoggerResultCallback.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SimpleLoggerResultCallback.java
@@ -1,7 +1,6 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.http.client;
-import java.io.PrintStream;
import java.time.Duration;
import java.time.Instant;
import java.util.Date;
@@ -15,7 +14,9 @@ import java.util.concurrent.atomic.AtomicInteger;
* std err as well.
*
* @author dybis
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public class SimpleLoggerResultCallback implements FeedClient.ResultCallback {
private final Object monitor = new Object();
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SyncFeedClient.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SyncFeedClient.java
index b8bd6ddeea5..2fc63bbbcc5 100644
--- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SyncFeedClient.java
+++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/SyncFeedClient.java
@@ -19,7 +19,9 @@ import java.util.concurrent.ThreadLocalRandom;
* (but it can and should be reused for multiple subsequent synchronous calls).
*
* @author bratseth
+ * @deprecated Vespa-http-client will be removed in Vespa 8. It's replaced by <a href="https://docs.vespa.ai/en/vespa-feed-client.html">vespa-feed-client</a>
*/
+@Deprecated
public class SyncFeedClient implements AutoCloseable {
private final FeedClient wrappedClient;