Skip to content

Commit ad66152

Browse files
committed
Merge branch 'master' into retention-lease-stats
* master: (29 commits) Fix limit on retaining sequence number (elastic#37992) Docs test fix, wait for shards active. Revert "Revert "Documented default values for index follow request parameters. (elastic#37917)"" Revert "Documented default values for index follow request parameters. (elastic#37917)" Ensure date parsing BWC compatibility (elastic#37929) SQL: Skip the nested and object field types in case of an ODBC request (elastic#37948) Use mappings to format doc-value fields by default. (elastic#30831) Give precedence to index creation when mixing typed templates with typeless index creation and vice-versa. (elastic#37871) Add classifier to tar.gz in docker compose (elastic#38011) Documented default values for index follow request parameters. (elastic#37917) Fix fetch source option in expand search phase (elastic#37908) Restore a noop _all metadata field for 6x indices (elastic#37808) Added ccr to xpack usage infrastructure (elastic#37256) Fix exit code for Security CLI tools (elastic#37956) Streamline S3 Repository- and Client-Settings (elastic#37393) Add version 6.6.1 (elastic#37975) Ensure task metadata not null in follow test (elastic#37993) Docs fix - missing callout Types removal - deprecate include_type_name with index templates (elastic#37484) Handle completion suggestion without contexts ...
2 parents bdfb2bc + ba285a5 commit ad66152

File tree

195 files changed

+4965
-963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+4965
-963
lines changed

buildSrc/build.gradle

+6-2
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,12 @@ if (project != rootProject) {
183183
}
184184

185185
dependencies {
186-
distribution project(':distribution:archives:zip')
187-
distribution project(':distribution:archives:oss-zip')
186+
distribution project(':distribution:archives:windows-zip')
187+
distribution project(':distribution:archives:oss-windows-zip')
188+
distribution project(':distribution:archives:darwin-tar')
189+
distribution project(':distribution:archives:oss-darwin-tar')
190+
distribution project(':distribution:archives:linux-tar')
191+
distribution project(':distribution:archives:oss-linux-tar')
188192
}
189193

190194
String localDownloads = "${rootProject.buildDir}/local-downloads"

buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

+37-6
Original file line numberDiff line numberDiff line change
@@ -191,25 +191,38 @@ class ClusterFormationTasks {
191191
throw new GradleException("Unknown distribution: ${distro} in project ${project.path}")
192192
}
193193
Version version = Version.fromString(elasticsearchVersion)
194-
String group = "downloads.zip" // dummy group, does not matter except for integ-test-zip, it is ignored by the fake ivy repo
194+
String os = getOs()
195+
String classifier = "${os}-x86_64"
196+
String packaging = os.equals('windows') ? 'zip' : 'tar.gz'
195197
String artifactName = 'elasticsearch'
196198
if (distro.equals('oss') && Version.fromString(elasticsearchVersion).onOrAfter('6.3.0')) {
197199
artifactName += '-oss'
198200
}
199-
String snapshotProject = distro == 'oss' ? 'oss-zip' : 'zip'
200201
Object dependency
202+
String snapshotProject = "${os}-${os.equals('windows') ? 'zip' : 'tar'}"
203+
if (version.before("7.0.0")) {
204+
snapshotProject = "zip"
205+
}
206+
if (distro.equals("oss")) {
207+
snapshotProject = "oss-" + snapshotProject
208+
}
201209
boolean internalBuild = project.hasProperty('bwcVersions')
202210
VersionCollection.UnreleasedVersionInfo unreleasedInfo = null
203211
if (project.hasProperty('bwcVersions')) {
204212
// NOTE: leniency is needed for external plugin authors using build-tools. maybe build the version compat info into build-tools?
205213
unreleasedInfo = project.bwcVersions.unreleasedInfo(version)
206214
}
207215
if (unreleasedInfo != null) {
208-
dependency = project.dependencies.project(path: ":distribution:bwc:${unreleasedInfo.gradleProjectName}", configuration: snapshotProject)
216+
dependency = project.dependencies.project(
217+
path: ":distribution:bwc:${unreleasedInfo.gradleProjectName}", configuration: snapshotProject)
209218
} else if (internalBuild && elasticsearchVersion.equals(VersionProperties.elasticsearch)) {
210219
dependency = project.dependencies.project(path: ":distribution:archives:${snapshotProject}")
211220
} else {
212-
dependency = "${group}:${artifactName}:${elasticsearchVersion}@zip"
221+
if (version.before('7.0.0')) {
222+
classifier = "" // for bwc, before we had classifiers
223+
}
224+
// group does not matter as it is not used when we pull from the ivy repo that points to the download service
225+
dependency = "dnm:${artifactName}:${elasticsearchVersion}${classifier}@${packaging}"
213226
}
214227
project.dependencies.add(configuration.name, dependency)
215228
}
@@ -335,8 +348,15 @@ class ClusterFormationTasks {
335348
the elasticsearch source tree then this should be the version of elasticsearch built by the source tree.
336349
If it isn't then Bad Things(TM) will happen. */
337350
Task extract = project.tasks.create(name: name, type: Copy, dependsOn: extractDependsOn) {
338-
from {
339-
project.zipTree(configuration.singleFile)
351+
if (getOs().equals("windows")) {
352+
from {
353+
project.zipTree(configuration.singleFile)
354+
}
355+
} else {
356+
// macos and linux use tar
357+
from {
358+
project.tarTree(project.resources.gzip(configuration.singleFile))
359+
}
340360
}
341361
into node.baseDir
342362
}
@@ -948,4 +968,15 @@ class ClusterFormationTasks {
948968
PluginPropertiesExtension extension = pluginProject.extensions.findByName('esplugin')
949969
return extension.name
950970
}
971+
972+
/** Find the current OS */
973+
static String getOs() {
974+
String os = "linux"
975+
if (Os.FAMILY_WINDOWS) {
976+
os = "windows"
977+
} else if (Os.FAMILY_MAC) {
978+
os = "darwin"
979+
}
980+
return os
981+
}
951982
}

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class VagrantTestPlugin implements Plugin<Project> {
5353

5454
/** All distributions to bring into test VM, whether or not they are used **/
5555
static final List<String> DISTRIBUTIONS = unmodifiableList([
56-
'archives:tar',
57-
'archives:oss-tar',
58-
'archives:zip',
59-
'archives:oss-zip',
56+
'archives:linux-tar',
57+
'archives:oss-linux-tar',
58+
'archives:windows-zip',
59+
'archives:oss-windows-zip',
6060
'packages:rpm',
6161
'packages:oss-rpm',
6262
'packages:deb',

client/rest-high-level/src/main/java/org/elasticsearch/client/CcrRequestConverters.java

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ static Request putFollow(PutFollowRequest putFollowRequest) throws IOException {
4646
.addPathPartAsIs("_ccr", "follow")
4747
.build();
4848
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
49+
RequestConverters.Params parameters = new RequestConverters.Params(request);
50+
parameters.withWaitForActiveShards(putFollowRequest.waitForActiveShards());
4951
request.setEntity(createEntity(putFollowRequest, REQUEST_BODY_CONTENT_TYPE));
5052
return request;
5153
}

client/rest-high-level/src/main/java/org/elasticsearch/client/IndicesClient.java

+95-14
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@
4949
import org.elasticsearch.action.admin.indices.shrink.ResizeRequest;
5050
import org.elasticsearch.action.admin.indices.shrink.ResizeResponse;
5151
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
52-
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
53-
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
5452
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryRequest;
5553
import org.elasticsearch.action.admin.indices.validate.query.ValidateQueryResponse;
5654
import org.elasticsearch.action.support.master.AcknowledgedResponse;
@@ -61,7 +59,9 @@
6159
import org.elasticsearch.client.indices.GetIndexTemplatesRequest;
6260
import org.elasticsearch.client.indices.GetMappingsRequest;
6361
import org.elasticsearch.client.indices.GetMappingsResponse;
62+
import org.elasticsearch.client.indices.GetIndexTemplatesResponse;
6463
import org.elasticsearch.client.indices.IndexTemplatesExistRequest;
64+
import org.elasticsearch.client.indices.PutIndexTemplateRequest;
6565
import org.elasticsearch.client.indices.PutMappingRequest;
6666
import org.elasticsearch.client.indices.UnfreezeIndexRequest;
6767
import org.elasticsearch.rest.RestStatus;
@@ -908,6 +908,7 @@ public void putSettingsAsync(UpdateSettingsRequest updateSettingsRequest, Reques
908908
AcknowledgedResponse::fromXContent, listener, emptySet());
909909
}
910910

911+
911912
/**
912913
* Puts an index template using the Index Templates API.
913914
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
@@ -916,9 +917,13 @@ public void putSettingsAsync(UpdateSettingsRequest updateSettingsRequest, Reques
916917
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
917918
* @return the response
918919
* @throws IOException in case there is a problem sending the request or parsing back the response
920+
* @deprecated This old form of request allows types in mappings. Use {@link #putTemplate(PutIndexTemplateRequest, RequestOptions)}
921+
* instead which introduces a new request object without types.
919922
*/
920-
public AcknowledgedResponse putTemplate(PutIndexTemplateRequest putIndexTemplateRequest,
921-
RequestOptions options) throws IOException {
923+
@Deprecated
924+
public AcknowledgedResponse putTemplate(
925+
org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest putIndexTemplateRequest,
926+
RequestOptions options) throws IOException {
922927
return restHighLevelClient.performRequestAndParseEntity(putIndexTemplateRequest, IndicesRequestConverters::putTemplate, options,
923928
AcknowledgedResponse::fromXContent, emptySet());
924929
}
@@ -930,9 +935,44 @@ public AcknowledgedResponse putTemplate(PutIndexTemplateRequest putIndexTemplate
930935
* @param putIndexTemplateRequest the request
931936
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
932937
* @param listener the listener to be notified upon request completion
938+
* @deprecated This old form of request allows types in mappings.
939+
* Use {@link #putTemplateAsync(PutIndexTemplateRequest, RequestOptions, ActionListener)}
940+
* instead which introduces a new request object without types.
933941
*/
934-
public void putTemplateAsync(PutIndexTemplateRequest putIndexTemplateRequest, RequestOptions options,
935-
ActionListener<AcknowledgedResponse> listener) {
942+
@Deprecated
943+
public void putTemplateAsync(org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest putIndexTemplateRequest,
944+
RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
945+
restHighLevelClient.performRequestAsyncAndParseEntity(putIndexTemplateRequest, IndicesRequestConverters::putTemplate, options,
946+
AcknowledgedResponse::fromXContent, listener, emptySet());
947+
}
948+
949+
950+
/**
951+
* Puts an index template using the Index Templates API.
952+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
953+
* on elastic.co</a>
954+
* @param putIndexTemplateRequest the request
955+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
956+
* @return the response
957+
* @throws IOException in case there is a problem sending the request or parsing back the response
958+
*/
959+
public AcknowledgedResponse putTemplate(
960+
PutIndexTemplateRequest putIndexTemplateRequest,
961+
RequestOptions options) throws IOException {
962+
return restHighLevelClient.performRequestAndParseEntity(putIndexTemplateRequest, IndicesRequestConverters::putTemplate, options,
963+
AcknowledgedResponse::fromXContent, emptySet());
964+
}
965+
966+
/**
967+
* Asynchronously puts an index template using the Index Templates API.
968+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
969+
* on elastic.co</a>
970+
* @param putIndexTemplateRequest the request
971+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
972+
* @param listener the listener to be notified upon request completion
973+
*/
974+
public void putTemplateAsync(PutIndexTemplateRequest putIndexTemplateRequest,
975+
RequestOptions options, ActionListener<AcknowledgedResponse> listener) {
936976
restHighLevelClient.performRequestAsyncAndParseEntity(putIndexTemplateRequest, IndicesRequestConverters::putTemplate, options,
937977
AcknowledgedResponse::fromXContent, listener, emptySet());
938978
}
@@ -968,33 +1008,74 @@ public void validateQueryAsync(ValidateQueryRequest validateQueryRequest, Reques
9681008
}
9691009

9701010
/**
971-
* Gets index templates using the Index Templates API
1011+
* Gets index templates using the Index Templates API. The mappings will be returned in a legacy deprecated format, where the
1012+
* mapping definition is nested under the type name.
9721013
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
9731014
* on elastic.co</a>
9741015
* @param getIndexTemplatesRequest the request
9751016
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
9761017
* @return the response
9771018
* @throws IOException in case there is a problem sending the request or parsing back the response
1019+
* @deprecated This method uses an old response object which still refers to types, a deprecated feature. Use
1020+
* {@link #getIndexTemplate(GetIndexTemplatesRequest, RequestOptions)} instead which returns a new response object
9781021
*/
979-
public GetIndexTemplatesResponse getTemplate(GetIndexTemplatesRequest getIndexTemplatesRequest,
980-
RequestOptions options) throws IOException {
981-
return restHighLevelClient.performRequestAndParseEntity(getIndexTemplatesRequest, IndicesRequestConverters::getTemplates,
982-
options, GetIndexTemplatesResponse::fromXContent, emptySet());
1022+
@Deprecated
1023+
public org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse getTemplate(
1024+
GetIndexTemplatesRequest getIndexTemplatesRequest, RequestOptions options) throws IOException {
1025+
return restHighLevelClient.performRequestAndParseEntity(getIndexTemplatesRequest,
1026+
IndicesRequestConverters::getTemplatesWithDocumentTypes,
1027+
options, org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse::fromXContent, emptySet());
9831028
}
1029+
1030+
/**
1031+
* Gets index templates using the Index Templates API
1032+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
1033+
* on elastic.co</a>
1034+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1035+
* @param getIndexTemplatesRequest the request
1036+
* @return the response
1037+
* @throws IOException in case there is a problem sending the request or parsing back the response
1038+
*/
1039+
public GetIndexTemplatesResponse getIndexTemplate(GetIndexTemplatesRequest getIndexTemplatesRequest, RequestOptions options)
1040+
throws IOException {
1041+
return restHighLevelClient.performRequestAndParseEntity(getIndexTemplatesRequest,
1042+
IndicesRequestConverters::getTemplates,
1043+
options, GetIndexTemplatesResponse::fromXContent, emptySet());
1044+
}
9841045

9851046
/**
986-
* Asynchronously gets index templates using the Index Templates API
1047+
* Asynchronously gets index templates using the Index Templates API. The mappings will be returned in a legacy deprecated format,
1048+
* where the mapping definition is nested under the type name.
9871049
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
9881050
* on elastic.co</a>
9891051
* @param getIndexTemplatesRequest the request
9901052
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
9911053
* @param listener the listener to be notified upon request completion
1054+
* @deprecated This method uses an old response object which still refers to types, a deprecated feature. Use
1055+
* {@link #getIndexTemplateAsync(GetIndexTemplatesRequest, RequestOptions, ActionListener)} instead which returns a new response object
9921056
*/
1057+
@Deprecated
9931058
public void getTemplateAsync(GetIndexTemplatesRequest getIndexTemplatesRequest, RequestOptions options,
1059+
ActionListener<org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse> listener) {
1060+
restHighLevelClient.performRequestAsyncAndParseEntity(getIndexTemplatesRequest,
1061+
IndicesRequestConverters::getTemplatesWithDocumentTypes,
1062+
options, org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse::fromXContent, listener, emptySet());
1063+
}
1064+
1065+
/**
1066+
* Asynchronously gets index templates using the Index Templates API
1067+
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html"> Index Templates API
1068+
* on elastic.co</a>
1069+
* @param getIndexTemplatesRequest the request
1070+
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
1071+
* @param listener the listener to be notified upon request completion
1072+
*/
1073+
public void getIndexTemplateAsync(GetIndexTemplatesRequest getIndexTemplatesRequest, RequestOptions options,
9941074
ActionListener<GetIndexTemplatesResponse> listener) {
995-
restHighLevelClient.performRequestAsyncAndParseEntity(getIndexTemplatesRequest, IndicesRequestConverters::getTemplates,
1075+
restHighLevelClient.performRequestAsyncAndParseEntity(getIndexTemplatesRequest,
1076+
IndicesRequestConverters::getTemplates,
9961077
options, GetIndexTemplatesResponse::fromXContent, listener, emptySet());
997-
}
1078+
}
9981079

9991080
/**
10001081
* Uses the Index Templates API to determine if index templates exist

0 commit comments

Comments
 (0)