Skip to content

Commit eb9618f

Browse files
committed
Merge remote-tracking branch 'es/7.x' into enrich-7.x
2 parents 6af17e4 + 1a6ffb2 commit eb9618f

File tree

351 files changed

+5437
-3166
lines changed

Some content is hidden

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

351 files changed

+5437
-3166
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/plugin/PluginBuildPlugin.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class PluginBuildPlugin extends BuildPlugin {
8989
project.extensions.getByType(PluginPropertiesExtension).extendedPlugins.each { pluginName ->
9090
// Auto add dependent modules to the test cluster
9191
if (project.findProject(":modules:${pluginName}") != null) {
92+
project.integTest.dependsOn(project.project(":modules:${pluginName}").tasks.bundlePlugin)
9293
project.testClusters.integTest.module(
9394
project.file(project.project(":modules:${pluginName}").tasks.bundlePlugin.archiveFile)
9495
)

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,6 @@ class ClusterFormationTasks {
964964
}
965965
doLast {
966966
project.delete(node.pidFile)
967-
// Large tests can exhaust disk space, clean up on stop, but leave the data dir as some tests reuse it
968-
project.delete(project.fileTree(node.baseDir).minus(project.fileTree(node.dataDir)))
969967
}
970968
}
971969
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ class RestIntegTestTask extends DefaultTask {
120120
if (usesTestclusters == true) {
121121
ElasticsearchCluster cluster = project.testClusters."${name}"
122122
nonInputProperties.systemProperty('tests.rest.cluster', "${-> cluster.allHttpSocketURI.join(",") }")
123-
nonInputProperties.systemProperty('tests.config.dir', "${-> cluster.singleNode().getConfigDir() }")
124123
nonInputProperties.systemProperty('tests.cluster', "${-> cluster.transportPortURI }")
125124
} else {
126125
// we pass all nodes to the rest cluster to allow the clients to round-robin between them
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.elasticsearch.gradle;
2+
3+
import java.io.File;
4+
import java.util.function.Supplier;
5+
6+
public interface FileSupplier extends Supplier<File> {
7+
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.elasticsearch.GradleServicesAdapter;
2222
import org.elasticsearch.gradle.Distribution;
23+
import org.elasticsearch.gradle.FileSupplier;
2324
import org.elasticsearch.gradle.Version;
2425
import org.gradle.api.NamedDomainObjectContainer;
2526
import org.gradle.api.Project;
@@ -143,6 +144,16 @@ public void keystore(String key, Supplier<CharSequence> valueSupplier) {
143144
nodes.all(each -> each.keystore(key, valueSupplier));
144145
}
145146

147+
@Override
148+
public void keystore(String key, File value) {
149+
nodes.all(each -> each.keystore(key, value));
150+
}
151+
152+
@Override
153+
public void keystore(String key, FileSupplier valueSupplier) {
154+
nodes.all(each -> each.keystore(key, valueSupplier));
155+
}
156+
146157
@Override
147158
public void setting(String key, String value) {
148159
nodes.all(each -> each.setting(key, value));

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

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import org.elasticsearch.GradleServicesAdapter;
2222
import org.elasticsearch.gradle.Distribution;
23+
import org.elasticsearch.gradle.FileSupplier;
2324
import org.elasticsearch.gradle.OS;
2425
import org.elasticsearch.gradle.Version;
2526
import org.gradle.api.logging.Logger;
@@ -63,7 +64,8 @@ public class ElasticsearchNode implements TestClusterConfiguration {
6364
private static final int NODE_UP_TIMEOUT = 60;
6465
private static final TimeUnit NODE_UP_TIMEOUT_UNIT = TimeUnit.SECONDS;
6566
private static final List<String> OVERRIDABLE_SETTINGS = Arrays.asList(
66-
"path.repo"
67+
"path.repo",
68+
"discovery.seed_providers"
6769
);
6870

6971
private final String path;
@@ -79,6 +81,7 @@ public class ElasticsearchNode implements TestClusterConfiguration {
7981
private final List<File> modules = new ArrayList<>();
8082
private final Map<String, Supplier<CharSequence>> settings = new LinkedHashMap<>();
8183
private final Map<String, Supplier<CharSequence>> keystoreSettings = new LinkedHashMap<>();
84+
private final Map<String, FileSupplier> keystoreFiles = new LinkedHashMap<>();
8285
private final Map<String, Supplier<CharSequence>> systemProperties = new LinkedHashMap<>();
8386
private final Map<String, Supplier<CharSequence>> environment = new LinkedHashMap<>();
8487
private final Map<String, File> extraConfigFiles = new HashMap<>();
@@ -171,6 +174,19 @@ public void keystore(String key, Supplier<CharSequence> valueSupplier) {
171174
addSupplier("Keystore", keystoreSettings, key, valueSupplier);
172175
}
173176

177+
@Override
178+
public void keystore(String key, File value) {
179+
requireNonNull(value, "keystore value was null when configuring test cluster`" + this + "`");
180+
keystore(key, () -> value);
181+
}
182+
183+
@Override
184+
public void keystore(String key, FileSupplier valueSupplier) {
185+
requireNonNull(key, "Keystore" + " key was null when configuring test cluster `" + this + "`");
186+
requireNonNull(valueSupplier, "Keystore" + " value supplier was null when configuring test cluster `" + this + "`");
187+
keystoreFiles.put(key, valueSupplier);
188+
}
189+
174190
@Override
175191
public void setting(String key, String value) {
176192
addSupplier("Settings", settings, key, value);
@@ -281,12 +297,22 @@ public synchronized void start() {
281297
"install", "--batch", plugin.toString())
282298
);
283299

284-
if (keystoreSettings.isEmpty() == false) {
285-
checkSuppliers("Keystore", keystoreSettings);
300+
if (keystoreSettings.isEmpty() == false || keystoreFiles.isEmpty() == false) {
286301
runElaticsearchBinScript("elasticsearch-keystore", "create");
287-
keystoreSettings.forEach((key, value) -> {
288-
runElaticsearchBinScriptWithInput(value.get().toString(), "elasticsearch-keystore", "add", "-x", key);
289-
});
302+
303+
checkSuppliers("Keystore", keystoreSettings);
304+
keystoreSettings.forEach((key, value) ->
305+
runElaticsearchBinScriptWithInput(value.get().toString(), "elasticsearch-keystore", "add", "-x", key)
306+
);
307+
308+
for (Map.Entry<String, FileSupplier> entry : keystoreFiles.entrySet()) {
309+
File file = entry.getValue().get();
310+
requireNonNull(file, "supplied keystoreFile was null when configuring " + this);
311+
if (file.exists() == false) {
312+
throw new TestClustersException("supplied keystore file " + file + " does not exist, require for " + this);
313+
}
314+
runElaticsearchBinScript("elasticsearch-keystore", "add-file", entry.getKey(), file.getAbsolutePath());
315+
}
290316
}
291317

292318
installModules();

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.elasticsearch.gradle.testclusters;
2020

2121
import org.elasticsearch.gradle.Distribution;
22+
import org.elasticsearch.gradle.FileSupplier;
2223
import org.gradle.api.logging.Logging;
2324
import org.slf4j.Logger;
2425

@@ -47,6 +48,10 @@ public interface TestClusterConfiguration {
4748

4849
void keystore(String key, Supplier<CharSequence> valueSupplier);
4950

51+
void keystore(String key, File value);
52+
53+
void keystore(String key, FileSupplier valueSupplier);
54+
5055
void setting(String key, String value);
5156

5257
void setting(String key, Supplier<CharSequence> valueSupplier);

buildSrc/version.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
elasticsearch = 7.1.0
22
lucene = 8.0.0
33

4-
bundled_jdk = 12+33
4+
bundled_jdk = 12.0.1+12@69cfe15208a647278a19ef0990eea691
55

66
# optional dependencies
77
spatial4j = 0.7
@@ -37,7 +37,7 @@ httpcore = 4.4.11
3737
httpasyncclient = 4.1.4
3838
commonslogging = 1.1.3
3939
commonscodec = 1.11
40-
hamcrest = 1.3
40+
hamcrest = 2.1
4141
securemock = 1.2
4242
mocksocket = 1.2
4343

client/rest-high-level/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ dependencies {
6161
testCompile "org.elasticsearch.test:framework:${version}"
6262
testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
6363
testCompile "junit:junit:${versions.junit}"
64-
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"
6564
//this is needed to make RestHighLevelClientTests#testApiNamingConventions work from IDEs
6665
testCompile "org.elasticsearch:rest-api-spec:${version}"
6766
// Needed for serialization tests:

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

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public final class DataFrameClient {
4949
* Creates a new Data Frame Transform
5050
* <p>
5151
* For additional info
52-
* see <a href="https://www.TODO.com">Data Frame PUT transform documentation</a>
52+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html">
53+
* Create data frame transform documentation</a>
5354
*
5455
* @param request The PutDataFrameTransformRequest containing the
5556
* {@link org.elasticsearch.client.dataframe.transforms.DataFrameTransformConfig}.
@@ -69,7 +70,8 @@ public AcknowledgedResponse putDataFrameTransform(PutDataFrameTransformRequest r
6970
* Creates a new Data Frame Transform asynchronously and notifies listener on completion
7071
* <p>
7172
* For additional info
72-
* see <a href="https://www.TODO.com">Data Frame PUT transform documentation</a>
73+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/put-data-frame-transform.html">
74+
* Create data frame transform documentation</a>
7375
*
7476
* @param request The PutDataFrameTransformRequest containing the
7577
* {@link org.elasticsearch.client.dataframe.transforms.DataFrameTransformConfig}.
@@ -90,7 +92,8 @@ public void putDataFrameTransformAsync(PutDataFrameTransformRequest request, Req
9092
* Get the running statistics of a Data Frame Transform
9193
* <p>
9294
* For additional info
93-
* see <a href="https://www.TODO.com">Get Data Frame transform stats documentation</a>
95+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html">
96+
* Get data frame transform stats documentation</a>
9497
*
9598
* @param request Specifies the which transforms to get the stats for
9699
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -110,7 +113,8 @@ public GetDataFrameTransformStatsResponse getDataFrameTransformStats(GetDataFram
110113
* Get the running statistics of a Data Frame Transform asynchronously and notifies listener on completion
111114
* <p>
112115
* For additional info
113-
* see <a href="https://www.TODO.com">Get Data Frame transform stats documentation</a>
116+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform-stats.html">
117+
* Get data frame transform stats documentation</a>
114118
*
115119
* @param request Specifies the which transforms to get the stats for
116120
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -130,7 +134,8 @@ public void getDataFrameTransformStatsAsync(GetDataFrameTransformStatsRequest re
130134
* Delete a data frame transform
131135
* <p>
132136
* For additional info
133-
* see <a href="https://www.TODO.com">Data Frame delete transform documentation</a>
137+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html">
138+
* Delete data frame transform documentation</a>
134139
*
135140
* @param request The delete data frame transform request
136141
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -150,7 +155,8 @@ public AcknowledgedResponse deleteDataFrameTransform(DeleteDataFrameTransformReq
150155
* Delete a data frame transform asynchronously and notifies listener on completion
151156
* <p>
152157
* For additional info
153-
* see <a href="https://www.TODO.com">Data Frame delete transform documentation</a>
158+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-data-frame-transform.html">
159+
* Delete data frame transform documentation</a>
154160
*
155161
* @param request The delete data frame transform request
156162
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -170,7 +176,8 @@ public void deleteDataFrameTransformAsync(DeleteDataFrameTransformRequest reques
170176
* Preview the result of a data frame transform
171177
* <p>
172178
* For additional info
173-
* see <a href="https://www.TODO.com">Preview Data Frame transform documentation</a>
179+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html">
180+
* Preview data frame transform documentation</a>
174181
*
175182
* @param request The preview data frame transform request
176183
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -189,8 +196,8 @@ public PreviewDataFrameTransformResponse previewDataFrameTransform(PreviewDataFr
189196
/**
190197
* Preview the result of a data frame transform asynchronously and notifies listener on completion
191198
* <p>
192-
* For additional info
193-
* see <a href="https://www.TODO.com">Preview Data Frame transform documentation</a>
199+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-data-frame-transform.html">
200+
* Preview data frame transform documentation</a>
194201
*
195202
* @param request The preview data frame transform request
196203
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -210,7 +217,8 @@ public void previewDataFrameTransformAsync(PreviewDataFrameTransformRequest requ
210217
* Start a data frame transform
211218
* <p>
212219
* For additional info
213-
* see <a href="https://www.TODO.com">Start Data Frame transform documentation</a>
220+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html">
221+
* Start data frame transform documentation</a>
214222
*
215223
* @param request The start data frame transform request
216224
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -230,7 +238,8 @@ public StartDataFrameTransformResponse startDataFrameTransform(StartDataFrameTra
230238
* Start a data frame transform asynchronously and notifies listener on completion
231239
* <p>
232240
* For additional info
233-
* see <a href="https://www.TODO.com">Start Data Frame transform documentation</a>
241+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/start-data-frame-transform.html">
242+
* Start data frame transform documentation</a>
234243
*
235244
* @param request The start data frame transform request
236245
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -250,7 +259,8 @@ public void startDataFrameTransformAsync(StartDataFrameTransformRequest request,
250259
* Stop a data frame transform
251260
* <p>
252261
* For additional info
253-
* see <a href="https://www.TODO.com">Stop Data Frame transform documentation</a>
262+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html">
263+
* Stop data frame transform documentation</a>
254264
*
255265
* @param request The stop data frame transform request
256266
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -270,7 +280,8 @@ public StopDataFrameTransformResponse stopDataFrameTransform(StopDataFrameTransf
270280
* Stop a data frame transform asynchronously and notifies listener on completion
271281
* <p>
272282
* For additional info
273-
* see <a href="https://www.TODO.com">Stop Data Frame transform documentation</a>
283+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-data-frame-transform.html">
284+
* Stop data frame transform documentation</a>
274285
*
275286
* @param request The stop data frame transform request
276287
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -290,7 +301,8 @@ public void stopDataFrameTransformAsync(StopDataFrameTransformRequest request, R
290301
* Get one or more data frame transform configurations
291302
* <p>
292303
* For additional info
293-
* see <a href="https://www.TODO.com">Get Data Frame transform documentation</a>
304+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html">
305+
* Get data frame transform documentation</a>
294306
*
295307
* @param request The get data frame transform request
296308
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
@@ -310,7 +322,8 @@ public GetDataFrameTransformResponse getDataFrameTransform(GetDataFrameTransform
310322
* Get one or more data frame transform configurations asynchronously and notifies listener on completion
311323
* <p>
312324
* For additional info
313-
* see <a href="https://www.TODO.com">Get Data Frame transform documentation</a>
325+
* see <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/get-data-frame-transform.html">
326+
* Get data frame transform documentation</a>
314327
*
315328
* @param request The get data frame transform request
316329
* @param options Additional request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ public SecurityClient security() {
472472
* are shipped with the Elastic Stack distribution of Elasticsearch. All of
473473
* these APIs will 404 if run against the OSS distribution of Elasticsearch.
474474
* <p>
475-
* See the <a href="TODO">Data Frame APIs on elastic.co</a> for more information.
475+
* See the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/data-frame-apis.html">
476+
* Data Frame APIs on elastic.co</a> for more information.
476477
*
477478
* @return the client wrapper for making Data Frame API calls
478479
*/

0 commit comments

Comments
 (0)