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

Update co.elastic to org.opensearch #88

Merged
merged 7 commits into from
Feb 3, 2022
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Docker is used for some tests to spawn an Elasticsearch server.

This is a multi-project build. The Java client is in the [`java-client`](./java-client) subproject. Additional subprojects will come with more extensive API tests and examples.

The `co.elastic.clients.elasticsearch` package and its children are all entirely generated, and the generator is not part of this repository. Because of this, PRs will not work for this part of the code. If you want to suggest changes to the generated code, open an issue describing how the code should look like, so that we can discuss on updating the generator.
The `org.opensearch.clients.opensearch` package and its children are all entirely generated, and the generator is not part of this repository. Because of this, PRs will not work for this part of the code. If you want to suggest changes to the generated code, open an issue describing how the code should look like, so that we can discuss on updating the generator.

Other packages contain support classes and frameworks that provide the plumbing between the generated code and the http client and JSON object mapping libraries. PRs are more than welcome on code in these packages.

Expand Down
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
*/

allprojects {
group = "co.elastic.clients"
group = "org.opensearch.clients"
// Release manager provides a $VERSION. If not present, it's a local or CI snapshot build.
version = System.getenv("VERSION") ?:
(File(project.rootDir, "config/version.txt").readText().trim() + "-SNAPSHOT")

repositories {
mavenCentral()
mavenLocal()
maven(url = "https://plugins.gradle.org/m2/")
jcenter()
}

apply(plugin = "checkstyle")
Expand Down Expand Up @@ -68,7 +71,7 @@ tasks.register<Task>(name = "publishForReleaseManager") {
val releaseDir = File(rootProject.buildDir, "release")
releaseDir.mkdirs()

File(rootProject.buildDir, "repository/co/elastic/clients").listFiles()?.forEach { artifact ->
File(rootProject.buildDir, "repository/org/opensearch/clients").listFiles()?.forEach { artifact ->
println("Releasing artifact " + artifact.name)

val versionDir = File(artifact, version)
Expand Down
8 changes: 4 additions & 4 deletions config/checkstyle/checkstyle_suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

<suppressions>
<!-- Do not enforce line length on generated code -->
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]co[/\\]elastic[/\\]clients[/\\]elasticsearch[^.]*\.java" checks="LineLength" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]co[/\\]elastic[/\\]clients[/\\]elasticsearch[^.]*\.java" checks="UnusedImports" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]co[/\\]elastic[/\\]clients[/\\]elasticsearch[/\\]Elasticsearch[^.]*\.java" checks="LineLength" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]co[/\\]elastic[/\\]clients[/\\]elasticsearch[/\\]Elasticsearch[^.]*\.java" checks="UnusedImports" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]org[/\\]opensearch[/\\]clients[/\\]opensearch[^.]*\.java" checks="LineLength" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]org[/\\]opensearch[/\\]clients[/\\]opensearch[^.]*\.java" checks="UnusedImports" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]org[/\\]opensearch[/\\]clients[/\\]opensearch[/\\]OpenSearch[^.]*\.java" checks="LineLength" />
<suppress files="client[/\\]src[/\\]main[/\\]java[/\\]org[/\\]opensearch[/\\]clients[/\\]opensearch[/\\]OpenSearch[^.]*\.java" checks="UnusedImports" />
</suppressions>
2 changes: 1 addition & 1 deletion config/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.0
1.0.0
2 changes: 1 addition & 1 deletion docs/api-conventions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ the {ref}/rest-apis.html[{es} API documentation].

The {java-client} follows this structure: feature groups are called “namespaces”,
and each namespace is located in a subpackage of
`co.elastic.clients.elasticsearch`.
`opensearch`.

Each of the namespace clients can be accessed from the top level {es} client. The
only exceptions are the “search” and “document” APIs which are located in the `core`
Expand Down
2 changes: 1 addition & 1 deletion docs/connecting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The {java-client} is structured around three main components:
* **API client classes**. These provide strongly typed data structures and
methods for {es} APIs. Since the {es} API is large, it is structured in feature
groups (also called “namespaces”), each having its own client class. {es} core
features are implemented in the `ElasticsearchClient` class.
features are implemented in the `OpenSearchClient` class.
* **A JSON object mapper**. This maps your application classes to JSON and
seamlessly integrates them with the API client.
* **A transport layer implementation**. This is where all HTTP request handling
Expand Down
4 changes: 2 additions & 2 deletions docs/design/0002-namespace-clients-and-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public interface Endpoint<RequestT, ResponseT, ErrorT> {
A base implementation allows to quickly create an implementation for ES requests. The endpoint for a request lives as a static constant in the request class.

```java
public static final Endpoint<FooRequest, FooResponse, ElasticsearchError> ENDPOINT =
public static final Endpoint<FooRequest, FooResponse, OpenSearchError> ENDPOINT =
new Endpoint.Simple<>(
r -> "POST",
r -> "/foo",
Expand All @@ -81,7 +81,7 @@ public static final Endpoint<FooRequest, FooResponse, ElasticsearchError> ENDPOI
If a user wants to create a stripped-down version of the API with filtered field, they have to provide their own response class with a new endpoint that delegates to the original one.

```java
public static final Endpoint<FooRequest, ReducedFooResponse, ElasticsearchError> FILTERED =
public static final Endpoint<FooRequest, ReducedFooResponse, OpenSearchError> FILTERED =
new Endpoint.Simple<>(
FooRequest.ENDPOINT::method,
FooRequest.ENDPOINT::requestUrl,
Expand Down
10 changes: 5 additions & 5 deletions docs/installation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ Requirements:

* Java 8 or later.
* A JSON object mapping library to allow seamless integration of
your application classes with the Elasticsearch API. The Java client has
your application classes with the Opensearch API. The Java client has
support for https://github.com/FasterXML/jackson[Jackson] or a
http://json-b.net/[JSON-B] library like
https://github.com/eclipse-ee4j/yasson[Eclipse Yasson].


Releases are hosted on
https://search.maven.org/search?q=g:co.elastic.clients[Maven Central]. If you
https://search.maven.org/search?q=g:org.opensearch.clients[Maven Central]. If you
are looking for a SNAPSHOT version, the Elastic Maven Snapshot repository is
available at https://snapshots.elastic.co/maven/.

Expand All @@ -24,7 +24,7 @@ available at https://snapshots.elastic.co/maven/.
["source","groovy",subs="attributes+"]
--------------------------------------------------
dependencies {
implementation 'co.elastic.clients:elasticsearch-java:{version}'
implementation 'org.opensearch.clients:opensearch-java:{version}'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
}
--------------------------------------------------
Expand All @@ -42,8 +42,8 @@ dependencies:

<dependencies>
<dependency>
<groupId>co.elastic.clients</groupId>
<artifactId>elasticsearch-java</artifactId>
<groupId>org.opensearch.clients</groupId>
<artifactId>opensearch-java</artifactId>
<version>{version}</version>
</dependency>
<dependency>
Expand Down
16 changes: 9 additions & 7 deletions java-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ publishing {
}

dependencies {
val elasticsearchVersion = "7.16.0"
val jacksonVersion = "2.12.0"

val opensearchVersion = "1.2.4"
val jacksonVersion = "2.12.5"

// Apache 2.0
// https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.html
api("org.elasticsearch.client", "elasticsearch-rest-client", elasticsearchVersion)
implementation("org.opensearch.client", "opensearch-rest-client", opensearchVersion)

// Apache 2.0
// https://search.maven.org/artifact/com.google.code.findbugs/jsr305
Expand Down Expand Up @@ -152,19 +152,21 @@ dependencies {
testImplementation("junit", "junit" , "4.12")

// MIT
// testImplementation("org.testcontainers", "testcontainers", "1.15.3")
// testImplementation("org.testcontainers", "elasticsearch", "1.15.3")
// https://github.com/classgraph/classgraph
testImplementation("io.github.classgraph:classgraph:4.8.116")

// MIT
// https://www.testcontainers.org/
testImplementation("org.testcontainers", "testcontainers", "1.15.3")
testImplementation("org.testcontainers", "elasticsearch", "1.15.3")
// testImplementation("org.testcontainers", "testcontainers", "1.15.3")
// testImplementation("org.testcontainers", "elasticsearch", "1.15.3")
}


licenseReport {
renderers = arrayOf(SpdxReporter(File(rootProject.buildDir, "release/dependencies.csv")))
excludeGroups = arrayOf("org.elasticsearch.client")
excludeGroups = arrayOf("org.opensearch.client")
}

class SpdxReporter(val dest: File) : ReportRenderer {
Expand Down
Loading