From 3f443dc2b08cc0215006107e48a46204b3e1fb53 Mon Sep 17 00:00:00 2001 From: Joe Di Pol Date: Mon, 18 Sep 2023 16:11:29 -0700 Subject: [PATCH] Deprecate support for etcd v2 --- .../io/helidon/config/etcd/EtcdConfigSourceBuilder.java | 7 +++++-- .../config/etcd/internal/client/v2/EtcdV2Client.java | 4 ++++ docs/se/config/supported-formats.adoc | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/config/etcd/src/main/java/io/helidon/config/etcd/EtcdConfigSourceBuilder.java b/config/etcd/src/main/java/io/helidon/config/etcd/EtcdConfigSourceBuilder.java index 21af8d71410..b8af290f7a5 100644 --- a/config/etcd/src/main/java/io/helidon/config/etcd/EtcdConfigSourceBuilder.java +++ b/config/etcd/src/main/java/io/helidon/config/etcd/EtcdConfigSourceBuilder.java @@ -59,9 +59,9 @@ public final class EtcdConfigSourceBuilder extends AbstractConfigSourceBuilder { /** - * Default Etcd API version ({@link io.helidon.config.etcd.EtcdConfigSourceBuilder.EtcdApi#v2}). + * Default Etcd API version ({@link io.helidon.config.etcd.EtcdConfigSourceBuilder.EtcdApi#v3}). */ - public static final EtcdApi DEFAULT_VERSION = EtcdApi.v2; + public static final EtcdApi DEFAULT_VERSION = EtcdApi.v3; /** * Default Etcd endpoint ({@code http://localhost:2379}). */ @@ -195,12 +195,15 @@ EtcdEndpoint target(int k) { * {@code EtcdApi} determines which etcd API version will be used. *

* There are two API versions: {@code v2} and {@code v3}. + * + * Support for v2 of the API is deprecated */ public enum EtcdApi { /** * Etcd API v2 version. */ + @Deprecated(since = "4.0.0", forRemoval = true) v2(new EtcdV2ClientFactory()), /** diff --git a/config/etcd/src/main/java/io/helidon/config/etcd/internal/client/v2/EtcdV2Client.java b/config/etcd/src/main/java/io/helidon/config/etcd/internal/client/v2/EtcdV2Client.java index 627c2b9f65a..d16053bfd1f 100644 --- a/config/etcd/src/main/java/io/helidon/config/etcd/internal/client/v2/EtcdV2Client.java +++ b/config/etcd/src/main/java/io/helidon/config/etcd/internal/client/v2/EtcdV2Client.java @@ -41,6 +41,8 @@ /** * Etcd API v2 client. */ +@Deprecated(since = "4.0.0", forRemoval = true) + public class EtcdV2Client implements EtcdClient { private static final Logger LOGGER = Logger.getLogger(EtcdV2Client.class.getName()); @@ -52,6 +54,8 @@ public class EtcdV2Client implements EtcdClient { * Init client with specified target Etcd uri. * * @param uris target Etcd uris + * + * @deprecated */ EtcdV2Client(URI... uris) { etcd = new mousio.etcd4j.EtcdClient(uris); diff --git a/docs/se/config/supported-formats.adoc b/docs/se/config/supported-formats.adoc index d93f9102480..3797d949fa1 100644 --- a/docs/se/config/supported-formats.adoc +++ b/docs/se/config/supported-formats.adoc @@ -269,7 +269,7 @@ Config config = Config.create( <1> Use the factory method `EtcdConfigSourceBuilder.create` to initialize the builder. <2> Specify the Etcd endpoint address. <3> Specify the Etcd key of the configuration document. -<4> Version of the Etcd API to use; `v2` and `v3` are supported. +<4> Version of the Etcd API to use; `v3` is supported. `v2` is deprecated. The config system will use the <> automatically in this example because the file type of the key is `.yaml`. @@ -304,7 +304,7 @@ for the source: * `uri` (type `URI`) - Etcd endpoint URI. * `key` (type `String`) - Etcd key that is associated with the configuration. * `api` (type `EtcdConfigSourceBuilder.EtcdApi`, i.e. `v2` or `v3`) - Etcd API - version. + version. `v2` is deprecated. Other optional `properties` are inherited from `AbstractParsableConfigSource.Builder`. (see