diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2023-01-09 15:05:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-09 15:05:47 +0100 |
commit | baf54beef9119768f99d41d950373f742a42df62 (patch) | |
tree | d49cf940d500a6dc1cb0e10af2f6a0810050f51f /vespa-feed-client/src/main/java | |
parent | caca1ab7e615fa628ddb864e72c022e5b22c1951 (diff) | |
parent | c0134657004cff6070defbc668848cb7c1d47f4d (diff) |
Merge pull request #25451 from vespa-engine/jonmv/update--cli-args
Update CLI arguments help.tzt for feed client
Diffstat (limited to 'vespa-feed-client/src/main/java')
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java | 4 | ||||
-rw-r--r-- | vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/FeedClientBuilderImpl.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java index 639aebf7c46..19f3ccf7a83 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/ApacheCluster.java @@ -36,6 +36,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.zip.GZIPOutputStream; +import static ai.vespa.feed.client.FeedClientBuilder.Compression.auto; +import static ai.vespa.feed.client.FeedClientBuilder.Compression.gzip; import static org.apache.hc.core5.http.ssl.TlsCiphers.excludeH2Blacklisted; import static org.apache.hc.core5.http.ssl.TlsCiphers.excludeWeak; @@ -89,7 +91,7 @@ class ApacheCluster implements Cluster { wrapped.headers().forEach((name, value) -> request.setHeader(name, value.get())); if (wrapped.body() != null) { byte[] body = wrapped.body(); - if (compression == Compression.gzip || compression == null && body.length > 512) { + if (compression == gzip || compression == auto && body.length > 512) { request.setHeader(gzipEncodingHeader); body = gzipped(body); } diff --git a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/FeedClientBuilderImpl.java b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/FeedClientBuilderImpl.java index b364ba953eb..e5bfffbf24d 100644 --- a/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/FeedClientBuilderImpl.java +++ b/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/FeedClientBuilderImpl.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; +import static ai.vespa.feed.client.FeedClientBuilder.Compression.auto; import static ai.vespa.feed.client.FeedClientBuilder.Compression.none; import static java.util.Objects.requireNonNull; @@ -51,7 +52,7 @@ public class FeedClientBuilderImpl implements FeedClientBuilder { boolean benchmark = true; boolean dryrun = false; boolean speedTest = false; - Compression compression = null; + Compression compression = auto; URI proxy; |