Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.x: Deprecate support for etcd v2 #7623

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022 Oracle and/or its affiliates.
* Copyright (c) 2017, 2023 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down 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
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2021 Oracle and/or its affiliates.
* Copyright (c) 2017, 2023 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down 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