Skip to content

Commit abfb764

Browse files
committed
Merge remote-tracking branch 'elastic/master' into geoshape-doc-values
2 parents a4402b3 + 12e1bc4 commit abfb764

File tree

420 files changed

+6889
-5663
lines changed

Some content is hidden

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

420 files changed

+6889
-5663
lines changed

.ci/java-versions.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ ES_BUILD_JAVA=openjdk12
88
ES_RUNTIME_JAVA=openjdk11
99
GRADLE_TASK=build
1010

11-
11+
# Workaround for https://github.com/gradle/gradle/issues/11426
12+
OPENSHIFT_IP=0.0.0.0

build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import org.gradle.util.GradleVersion
3232
import static org.elasticsearch.gradle.tool.Boilerplate.maybeConfigure
3333

3434
plugins {
35-
id 'com.gradle.build-scan' version '2.4.2'
3635
id 'lifecycle-base'
3736
id 'elasticsearch.global-build-info'
3837
id "com.diffplug.gradle.spotless" version "3.24.2" apply false

buildSrc/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ group = 'org.elasticsearch.gradle'
2929

3030
String minimumGradleVersion = file('src/main/resources/minimumGradleVersion').text.trim()
3131
if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {
32-
throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch")
32+
throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch")
3333
}
3434

3535
if (project == rootProject) {

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ class BuildPlugin implements Plugin<Project> {
257257
rootProject.gradle.taskGraph.whenReady { TaskExecutionGraph taskGraph ->
258258
List<String> messages = []
259259
Map<Integer, List<Task>> requiredJavaVersions = (Map<Integer, List<Task>>) extraProperties.get('requiredJavaVersions')
260-
task.logger.warn(requiredJavaVersions.toString())
261260
for (Map.Entry<Integer, List<Task>> entry : requiredJavaVersions) {
262261
if (BuildParams.javaVersions.any { it.version == entry.key }) {
263262
continue

buildSrc/src/main/java/org/elasticsearch/gradle/DistributionDownloadPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private Object dependencyNotation(Project project, ElasticsearchDistribution dis
212212
}
213213

214214
if (distribution.getType() == Type.INTEG_TEST_ZIP) {
215-
return "org.elasticsearch.distribution.integ-test-zip:elasticsearch:" + distribution.getVersion();
215+
return "org.elasticsearch.distribution.integ-test-zip:elasticsearch:" + distribution.getVersion() + "@zip";
216216
}
217217

218218

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class TestClustersPlugin implements Plugin<Project> {
3838

3939
private static final String LIST_TASK_NAME = "listTestClusters";
4040
public static final String EXTENSION_NAME = "testClusters";
41+
private static final String REGISTRY_EXTENSION_NAME = "testClustersRegistry";
4142

4243
private static final Logger logger = Logging.getLogger(TestClustersPlugin.class);
4344

@@ -56,9 +57,9 @@ public void apply(Project project) {
5657
// provide a task to be able to list defined clusters.
5758
createListClustersTask(project, container);
5859

59-
if (project.getRootProject().getExtensions().findByName("testClusters") == null) {
60+
if (project.getRootProject().getExtensions().findByName(REGISTRY_EXTENSION_NAME) == null) {
6061
TestClustersRegistry registry = project.getRootProject().getExtensions()
61-
.create("testClusters", TestClustersRegistry.class);
62+
.create(REGISTRY_EXTENSION_NAME, TestClustersRegistry.class);
6263

6364
// When we know what tasks will run, we claim the clusters of those task to differentiate between clusters
6465
// that are defined in the build script and the ones that will actually be used in this invocation of gradle
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.6.4
1+
6.0.1

buildSrc/src/main/java/org/elasticsearch/gradle/info/BuildParams.java renamed to buildSrc/src/minimumRuntime/java/org/elasticsearch/gradle/info/BuildParams.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public static JavaVersion getRuntimeJavaVersion() {
8484
return value(runtimeJavaVersion);
8585
}
8686

87-
@ExecutionTime
8887
public static Boolean isInFipsJvm() {
8988
return value(inFipsJvm);
9089
}
@@ -155,6 +154,9 @@ public void reset() {
155154
.filter(f -> Modifier.isStatic(f.getModifiers()))
156155
.forEach(f -> {
157156
try {
157+
// Since we are mutating private static fields from a public static inner class we need to suppress
158+
// accessibility controls here.
159+
f.setAccessible(true);
158160
f.set(null, null);
159161
} catch (IllegalAccessException e) {
160162
throw new RuntimeException(e);

buildSrc/src/testKit/thirdPartyAudit/build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ repositories {
1616
maven {
1717
name = "local-test"
1818
url = file("sample_jars/build/testrepo")
19+
metadataSources {
20+
artifact()
21+
}
1922
}
2023
jcenter()
2124
}

buildSrc/version.properties

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jts = 1.15.0
1111
# you should also inspect that version to see if it can be advanced along with
1212
# the com.maxmind.geoip2:geoip2 dependency
1313
jackson = 2.8.11
14+
jacksondatabind = 2.8.11.4
1415
snakeyaml = 1.17
1516
icu4j = 62.1
1617
supercsv = 2.4.0

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/job/config/Detector.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
/**
3535
* Defines the fields and functions used in the analysis. A combination of <code>field_name</code>,
3636
* <code>by_field_name</code> and <code>over_field_name</code> can be used depending on the specific
37-
* function chosen. For more information see
38-
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-job-resource.html#ml-detectorconfig">configuring
39-
* detectors</a> and <a href="https://www.elastic.co/guide/en/elastic-stack-overview/current/ml-functions.html">detector functions</a>.
37+
* function chosen. For more information see the
38+
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html">create anomaly detection
39+
* jobs API</a> and <a href="https://www.elastic.co/guide/en/elastic-stack-overview/current/ml-functions.html">detector functions</a>.
4040
*/
4141
public class Detector implements ToXContentObject {
4242

distribution/packages/build.gradle

+9-13
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,8 @@ import java.util.regex.Pattern
5151
* dpkg -c path/to/elasticsearch.deb
5252
*/
5353

54-
buildscript {
55-
repositories {
56-
maven {
57-
name "gradle-plugins"
58-
url "https://plugins.gradle.org/m2/"
59-
}
60-
}
61-
dependencies {
62-
classpath 'com.netflix.nebula:gradle-ospackage-plugin:4.7.1'
63-
}
54+
plugins {
55+
id "nebula.ospackage-base" version "8.0.3"
6456
}
6557

6658
void addProcessFilesTask(String type, boolean oss, boolean jdk) {
@@ -115,10 +107,12 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
115107
arch(type == 'deb' ? 'amd64' : 'X86_64')
116108
// Follow elasticsearch's file naming convention
117109
String jdkString = jdk ? "" : "no-jdk-"
118-
archiveName "${packageName}-${project.version}-${jdkString}${archString}.${type}"
119-
120110
String prefix = "${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
121111
destinationDir = file("${prefix}/build/distributions")
112+
113+
// SystemPackagingTask overrides default archive task convention mappings, but doesn't provide a setter so we have to override the convention mapping itself
114+
conventionMapping.archiveFile = { objects.fileProperty().fileValue(file("${destinationDir}/${packageName}-${project.version}-${jdkString}${archString}.${type}")) }
115+
122116
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
123117

124118
String scripts = "${packagingFiles}/scripts"
@@ -157,7 +151,9 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) {
157151
eachFile { FileCopyDetails fcp ->
158152
String[] segments = fcp.relativePath.segments
159153
for (int i = segments.length - 2; i > 2; --i) {
160-
directory('/' + segments[0..i].join('/'), 0755)
154+
if (type == 'rpm') {
155+
directory('/' + segments[0..i].join('/'), 0755)
156+
}
161157
if (segments[-2] == 'bin' || segments[-1] == 'jspawnhelper') {
162158
fcp.mode = 0755
163159
} else {

docs/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ buildRestTests.expectedUnconvertedCandidates = [
2929
'reference/ml/anomaly-detection/apis/get-category.asciidoc',
3030
'reference/ml/anomaly-detection/apis/get-influencer.asciidoc',
3131
'reference/ml/anomaly-detection/apis/get-job-stats.asciidoc',
32+
'reference/ml/anomaly-detection/apis/get-job.asciidoc',
3233
'reference/ml/anomaly-detection/apis/get-overall-buckets.asciidoc',
3334
'reference/ml/anomaly-detection/apis/get-record.asciidoc',
3435
'reference/ml/anomaly-detection/apis/get-snapshot.asciidoc',

docs/painless/painless-lang-spec/painless-statements.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Painless also supports the `for in` syntax from Groovy:
2525

2626
[source,painless]
2727
---------------------------------------------------------
28-
for (item : list) {
28+
for (def item : list) {
2929
...
3030
}
3131
---------------------------------------------------------

docs/reference/docs/reindex.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ the reindex returned a `noop` value for `ctx.op`.
549549

550550
`version_conflicts`::
551551

552-
{integer)The number of version conflicts that reindex hit.
552+
(integer) The number of version conflicts that reindex hits.
553553

554554
`retries`::
555555

docs/reference/getting-started.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ If you have a lot of documents to index, you can submit them in batches with
283283
the {ref}/docs-bulk.html[bulk API]. Using bulk to batch document
284284
operations is significantly faster than submitting requests individually as it minimizes network roundtrips.
285285

286-
The optimal batch size depends a number of factors: the document size and complexity, the indexing and search load, and the resources available to your cluster. A good place to start is with batches of 1,000 to 5,000 documents
286+
The optimal batch size depends on a number of factors: the document size and complexity, the indexing and search load, and the resources available to your cluster. A good place to start is with batches of 1,000 to 5,000 documents
287287
and a total payload between 5MB and 15MB. From there, you can experiment
288288
to find the sweet spot.
289289

docs/reference/indices/synced-flush.asciidoc

+11-15
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Performs a synced flush on one or more indices.
1010
--------------------------------------------------
1111
POST /twitter/_flush/synced
1212
--------------------------------------------------
13-
// TEST[setup:twitter]
13+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
1414

1515

1616
[[synced-flush-api-request]]
@@ -80,7 +80,7 @@ section of the shard stats returned by the <<indices-stats,indices stats>> API:
8080
--------------------------------------------------
8181
GET /twitter/_stats?filter_path=**.commit&level=shards <1>
8282
--------------------------------------------------
83-
// TEST[s/^/PUT twitter\nPOST twitter\/_flush\/synced\n/]
83+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
8484

8585
<1> `filter_path` is used to reduce the verbosity of the response, but is entirely optional
8686

@@ -116,10 +116,7 @@ The API returns the following response:
116116
}
117117
}
118118
--------------------------------------------------
119-
// TESTRESPONSE[s/"id" : "3M3zkw2GHMo2Y4h4\/KFKCg=="/"id": $body.indices.twitter.shards.0.0.commit.id/]
120-
// TESTRESPONSE[s/"translog_uuid" : "hnOG3xFcTDeoI_kvvvOdNA"/"translog_uuid": $body.indices.twitter.shards.0.0.commit.user_data.translog_uuid/]
121-
// TESTRESPONSE[s/"history_uuid" : "XP7KDJGiS1a2fHYiFL5TXQ"/"history_uuid": $body.indices.twitter.shards.0.0.commit.user_data.history_uuid/]
122-
// TESTRESPONSE[s/"sync_id" : "AVvFY-071siAOuFGEO9P"/"sync_id": $body.indices.twitter.shards.0.0.commit.user_data.sync_id/]
119+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
123120
<1> the `sync id` marker
124121

125122
NOTE: The `sync_id` marker is removed as soon as the shard is flushed again, and
@@ -172,7 +169,7 @@ A replica shard failed to sync-flush.
172169
----
173170
POST /kimchy/_flush/synced
174171
----
175-
// TEST[s/^/PUT kimchy\n/]
172+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
176173

177174

178175
[[synced-flush-api-multi-ex]]
@@ -182,8 +179,7 @@ POST /kimchy/_flush/synced
182179
--------------------------------------------------
183180
POST /kimchy,elasticsearch/_flush/synced
184181
--------------------------------------------------
185-
// TEST[s/^/PUT elasticsearch\n/]
186-
// TEST[continued]
182+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
187183

188184

189185
[[synced-flush-api-all-ex]]
@@ -193,7 +189,7 @@ POST /kimchy,elasticsearch/_flush/synced
193189
--------------------------------------------------
194190
POST /_flush/synced
195191
--------------------------------------------------
196-
// TEST[setup:twitter]
192+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
197193

198194
The response contains details about how many shards were successfully
199195
sync-flushed and information about any failure.
@@ -217,12 +213,12 @@ successfully sync-flushed:
217213
}
218214
}
219215
--------------------------------------------------
220-
// TESTRESPONSE[s/"successful": 2/"successful": 1/]
216+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
221217

222218
The following response indicates one shard group failed
223219
due to pending operations:
224220

225-
[source,js]
221+
[source,console-result]
226222
--------------------------------------------------
227223
{
228224
"_shards": {
@@ -243,13 +239,13 @@ due to pending operations:
243239
}
244240
}
245241
--------------------------------------------------
246-
// NOTCONSOLE
242+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]
247243

248244
Sometimes the failures are specific to a shard replica. The copies that failed
249245
will not be eligible for fast recovery but those that succeeded still will be.
250246
This case is reported as follows:
251247

252-
[source,js]
248+
[source,console-result]
253249
--------------------------------------------------
254250
{
255251
"_shards": {
@@ -278,4 +274,4 @@ This case is reported as follows:
278274
}
279275
}
280276
--------------------------------------------------
281-
// NOTCONSOLE
277+
// TEST[skip: Synced flush can conflict with scheduled flushes in doc tests]

docs/reference/ingest/processors/geoip.asciidoc

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ uncompressed. The `ingest-geoip` config directory is located at `$ES_CONFIG/inge
2525
| `database_file` | no | GeoLite2-City.mmdb | The database filename in the geoip config directory. The ingest-geoip module ships with the GeoLite2-City.mmdb, GeoLite2-Country.mmdb and GeoLite2-ASN.mmdb files.
2626
| `properties` | no | [`continent_name`, `country_iso_code`, `region_iso_code`, `region_name`, `city_name`, `location`] * | Controls what properties are added to the `target_field` based on the geoip lookup.
2727
| `ignore_missing` | no | `false` | If `true` and `field` does not exist, the processor quietly exits without modifying the document
28+
| `first_only` | no | `true` | If `true` only first found geoip data will be returned, even if `field` contains array
2829
|======
2930

3031
*Depends on what is available in `database_file`:

docs/reference/ml/anomaly-detection/apis/close-job.asciidoc

+4-14
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,15 @@ results the job might have recently produced or might produce in the future.
6060
==== {api-path-parms-title}
6161

6262
`<job_id>`::
63-
(Required, string) Identifier for the {anomaly-job}. It can be a job
64-
identifier, a group name, or a wildcard expression.
63+
(Required, string)
64+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-wildcard]
6565

6666
[[ml-close-job-query-parms]]
6767
==== {api-query-parms-title}
6868

6969
`allow_no_jobs`::
70-
(Optional, boolean) Specifies what to do when the request:
71-
+
72-
--
73-
* Contains wildcard expressions and there are no jobs that match.
74-
* Contains the `_all` string or no identifiers and there are no matches.
75-
* Contains wildcard expressions and there are only partial matches.
76-
77-
The default value is `true`, which returns an empty `jobs` array
78-
when there are no matches and the subset of results when there are partial
79-
matches. If this parameter is `false`, the request returns a `404` status code
80-
when there are no matches or only partial matches.
81-
--
70+
(Optional, boolean)
71+
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-jobs]
8272

8373
`force`::
8474
(Optional, boolean) Use to close a failed job, or to forcefully close a job

docs/reference/ml/anomaly-detection/apis/datafeedresource.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ A {dfeed} resource has the following properties:
5050
`script_fields`::
5151
(object) Specifies scripts that evaluate custom expressions and returns
5252
script fields to the {dfeed}.
53-
The <<ml-detectorconfig,detector configuration objects>> in a job can contain
53+
The detector configuration objects in a job can contain
5454
functions that use these script fields.
5555
For more information, see
5656
{stack-ov}/ml-configuring-transform.html[Transforming Data With Script Fields].

docs/reference/ml/anomaly-detection/apis/delete-job.asciidoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ separated list.
3939
==== {api-path-parms-title}
4040

4141
`<job_id>`::
42-
(Required, string) Identifier for the {anomaly-job}.
42+
(Required, string)
43+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
4344

4445
[[ml-delete-job-query-parms]]
4546
==== {api-query-parms-title}

docs/reference/ml/anomaly-detection/apis/flush-job.asciidoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ opened again before analyzing further data.
3737
==== {api-path-parms-title}
3838

3939
`<job_id>`::
40-
(string) Required. Identifier for the job.
40+
(Required, string)
41+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
4142

4243
[[ml-flush-job-query-parms]]
4344
==== {api-query-parms-title}

docs/reference/ml/anomaly-detection/apis/forecast.asciidoc

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ See {stack-ov}/ml-overview.html#ml-forecasting[Forecasting the future].
2929
===============================
3030
3131
* If you use an `over_field_name` property in your job, you cannot create a
32-
forecast. For more information about this property, see <<ml-job-resource>>.
32+
forecast. For more information about this property, see <<ml-put-job>>.
3333
* The job must be open when you create a forecast. Otherwise, an error occurs.
3434
===============================
3535

3636
[[ml-forecast-path-parms]]
3737
==== {api-path-parms-title}
3838

3939
`<job_id>`::
40-
(Required, string) Identifier for the job.
40+
(Required, string)
41+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
4142

4243
[[ml-forecast-request-body]]
4344
==== {api-request-body-title}

docs/reference/ml/anomaly-detection/apis/get-bucket.asciidoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ bucket.
3636
==== {api-path-parms-title}
3737

3838
`<job_id>`::
39-
(Required, string) Identifier for the {anomaly-job}.
39+
(Required, string)
40+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
4041

4142
`<timestamp>`::
4243
(Optional, string) The timestamp of a single bucket result. If you do not

docs/reference/ml/anomaly-detection/apis/get-category.asciidoc

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ For more information about categories, see
3535
==== {api-path-parms-title}
3636

3737
`<job_id>`::
38-
(Required, string) Identifier for the {anomaly-job}.
38+
(Required, string)
39+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
3940

4041
`<category_id>`::
4142
(Optional, long) Identifier for the category. If you do not specify this

0 commit comments

Comments
 (0)