Skip to content

Commit

Permalink
Merge branch '6.x' into deprecation-checks
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts195 committed Jan 29, 2019
2 parents 6053906 + bfffb34 commit 4b02743
Show file tree
Hide file tree
Showing 395 changed files with 13,623 additions and 4,310 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.bat]
indent_size = 2
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class VagrantTestPlugin implements Plugin<Project> {
void afterExecute(Task task, TaskState state) {
final String gradlew = Os.isFamily(Os.FAMILY_WINDOWS) ? "gradlew" : "./gradlew"
if (state.failure != null) {
println "REPRODUCE WITH: ${gradlew} ${reproTaskPath} -Dtests.seed=${project.testSeed} "
println "REPRODUCE WITH: ${gradlew} \"${reproTaskPath}\" -Dtests.seed=${project.testSeed} "
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Optional;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;
import org.gradle.process.ExecResult;
Expand Down Expand Up @@ -86,11 +88,13 @@ public void setTargetCompatibility(JavaVersion targetCompatibility) {
}

@InputFiles
@PathSensitive(PathSensitivity.NAME_ONLY)
public Configuration getForbiddenAPIsConfiguration() {
return getProject().getConfigurations().getByName("forbiddenApisCliJar");
}

@InputFile
@PathSensitive(PathSensitivity.NONE)
public File getSignatureFile() {
return signatureFile;
}
Expand Down Expand Up @@ -154,6 +158,7 @@ public Set<String> getMissingClassExcludes() {
}

@InputFiles
@PathSensitive(PathSensitivity.NAME_ONLY)
@SkipWhenEmpty
public Set<File> getJarsToScan() {
// These are SelfResolvingDependency, and some of them backed by file collections, like the Gradle API files,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ private void logFileContents(String description, Path from) {
logger.error("{} `{}`", description, this);
try(Stream<String> lines = Files.lines(from, StandardCharsets.UTF_8)) {
lines
.map(line -> " [" + name + "]" + line)
.map(line -> " " + line)
.forEach(logger::error);
} catch (IOException e) {
throw new UncheckedIOException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ private static void shutdownExecutorService() {
}

private static void shutDownAllClusters() {
logger.info("Shutting down all test clusters", new RuntimeException());
if (logger.isDebugEnabled()) {
logger.debug("Shutting down all test clusters", new RuntimeException());
}
synchronized (runningClusters) {
runningClusters.forEach(each -> each.stop(true));
runningClusters.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.elasticsearch.gradle.test.GradleIntegrationTestCase;
import org.gradle.testkit.runner.GradleRunner;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.rules.TemporaryFolder;

Expand All @@ -38,6 +39,7 @@
import java.util.Objects;
import java.util.stream.Collectors;

@Ignore // Awaiting a fix in https://github.com/elastic/elasticsearch/issues/37889.
public class BuildExamplePluginsIT extends GradleIntegrationTestCase {

private static final List<File> EXAMPLE_PLUGINS = Collections.unmodifiableList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
import org.elasticsearch.gradle.test.GradleIntegrationTestCase;
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.junit.Ignore;

import java.util.Arrays;

@Ignore // Awaiting a fix in https://github.com/elastic/elasticsearch/issues/37889.
public class TestClustersPluginIT extends GradleIntegrationTestCase {

public void testListClusters() {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
elasticsearch = 6.7.0
lucene = 7.6.0
lucene = 7.7.0-snapshot-874ff046df

# optional dependencies
spatial4j = 0.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheRequest;
import org.elasticsearch.action.admin.indices.cache.clear.ClearIndicesCacheResponse;
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.admin.indices.flush.FlushRequest;
import org.elasticsearch.action.admin.indices.flush.FlushResponse;
Expand All @@ -38,8 +36,8 @@
import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse;
import org.elasticsearch.client.indices.GetFieldMappingsRequest;
import org.elasticsearch.client.indices.GetFieldMappingsResponse;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.open.OpenIndexRequest;
Expand All @@ -60,6 +58,8 @@
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.client.core.ShardsAcknowledgedResponse;
import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.indices.CreateIndexResponse;
import org.elasticsearch.client.indices.FreezeIndexRequest;
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
Expand Down Expand Up @@ -147,24 +147,52 @@ public void deleteAsync(DeleteIndexRequest deleteIndexRequest, ActionListener<Ac
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public CreateIndexResponse create(CreateIndexRequest createIndexRequest, RequestOptions options) throws IOException {
public CreateIndexResponse create(CreateIndexRequest createIndexRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(createIndexRequest, IndicesRequestConverters::createIndex, options,
CreateIndexResponse::fromXContent, emptySet());
CreateIndexResponse::fromXContent, emptySet());
}

/**
* Creates an index using the Create Index API.
* <p>
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
* Create Index API on elastic.co</a>
* @deprecated Prefer {@link #create(CreateIndexRequest, RequestOptions)}
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
* method {@link #create(CreateIndexRequest, RequestOptions)} should be used instead, which accepts a new
* request object and also uses request options instead of headers.
*/
@Deprecated
public CreateIndexResponse create(CreateIndexRequest createIndexRequest, Header... headers) throws IOException {
public CreateIndexResponse create(
org.elasticsearch.action.admin.indices.create.CreateIndexRequest createIndexRequest,
Header... headers) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(createIndexRequest, IndicesRequestConverters::createIndex,
CreateIndexResponse::fromXContent, emptySet(), headers);
}

/**
* Creates an index using the Create Index API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
* Create Index API on elastic.co</a>
* @param createIndexRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
* method {@link #create(CreateIndexRequest, RequestOptions)} should be used instead, which accepts a new
* request object.
*/
@Deprecated
public org.elasticsearch.action.admin.indices.create.CreateIndexResponse create(
org.elasticsearch.action.admin.indices.create.CreateIndexRequest createIndexRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(createIndexRequest,
IndicesRequestConverters::createIndex, options,
org.elasticsearch.action.admin.indices.create.CreateIndexResponse::fromXContent, emptySet());
}

/**
* Asynchronously creates an index using the Create Index API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
Expand All @@ -173,20 +201,47 @@ public CreateIndexResponse create(CreateIndexRequest createIndexRequest, Header.
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*/
public void createAsync(CreateIndexRequest createIndexRequest, RequestOptions options, ActionListener<CreateIndexResponse> listener) {
public void createAsync(CreateIndexRequest createIndexRequest,
RequestOptions options,
ActionListener<CreateIndexResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(createIndexRequest, IndicesRequestConverters::createIndex, options,
CreateIndexResponse::fromXContent, listener, emptySet());
CreateIndexResponse::fromXContent, listener, emptySet());
}

/**
* Asynchronously creates an index using the Create Index API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
* Create Index API on elastic.co</a>
* @param createIndexRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
* method {@link #createAsync(CreateIndexRequest, RequestOptions, ActionListener)} should be used instead,
* which accepts a new request object.
*/
@Deprecated
public void createAsync(org.elasticsearch.action.admin.indices.create.CreateIndexRequest createIndexRequest,
RequestOptions options,
ActionListener<org.elasticsearch.action.admin.indices.create.CreateIndexResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(createIndexRequest,
IndicesRequestConverters::createIndex, options,
org.elasticsearch.action.admin.indices.create.CreateIndexResponse::fromXContent, listener, emptySet());
}

/**
* Asynchronously creates an index using the Create Index API.
* <p>
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html">
* Create Index API on elastic.co</a>
* @deprecated Prefer {@link #createAsync(CreateIndexRequest, RequestOptions, ActionListener)}
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
* method {@link #createAsync(CreateIndexRequest, RequestOptions, ActionListener)} should be used instead,
* which accepts a new request object and also uses request objects instead of headers.
*/
@Deprecated
public void createAsync(CreateIndexRequest createIndexRequest, ActionListener<CreateIndexResponse> listener, Header... headers) {
public void createAsync(org.elasticsearch.action.admin.indices.create.CreateIndexRequest createIndexRequest,
ActionListener<CreateIndexResponse> listener, Header... headers) {
restHighLevelClient.performRequestAsyncAndParseEntity(createIndexRequest, IndicesRequestConverters::createIndex,
CreateIndexResponse::fromXContent, listener, emptySet(), headers);
}
Expand Down Expand Up @@ -329,11 +384,16 @@ public void getMappingAsync(GetMappingsRequest getMappingsRequest, RequestOption
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The method
* {@link #getFieldMapping(GetFieldMappingsRequest, RequestOptions)} should be used instead, which accepts a new request object.
*/
public GetFieldMappingsResponse getFieldMapping(GetFieldMappingsRequest getFieldMappingsRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(getFieldMappingsRequest, IndicesRequestConverters::getFieldMapping, options,
GetFieldMappingsResponse::fromXContent, emptySet());
@Deprecated
public org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse getFieldMapping(
org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest getFieldMappingsRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(getFieldMappingsRequest, IndicesRequestConverters::getFieldMapping,
options, org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse::fromXContent, emptySet());
}

/**
Expand All @@ -343,9 +403,45 @@ public GetFieldMappingsResponse getFieldMapping(GetFieldMappingsRequest getField
* @param getFieldMappingsRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*
* @deprecated This method uses an old request object which still refers to types, a deprecated feature. The
* method {@link #getFieldMappingAsync(GetFieldMappingsRequest, RequestOptions, ActionListener)} should be used instead,
* which accepts a new request object.
*/
@Deprecated
public void getFieldMappingAsync(org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRequest getFieldMappingsRequest,
RequestOptions options,
ActionListener<org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(getFieldMappingsRequest, IndicesRequestConverters::getFieldMapping, options,
org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse::fromXContent, listener, emptySet());
}

/**
* Retrieves the field mappings on an index or indices using the Get Field Mapping API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html">
* Get Field Mapping API on elastic.co</a>
* @param getFieldMappingsRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
public GetFieldMappingsResponse getFieldMapping(GetFieldMappingsRequest getFieldMappingsRequest,
RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(getFieldMappingsRequest, IndicesRequestConverters::getFieldMapping,
options, GetFieldMappingsResponse::fromXContent, emptySet()
);
}

/**
* Asynchronously retrieves the field mappings on an index or indices using the Get Field Mapping API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html">
* Get Field Mapping API on elastic.co</a>
* @param getFieldMappingsRequest the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @param listener the listener to be notified upon request completion
*/
public void getFieldMappingAsync(GetFieldMappingsRequest getFieldMappingsRequest, RequestOptions options,
ActionListener<GetFieldMappingsResponse> listener) {
public void getFieldMappingAsync(GetFieldMappingsRequest getFieldMappingsRequest,
RequestOptions options, ActionListener<GetFieldMappingsResponse> listener) {
restHighLevelClient.performRequestAsyncAndParseEntity(getFieldMappingsRequest, IndicesRequestConverters::getFieldMapping, options,
GetFieldMappingsResponse::fromXContent, listener, emptySet());
}
Expand Down
Loading

0 comments on commit 4b02743

Please sign in to comment.