Skip to content

Commit f82e74d

Browse files
committed
Merge branch 'master' into upgrade-remote-cluster-settings
* master: Add full cluster restart base class (elastic#33577) Validate list values for settings (elastic#33503) Copy and validatie soft-deletes setting on resize (elastic#33517) Test: Fix package name SQL: Fix result column names for arithmetic functions (elastic#33500) Upgrade to latest Lucene snapshot (elastic#33505) Enable not wiping cluster settings after REST test (elastic#33575) MINOR: Remove Dead Code in SearchScript (elastic#33569) [Test] Remove duplicate method in TestShardRouting (elastic#32815) mute test on windows Update beats template to include apm-server metrics (elastic#33286) Fix typos (elastic#33499) [CCR] Delay auto follow license check (elastic#33557) [CCR] Add create_follow_index privilege (elastic#33559) Strengthen FilterRoutingTests (elastic#33149) Correctly handle PKCS#11 tokens for system keystore (elastic#33460) Remove some duplicate request conversion methods. (elastic#33538)
2 parents af2c2ae + ea3fdc9 commit f82e74d

File tree

131 files changed

+1104
-653
lines changed

Some content is hidden

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

131 files changed

+1104
-653
lines changed

buildSrc/src/main/resources/checkstyle_suppressions.xml

-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@
462462
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]ExpectedShardSizeAllocationTests.java" checks="LineLength" />
463463
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]FailedNodeRoutingTests.java" checks="LineLength" />
464464
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]FailedShardsRoutingTests.java" checks="LineLength" />
465-
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]FilterRoutingTests.java" checks="LineLength" />
466465
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]IndexBalanceTests.java" checks="LineLength" />
467466
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]NodeVersionAllocationDeciderTests.java" checks="LineLength" />
468467
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]cluster[/\\]routing[/\\]allocation[/\\]PreferLocalPrimariesToRelocatingPrimariesTests.java" checks="LineLength" />

buildSrc/version.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 7.0.0-alpha1
2-
lucene = 8.0.0-snapshot-4d78db26be
2+
lucene = 8.0.0-snapshot-66c671ea80
33

44
# optional dependencies
55
spatial4j = 0.7

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

-71
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@
9595
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
9696
import org.elasticsearch.index.reindex.ReindexRequest;
9797
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
98-
import org.elasticsearch.protocol.xpack.license.DeleteLicenseRequest;
99-
import org.elasticsearch.protocol.xpack.license.GetLicenseRequest;
100-
import org.elasticsearch.protocol.xpack.license.PutLicenseRequest;
101-
import org.elasticsearch.protocol.xpack.watcher.DeleteWatchRequest;
102-
import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest;
10398
import org.elasticsearch.rest.action.search.RestSearchAction;
10499
import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
105100
import org.elasticsearch.script.mustache.SearchTemplateRequest;
@@ -930,72 +925,6 @@ static Request deleteScript(DeleteStoredScriptRequest deleteStoredScriptRequest)
930925
return request;
931926
}
932927

933-
static Request xPackWatcherPutWatch(PutWatchRequest putWatchRequest) {
934-
String endpoint = new EndpointBuilder()
935-
.addPathPartAsIs("_xpack")
936-
.addPathPartAsIs("watcher")
937-
.addPathPartAsIs("watch")
938-
.addPathPart(putWatchRequest.getId())
939-
.build();
940-
941-
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
942-
Params params = new Params(request).withVersion(putWatchRequest.getVersion());
943-
if (putWatchRequest.isActive() == false) {
944-
params.putParam("active", "false");
945-
}
946-
ContentType contentType = createContentType(putWatchRequest.xContentType());
947-
BytesReference source = putWatchRequest.getSource();
948-
request.setEntity(new ByteArrayEntity(source.toBytesRef().bytes, 0, source.length(), contentType));
949-
return request;
950-
}
951-
952-
static Request xPackWatcherDeleteWatch(DeleteWatchRequest deleteWatchRequest) {
953-
String endpoint = new EndpointBuilder()
954-
.addPathPartAsIs("_xpack")
955-
.addPathPartAsIs("watcher")
956-
.addPathPartAsIs("watch")
957-
.addPathPart(deleteWatchRequest.getId())
958-
.build();
959-
960-
Request request = new Request(HttpDelete.METHOD_NAME, endpoint);
961-
return request;
962-
}
963-
964-
static Request putLicense(PutLicenseRequest putLicenseRequest) {
965-
String endpoint = new EndpointBuilder()
966-
.addPathPartAsIs("_xpack")
967-
.addPathPartAsIs("license")
968-
.build();
969-
Request request = new Request(HttpPut.METHOD_NAME, endpoint);
970-
Params parameters = new Params(request);
971-
parameters.withTimeout(putLicenseRequest.timeout());
972-
parameters.withMasterTimeout(putLicenseRequest.masterNodeTimeout());
973-
if (putLicenseRequest.isAcknowledge()) {
974-
parameters.putParam("acknowledge", "true");
975-
}
976-
request.setJsonEntity(putLicenseRequest.getLicenseDefinition());
977-
return request;
978-
}
979-
980-
static Request getLicense(GetLicenseRequest getLicenseRequest) {
981-
String endpoint = new EndpointBuilder()
982-
.addPathPartAsIs("_xpack")
983-
.addPathPartAsIs("license")
984-
.build();
985-
Request request = new Request(HttpGet.METHOD_NAME, endpoint);
986-
Params parameters = new Params(request);
987-
parameters.withLocal(getLicenseRequest.local());
988-
return request;
989-
}
990-
991-
static Request deleteLicense(DeleteLicenseRequest deleteLicenseRequest) {
992-
Request request = new Request(HttpDelete.METHOD_NAME, "/_xpack/license");
993-
Params parameters = new Params(request);
994-
parameters.withTimeout(deleteLicenseRequest.timeout());
995-
parameters.withMasterTimeout(deleteLicenseRequest.masterNodeTimeout());
996-
return request;
997-
}
998-
999928
static HttpEntity createEntity(ToXContent toXContent, XContentType xContentType) throws IOException {
1000929
BytesRef source = XContentHelper.toXContent(toXContent, xContentType, false).toBytesRef();
1001930
return new ByteArrayEntity(source.bytes, source.offset, source.length, createContentType(xContentType));

client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java

-44
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@
109109
import org.elasticsearch.index.reindex.ReindexRequest;
110110
import org.elasticsearch.index.reindex.RemoteInfo;
111111
import org.elasticsearch.index.reindex.UpdateByQueryRequest;
112-
import org.elasticsearch.protocol.xpack.watcher.DeleteWatchRequest;
113-
import org.elasticsearch.protocol.xpack.watcher.PutWatchRequest;
114112
import org.elasticsearch.rest.action.search.RestSearchAction;
115113
import org.elasticsearch.script.Script;
116114
import org.elasticsearch.script.ScriptType;
@@ -129,7 +127,6 @@
129127
import org.elasticsearch.test.ESTestCase;
130128
import org.elasticsearch.test.RandomObjects;
131129

132-
import java.io.ByteArrayOutputStream;
133130
import java.io.IOException;
134131
import java.io.InputStream;
135132
import java.util.ArrayList;
@@ -160,7 +157,6 @@
160157
import static org.hamcrest.CoreMatchers.equalTo;
161158
import static org.hamcrest.Matchers.hasEntry;
162159
import static org.hamcrest.Matchers.hasKey;
163-
import static org.hamcrest.Matchers.is;
164160
import static org.hamcrest.Matchers.nullValue;
165161

166162
public class RequestConvertersTests extends ESTestCase {
@@ -2212,46 +2208,6 @@ public void testEnforceSameContentType() {
22122208
+ "previous requests have content-type [" + xContentType + "]", exception.getMessage());
22132209
}
22142210

2215-
public void testXPackPutWatch() throws Exception {
2216-
PutWatchRequest putWatchRequest = new PutWatchRequest();
2217-
String watchId = randomAlphaOfLength(10);
2218-
putWatchRequest.setId(watchId);
2219-
String body = randomAlphaOfLength(20);
2220-
putWatchRequest.setSource(new BytesArray(body), XContentType.JSON);
2221-
2222-
Map<String, String> expectedParams = new HashMap<>();
2223-
if (randomBoolean()) {
2224-
putWatchRequest.setActive(false);
2225-
expectedParams.put("active", "false");
2226-
}
2227-
2228-
if (randomBoolean()) {
2229-
long version = randomLongBetween(10, 100);
2230-
putWatchRequest.setVersion(version);
2231-
expectedParams.put("version", String.valueOf(version));
2232-
}
2233-
2234-
Request request = RequestConverters.xPackWatcherPutWatch(putWatchRequest);
2235-
assertEquals(HttpPut.METHOD_NAME, request.getMethod());
2236-
assertEquals("/_xpack/watcher/watch/" + watchId, request.getEndpoint());
2237-
assertEquals(expectedParams, request.getParameters());
2238-
assertThat(request.getEntity().getContentType().getValue(), is(XContentType.JSON.mediaTypeWithoutParameters()));
2239-
ByteArrayOutputStream bos = new ByteArrayOutputStream();
2240-
request.getEntity().writeTo(bos);
2241-
assertThat(bos.toString("UTF-8"), is(body));
2242-
}
2243-
2244-
public void testXPackDeleteWatch() {
2245-
DeleteWatchRequest deleteWatchRequest = new DeleteWatchRequest();
2246-
String watchId = randomAlphaOfLength(10);
2247-
deleteWatchRequest.setId(watchId);
2248-
2249-
Request request = RequestConverters.xPackWatcherDeleteWatch(deleteWatchRequest);
2250-
assertEquals(HttpDelete.METHOD_NAME, request.getMethod());
2251-
assertEquals("/_xpack/watcher/watch/" + watchId, request.getEndpoint());
2252-
assertThat(request.getEntity(), nullValue());
2253-
}
2254-
22552211
/**
22562212
* Randomize the {@link FetchSourceContext} request parameters.
22572213
*/

client/rest-high-level/src/test/java/org/elasticsearch/client/WatcherRequestConvertersTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
public class WatcherRequestConvertersTests extends ESTestCase {
3838

39-
public void testXPackPutWatch() throws Exception {
39+
public void testPutWatch() throws Exception {
4040
PutWatchRequest putWatchRequest = new PutWatchRequest();
4141
String watchId = randomAlphaOfLength(10);
4242
putWatchRequest.setId(watchId);
@@ -65,7 +65,7 @@ public void testXPackPutWatch() throws Exception {
6565
assertThat(bos.toString("UTF-8"), is(body));
6666
}
6767

68-
public void testXPackDeleteWatch() {
68+
public void testDeleteWatch() {
6969
DeleteWatchRequest deleteWatchRequest = new DeleteWatchRequest();
7070
String watchId = randomAlphaOfLength(10);
7171
deleteWatchRequest.setId(watchId);

distribution/archives/integ-test-zip/src/test/java/org/elasticsearch/test/rest/NodeNameInLogsIT.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* under the License.
1818
*/
1919

20-
package org.elasticsearch.unconfigurednodename;
20+
package org.elasticsearch.test.rest;
2121

2222
import org.elasticsearch.common.logging.NodeNameInLogsIntegTestCase;
2323

docs/reference/setup/setup-xclient.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cluster where {xpack} is installed, then you must download and configure the
1111

1212
. Add the {xpack} transport JAR file to your *CLASSPATH*. You can download the {xpack}
1313
distribution and extract the JAR file manually or you can get it from the
14-
https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/{version}/x-pack-transport-{version}.jar[Elasticsearch Maven repository].
14+
https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/{version}/x-pack-transport-{version}.jar[Elasticsearc Maven repository].
1515
As with any dependency, you will also need its transitive dependencies. Refer to the
1616
https://artifacts.elastic.co/maven/org/elasticsearch/client/x-pack-transport/{version}/x-pack-transport-{version}.pom[X-Pack POM file
1717
for your version] when downloading for offline usage.

docs/reference/upgrade/set-paths-tip.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
================================================
33
44
When you extract the zip or tarball packages, the `elasticsearch-n.n.n`
5-
directory contains the Elasticsearch `config`, `data`, `logs` and
5+
directory contains the Elasticsearh `config`, `data`, `logs` and
66
`plugins` directories.
77
88
We recommend moving these directories out of the Elasticsearch directory

modules/lang-expression/licenses/lucene-expressions-8.0.0-snapshot-4d78db26be.jar.sha1

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
58b9db095c569b4c4da491810f14e1429878b594

modules/lang-expression/src/main/java/org/elasticsearch/script/expression/ExpressionScriptEngine.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.apache.lucene.index.LeafReaderContext;
2727
import org.apache.lucene.queries.function.ValueSource;
2828
import org.apache.lucene.queries.function.valuesource.DoubleConstValueSource;
29-
import org.apache.lucene.search.Scorer;
29+
import org.apache.lucene.search.Scorable;
3030
import org.apache.lucene.search.SortField;
3131
import org.elasticsearch.SpecialPermission;
3232
import org.elasticsearch.common.Nullable;
@@ -336,7 +336,7 @@ public void setDocument(int docid) {
336336
}
337337

338338
@Override
339-
public void setScorer(Scorer scorer) {
339+
public void setScorer(Scorable scorer) {
340340
script.setScorer(scorer);
341341
}
342342

modules/lang-painless/src/test/java/org/elasticsearch/painless/ScoreTests.java

+5-29
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,25 @@
1919

2020
package org.elasticsearch.painless;
2121

22-
import org.apache.lucene.search.DocIdSetIterator;
23-
import org.apache.lucene.search.Scorer;
22+
import org.apache.lucene.search.Scorable;
2423

25-
import java.io.IOException;
2624
import java.util.Collections;
2725

2826
public class ScoreTests extends ScriptTestCase {
2927

3028
/** Most of a dummy scorer impl that requires overriding just score(). */
31-
abstract class MockScorer extends Scorer {
32-
MockScorer() {
33-
super(null);
34-
}
29+
abstract class MockScorer extends Scorable {
3530
@Override
3631
public int docID() {
3732
return 0;
3833
}
39-
@Override
40-
public DocIdSetIterator iterator() {
41-
throw new UnsupportedOperationException();
42-
}
4334
}
4435

4536
public void testScoreWorks() {
4637
assertEquals(2.5, exec("_score", Collections.emptyMap(), Collections.emptyMap(),
4738
new MockScorer() {
4839
@Override
49-
public float score() throws IOException {
50-
return 2.5f;
51-
}
52-
53-
@Override
54-
public float getMaxScore(int upTo) throws IOException {
40+
public float score() {
5541
return 2.5f;
5642
}
5743
},
@@ -62,14 +48,9 @@ public void testScoreNotUsed() {
6248
assertEquals(3.5, exec("3.5", Collections.emptyMap(), Collections.emptyMap(),
6349
new MockScorer() {
6450
@Override
65-
public float score() throws IOException {
51+
public float score() {
6652
throw new AssertionError("score() should not be called");
6753
}
68-
69-
@Override
70-
public float getMaxScore(int upTo) throws IOException {
71-
return Float.MAX_VALUE;
72-
}
7354
},
7455
true));
7556
}
@@ -79,17 +60,12 @@ public void testScoreCached() {
7960
new MockScorer() {
8061
private boolean used = false;
8162
@Override
82-
public float score() throws IOException {
63+
public float score() {
8364
if (used == false) {
8465
return 4.5f;
8566
}
8667
throw new AssertionError("score() should not be called twice");
8768
}
88-
89-
@Override
90-
public float getMaxScore(int upTo) throws IOException {
91-
return 4.5f;
92-
}
9369
},
9470
true));
9571
}

modules/lang-painless/src/test/java/org/elasticsearch/painless/ScriptTestCase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
package org.elasticsearch.painless;
2121

2222
import junit.framework.AssertionFailedError;
23-
import org.apache.lucene.search.Scorer;
23+
import org.apache.lucene.search.Scorable;
2424
import org.elasticsearch.common.lucene.ScorerAware;
2525
import org.elasticsearch.common.settings.Settings;
2626
import org.elasticsearch.painless.antlr.Walker;
@@ -91,7 +91,7 @@ public Object exec(String script, Map<String, Object> vars, boolean picky) {
9191
}
9292

9393
/** Compiles and returns the result of {@code script} with access to {@code vars} and compile-time parameters */
94-
public Object exec(String script, Map<String, Object> vars, Map<String,String> compileParams, Scorer scorer, boolean picky) {
94+
public Object exec(String script, Map<String, Object> vars, Map<String,String> compileParams, Scorable scorer, boolean picky) {
9595
// test for ambiguity errors before running the actual script if picky is true
9696
if (picky) {
9797
ScriptClassInfo scriptClassInfo = new ScriptClassInfo(PAINLESS_LOOKUP, GenericElasticsearchScript.class);

modules/lang-painless/src/test/java/org/elasticsearch/painless/ScriptedMetricAggContextsTests.java

+2-12
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@
1919

2020
package org.elasticsearch.painless;
2121

22-
import org.apache.lucene.search.DocIdSetIterator;
23-
import org.apache.lucene.search.Scorer;
22+
import org.apache.lucene.search.Scorable;
2423
import org.elasticsearch.painless.spi.Whitelist;
2524
import org.elasticsearch.script.ScriptContext;
2625
import org.elasticsearch.script.ScriptedMetricAggContexts;
2726

28-
import java.io.IOException;
2927
import java.util.ArrayList;
3028
import java.util.Collections;
3129
import java.util.HashMap;
@@ -66,20 +64,12 @@ public void testMapBasic() {
6664
Map<String, Object> params = new HashMap<>();
6765
Map<String, Object> state = new HashMap<>();
6866

69-
Scorer scorer = new Scorer(null) {
67+
Scorable scorer = new Scorable() {
7068
@Override
7169
public int docID() { return 0; }
7270

7371
@Override
7472
public float score() { return 0.5f; }
75-
76-
@Override
77-
public DocIdSetIterator iterator() { return null; }
78-
79-
@Override
80-
public float getMaxScore(int upTo) throws IOException {
81-
return 0.5f;
82-
}
8373
};
8474

8575
ScriptedMetricAggContexts.MapScript.LeafFactory leafFactory = factory.newFactory(params, state, null);

0 commit comments

Comments
 (0)