Skip to content

Remove the transport client #42538

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

Merged
merged 21 commits into from
Jun 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,7 @@ Commercially licensed code that integrates with the rest of Elasticsearch. The
`docs` subdirectory functions just like the top level `docs` subdirectory and
the `qa` subdirectory functions just like the top level `qa` subdirectory. The
`plugin` subdirectory contains the x-pack module which runs inside the
Elasticsearch process. The `transport-client` subdirectory contains extensions
to Elasticsearch's standard transport client to work properly with x-pack.
Elasticsearch process.

### Gradle Build

Expand Down
6 changes: 0 additions & 6 deletions TESTING.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,6 @@ e.g. -Dtests.rest.suite=index,get,create/10_with_id
blacklisted and need to be skipped
e.g. -Dtests.rest.blacklist=index/*/Index document,get/10_basic/*

Note that the REST tests, like all the integration tests, can be run against an external
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping this paragraph loses that tests.cluster applies to the REST tests too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest tests use tests.rest.cluster

cluster by specifying the `tests.cluster` property, which if present needs to contain a
comma separated list of nodes to connect to (e.g. localhost:9300). A transport client will
be created based on that and used for all the before|after test operations, and to extract
the http addresses of the nodes so that REST requests can be sent to them.

== Testing packaging

The packaging tests use Vagrant virtual machines to verify that installing
Expand Down
4 changes: 2 additions & 2 deletions client/benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ Example invocation:

The parameters are in order:

* Client type: Use either "rest" or "transport"
* Client type: Always "rest"
* Benchmark type: Use either "bulk" or "search"
* Benchmark target host IP (the host where Elasticsearch is running)
* name of the index
* a search request body (remember to escape double quotes). The `TransportClientBenchmark` uses `QueryBuilders.wrapperQuery()` internally which automatically adds a root key `query`, so it must not be present in the command line parameter.
* a search request body (remember to escape double quotes).
* A comma-separated list of target throughput rates
10 changes: 2 additions & 8 deletions client/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,10 @@ test.enabled = false
dependencies {
compile 'org.apache.commons:commons-math3:3.2'

compile project(":client:rest")
compile project(':server')
compile project(':client:rest')
// bottleneck should be the client, not Elasticsearch
compile project(path: ':client:client-benchmark-noop-api-plugin')
// for transport client
compile project(":server")
compile project(":client:transport")
compile project(path: ':modules:transport-netty4', configuration: 'runtime')
compile project(path: ':modules:reindex', configuration: 'runtime')
compile project(path: ':modules:lang-mustache', configuration: 'runtime')
compile project(path: ':modules:percolator', configuration: 'runtime')
}

// No licenses for our benchmark deps (we don't ship benchmarks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
package org.elasticsearch.client.benchmark;

import org.elasticsearch.client.benchmark.rest.RestClientBenchmark;
import org.elasticsearch.client.benchmark.transport.TransportClientBenchmark;
import org.elasticsearch.common.SuppressForbidden;

import java.util.Arrays;
Expand All @@ -30,9 +29,6 @@ public static void main(String[] args) throws Exception {
String type = args[0];
AbstractBenchmark<?> benchmark = null;
switch (type) {
case "transport":
benchmark = new TransportClientBenchmark();
break;
case "rest":
benchmark = new RestClientBenchmark();
break;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ static Request getIndex(GetIndexRequest getIndexRequest) {
*/
@Deprecated
static Request indicesExist(org.elasticsearch.action.admin.indices.get.GetIndexRequest getIndexRequest) {
// this can be called with no indices as argument by transport client, not via REST though
if (getIndexRequest.indices() == null || getIndexRequest.indices().length == 0) {
throw new IllegalArgumentException("indices are mandatory");
}
Expand All @@ -465,7 +464,6 @@ static Request indicesExist(org.elasticsearch.action.admin.indices.get.GetIndexR
}

static Request indicesExist(GetIndexRequest getIndexRequest) {
// this can be called with no indices as argument by transport client, not via REST though
if (getIndexRequest.indices() == null || getIndexRequest.indices().length == 0) {
throw new IllegalArgumentException("indices are mandatory");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class DataFrameRequestConvertersTests extends ESTestCase {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected interface AsyncMethodNoRequest<Response> {

private static class HighLevelClient extends RestHighLevelClient {
private HighLevelClient(RestClient restClient) {
super(restClient, (client) -> {}, new SearchModule(Settings.EMPTY, false, Collections.emptyList()).getNamedXContents());
super(restClient, (client) -> {}, new SearchModule(Settings.EMPTY, Collections.emptyList()).getNamedXContents());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ public void testXPackInfo() throws IOException {
public void testXPackInfoEmptyRequest() throws IOException {
XPackInfoResponse info = highLevelClient().xpack().info(new XPackInfoRequest(), RequestOptions.DEFAULT);

/*
* The default in the transport client is non-verbose and returning
* no categories which is the opposite of the default when you use
* the API over REST. We don't want to break the transport client
* even though it doesn't feel like a good default.
*/
// TODO: reconsider this leniency now that the transport client is gone
assertNull(info.getBuildInfo());
assertNull(info.getLicenseInfo());
assertNull(info.getFeatureSetsInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private static void toXContent(GetDataFrameTransformResponse response, XContentB

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected boolean supportsUnknownFields() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected boolean supportsUnknownFields() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected Predicate<String> getRandomFieldsExcludeFilter() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected boolean supportsUnknownFields() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected SourceConfig createTestInstance() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected boolean supportsUnknownFields() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected Predicate<String> getRandomFieldsExcludeFilter() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ private static AnalysisConfig.Builder createValidCategorizationConfig() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public static Job createRandomizedJob() {

@Override
protected NamedXContentRegistry xContentRegistry() {
SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList());
SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
return new NamedXContentRegistry(searchModule.getNamedXContents());
}
}
57 changes: 0 additions & 57 deletions client/transport/build.gradle

This file was deleted.

Loading