-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup the packages and especially the public facing client API and enhance the ability to configure a Nessie client instance. `NessieClientBuilder` related changes: * Use Java system properties, process environment, a (new) Nessie client config file and a dot-env file as configuration sources. Can later be extended to allow encrypted configuration values (think: bearer tokens, passwords, etc) and expressions by using SmallRye Config. * Refactor `NessieClientBuilder` to use the Java services API, so it's easier to pull in custom implementations. * Make `NessieClientBuilder` a "pure interface", add abstract base class(es) for implementations. * Remove the generic type arg from `NessieClientBuilder`, because it's irrelevant for integrations, added a generic `asInstanceOf()` for special cases. * Move configuration via string key-value pairs (`fromConfig()` functions) to the introduced abstract base classes. Nessie API implementation related changes: * Move REST/API-v1 code to the new `org.projectnessie.client.rest.v1` package. * Move REST/API-v2 code to the new `org.projectnessie.client.rest.v2` package. * Let the `org.projectnessie.client.http` itself only contain types for HTTP, except the legacy `HttpClientBuilder`, which is now deprecated for removal. * Remove old, Java streams related baggage (restricts compatibility tests to 0.31.0 or newer). * Move "common" client-side namsepace handling out of the REST-v2 implementation. * Fix an oversight in the REST-v2 implementation for tag deletion. Content-generator tool change: * Add option for Nessie client name * Add option for Nessie client builder properties GC tool change: * Add option for Nessie client name Test support change: * add `NessieClientNameResolver` interface for test classes
- Loading branch information
Showing
104 changed files
with
2,220 additions
and
1,089 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...nt-testextension/src/main/java/org/projectnessie/client/ext/NessieClientNameResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2023 Dremio | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.projectnessie.client.ext; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import org.projectnessie.client.NessieClientBuilder; | ||
import org.projectnessie.client.NessieConfigConstants; | ||
|
||
/** | ||
* Test classes that implement this interface can specify a different Nessie client by {@linkplain | ||
* NessieClientBuilder#name() its name} and optionally a set of configuration options. | ||
*/ | ||
@FunctionalInterface | ||
public interface NessieClientNameResolver { | ||
String nessieClientName(); | ||
|
||
/** | ||
* When overriding this function, make sure to use the map of this implementation to include the | ||
* {@link #nessieClientName()}. | ||
*/ | ||
default Map<String, String> mainNessieClientConfigMap() { | ||
Map<String, String> mainConfig = new HashMap<>(); | ||
mainConfig.put(NessieConfigConstants.CONF_NESSIE_CLIENT_NAME, nessieClientName()); | ||
return mainConfig; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.