Skip to content

Commit

Permalink
Deprecate support for etcd v2
Browse files Browse the repository at this point in the history
  • Loading branch information
barchetta committed Sep 18, 2023
1 parent ec4e534 commit 3f443dc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public final class EtcdConfigSourceBuilder extends AbstractConfigSourceBuilder<E
Builder<EtcdConfigSourceBuilder, EtcdConfigSource> {

/**
* 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}).
*/
Expand Down Expand Up @@ -195,12 +195,15 @@ EtcdEndpoint target(int k) {
* {@code EtcdApi} determines which etcd API version will be used.
* <p>
* 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()),

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions docs/se/config/supported-formats.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<Config-ModuleYaml,YAML parser>> automatically in this example
because the file type of the key is `.yaml`.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3f443dc

Please sign in to comment.