Skip to content

Commit f5af79b

Browse files
committed
Merge branch 'master' into close-index-api-refactoring
2 parents 1959388 + 617e294 commit f5af79b

File tree

1,030 files changed

+11549
-8701
lines changed

Some content is hidden

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

1,030 files changed

+11549
-8701
lines changed

build.gradle

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,9 @@ import org.elasticsearch.gradle.Version
2424
import org.elasticsearch.gradle.VersionCollection
2525
import org.elasticsearch.gradle.VersionProperties
2626
import org.elasticsearch.gradle.plugin.PluginBuildPlugin
27-
import org.gradle.api.tasks.options.Option
28-
import org.gradle.util.GradleVersion
29-
import org.gradle.util.DistributionLocator
27+
import org.gradle.util.GradleVersion
28+
import org.gradle.util.DistributionLocator
3029
import org.gradle.plugins.ide.eclipse.model.SourceFolder
31-
import com.carrotsearch.gradle.junit4.RandomizedTestingTask
32-
33-
import java.util.function.Predicate
3430

3531
plugins {
3632
id 'com.gradle.build-scan' version '2.0.2'
@@ -433,7 +429,7 @@ tasks.idea.doLast {
433429
ideaMarker.setText('', 'UTF-8')
434430
}
435431
if (System.getProperty('idea.active') != null && ideaMarker.exists() == false) {
436-
throw new GradleException('You must run gradle idea from the root of elasticsearch before importing into IntelliJ')
432+
throw new GradleException('You must run `gradle idea` from the root of elasticsearch before importing into IntelliJ')
437433
}
438434

439435
// eclipse configuration

buildSrc/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import java.nio.file.Files
2019
import org.gradle.util.GradleVersion
2120

2221
plugins {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private static void configureCleanupHooks(Project project) {
311311
shutdownExecutorService();
312312
});
313313
// When the Daemon is not used, or runs into issues, rely on a shutdown hook
314-
// When the daemon is used, but does not work correctly and eventually dies off (e.x. due to non interruptable
314+
// When the daemon is used, but does not work correctly and eventually dies off (e.x. due to non interruptible
315315
// thread in the build) process will be stopped eventually when the daemon dies.
316316
Runtime.getRuntime().addShutdownHook(new Thread(TestClustersPlugin::shutDownAllClusters));
317317
}

buildSrc/src/main/resources/checkstyle_suppressions.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
<suppress files="server[/\\]src[/\\]main[/\\]java[/\\]org[/\\]elasticsearch[/\\]threadpool[/\\]ThreadPool.java" checks="LineLength" />
6060
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]aliases[/\\]IndexAliasesIT.java" checks="LineLength" />
6161
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]explain[/\\]ExplainActionIT.java" checks="LineLength" />
62-
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]get[/\\]GetActionIT.java" checks="LineLength" />
6362
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]indexing[/\\]IndexActionIT.java" checks="LineLength" />
6463
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]monitor[/\\]jvm[/\\]JvmGcMonitorServiceSettingsTests.java" checks="LineLength" />
6564
<suppress files="server[/\\]src[/\\]test[/\\]java[/\\]org[/\\]elasticsearch[/\\]rest[/\\]BytesRestResponseTests.java" checks="LineLength" />

buildSrc/src/main/resources/forbidden/es-server-signatures.txt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,4 @@ org.apache.logging.log4j.Logger#warn(java.lang.Object, java.lang.Throwable)
146146
org.apache.logging.log4j.Logger#error(java.lang.Object)
147147
org.apache.logging.log4j.Logger#error(java.lang.Object, java.lang.Throwable)
148148
org.apache.logging.log4j.Logger#fatal(java.lang.Object)
149-
org.apache.logging.log4j.Logger#fatal(java.lang.Object, java.lang.Throwable)
150-
151-
# Remove once Lucene 7.7 is integrated
152-
@defaultMessage Use org.apache.lucene.document.XLatLonShape classes instead
153-
org.apache.lucene.document.LatLonShape
154-
org.apache.lucene.document.LatLonShapeBoundingBoxQuery
155-
org.apache.lucene.document.LatLonShapeLineQuery
156-
org.apache.lucene.document.LatLonShapePolygonQuery
157-
org.apache.lucene.document.LatLonShapeQuery
158-
159-
org.apache.lucene.geo.Rectangle2D @ use @org.apache.lucene.geo.XRectangle2D instead
160-
161-
org.apache.lucene.geo.Tessellator @ use @org.apache.lucene.geo.XTessellator instead
149+
org.apache.logging.log4j.Logger#fatal(java.lang.Object, java.lang.Throwable)

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 7.0.0
2-
lucene = 8.0.0-snapshot-774e9aefbc
2+
lucene = 8.0.0-snapshot-a1c6e642aa
33

44
# optional dependencies
55
spatial4j = 0.7

client/rest-high-level/build.gradle

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
import org.elasticsearch.gradle.test.RestIntegTestTask
20-
import org.gradle.api.internal.provider.Providers
21-
2219
apply plugin: 'elasticsearch.build'
2320
apply plugin: 'elasticsearch.rest-test'
2421
apply plugin: 'nebula.maven-base-publish'
@@ -103,6 +100,7 @@ integTestRunner {
103100

104101
integTestCluster {
105102
systemProperty 'es.scripting.update.ctx_in_params', 'false'
103+
setting 'reindex.remote.whitelist', '"[::1]:*"'
106104
setting 'xpack.license.self_generated.type', 'trial'
107105
setting 'xpack.security.enabled', 'true'
108106
setting 'xpack.security.authc.token.enabled', 'true'

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,13 @@
158158
import org.elasticsearch.search.aggregations.metrics.ParsedTDigestPercentiles;
159159
import org.elasticsearch.search.aggregations.metrics.ParsedTopHits;
160160
import org.elasticsearch.search.aggregations.metrics.ParsedValueCount;
161+
import org.elasticsearch.search.aggregations.metrics.ParsedWeightedAvg;
161162
import org.elasticsearch.search.aggregations.metrics.ScriptedMetricAggregationBuilder;
162163
import org.elasticsearch.search.aggregations.metrics.StatsAggregationBuilder;
163164
import org.elasticsearch.search.aggregations.metrics.SumAggregationBuilder;
164165
import org.elasticsearch.search.aggregations.metrics.TopHitsAggregationBuilder;
165166
import org.elasticsearch.search.aggregations.metrics.ValueCountAggregationBuilder;
167+
import org.elasticsearch.search.aggregations.metrics.WeightedAvgAggregationBuilder;
166168
import org.elasticsearch.search.aggregations.pipeline.DerivativePipelineAggregationBuilder;
167169
import org.elasticsearch.search.aggregations.pipeline.ExtendedStatsBucketPipelineAggregationBuilder;
168170
import org.elasticsearch.search.aggregations.pipeline.InternalBucketMetricValue;
@@ -1732,6 +1734,7 @@ static List<NamedXContentRegistry.Entry> getDefaultNamedXContents() {
17321734
map.put(MaxAggregationBuilder.NAME, (p, c) -> ParsedMax.fromXContent(p, (String) c));
17331735
map.put(SumAggregationBuilder.NAME, (p, c) -> ParsedSum.fromXContent(p, (String) c));
17341736
map.put(AvgAggregationBuilder.NAME, (p, c) -> ParsedAvg.fromXContent(p, (String) c));
1737+
map.put(WeightedAvgAggregationBuilder.NAME, (p, c) -> ParsedWeightedAvg.fromXContent(p, (String) c));
17351738
map.put(ValueCountAggregationBuilder.NAME, (p, c) -> ParsedValueCount.fromXContent(p, (String) c));
17361739
map.put(InternalSimpleValue.NAME, (p, c) -> ParsedSimpleValue.fromXContent(p, (String) c));
17371740
map.put(DerivativePipelineAggregationBuilder.NAME, (p, c) -> ParsedDerivative.fromXContent(p, (String) c));

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.elasticsearch.ElasticsearchException;
2323
import org.elasticsearch.common.ParseField;
24+
import org.elasticsearch.common.collect.Tuple;
2425
import org.elasticsearch.common.xcontent.ConstructingObjectParser;
2526

2627
import java.util.AbstractMap;
@@ -38,6 +39,7 @@ public final class AutoFollowStats {
3839
new ParseField("number_of_failed_remote_cluster_state_requests");
3940
static final ParseField RECENT_AUTO_FOLLOW_ERRORS = new ParseField("recent_auto_follow_errors");
4041
static final ParseField LEADER_INDEX = new ParseField("leader_index");
42+
static final ParseField TIMESTAMP = new ParseField("timestamp");
4143
static final ParseField AUTO_FOLLOW_EXCEPTION = new ParseField("auto_follow_exception");
4244
static final ParseField AUTO_FOLLOWED_CLUSTERS = new ParseField("auto_followed_clusters");
4345
static final ParseField CLUSTER_NAME = new ParseField("cluster_name");
@@ -51,7 +53,7 @@ public final class AutoFollowStats {
5153
(Long) args[1],
5254
(Long) args[2],
5355
new TreeMap<>(
54-
((List<Map.Entry<String, ElasticsearchException>>) args[3])
56+
((List<Map.Entry<String, Tuple<Long, ElasticsearchException>>>) args[3])
5557
.stream()
5658
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue))),
5759
new TreeMap<>(
@@ -60,10 +62,10 @@ public final class AutoFollowStats {
6062
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)))
6163
));
6264

63-
private static final ConstructingObjectParser<Map.Entry<String, ElasticsearchException>, Void> AUTO_FOLLOW_EXCEPTIONS_PARSER =
65+
static final ConstructingObjectParser<Map.Entry<String, Tuple<Long, ElasticsearchException>>, Void> AUTO_FOLLOW_EXCEPTIONS_PARSER =
6466
new ConstructingObjectParser<>(
6567
"auto_follow_stats_errors",
66-
args -> new AbstractMap.SimpleEntry<>((String) args[0], (ElasticsearchException) args[1]));
68+
args -> new AbstractMap.SimpleEntry<>((String) args[0], Tuple.tuple((Long) args[1], (ElasticsearchException) args[2])));
6769

6870
private static final ConstructingObjectParser<Map.Entry<String, AutoFollowedCluster>, Void> AUTO_FOLLOWED_CLUSTERS_PARSER =
6971
new ConstructingObjectParser<>(
@@ -72,6 +74,7 @@ public final class AutoFollowStats {
7274

7375
static {
7476
AUTO_FOLLOW_EXCEPTIONS_PARSER.declareString(ConstructingObjectParser.constructorArg(), LEADER_INDEX);
77+
AUTO_FOLLOW_EXCEPTIONS_PARSER.declareLong(ConstructingObjectParser.constructorArg(), TIMESTAMP);
7578
AUTO_FOLLOW_EXCEPTIONS_PARSER.declareObject(
7679
ConstructingObjectParser.constructorArg(),
7780
(p, c) -> ElasticsearchException.fromXContent(p),
@@ -93,13 +96,13 @@ public final class AutoFollowStats {
9396
private final long numberOfFailedFollowIndices;
9497
private final long numberOfFailedRemoteClusterStateRequests;
9598
private final long numberOfSuccessfulFollowIndices;
96-
private final NavigableMap<String, ElasticsearchException> recentAutoFollowErrors;
99+
private final NavigableMap<String, Tuple<Long, ElasticsearchException>> recentAutoFollowErrors;
97100
private final NavigableMap<String, AutoFollowedCluster> autoFollowedClusters;
98101

99102
AutoFollowStats(long numberOfFailedFollowIndices,
100103
long numberOfFailedRemoteClusterStateRequests,
101104
long numberOfSuccessfulFollowIndices,
102-
NavigableMap<String, ElasticsearchException> recentAutoFollowErrors,
105+
NavigableMap<String, Tuple<Long, ElasticsearchException>> recentAutoFollowErrors,
103106
NavigableMap<String, AutoFollowedCluster> autoFollowedClusters) {
104107
this.numberOfFailedFollowIndices = numberOfFailedFollowIndices;
105108
this.numberOfFailedRemoteClusterStateRequests = numberOfFailedRemoteClusterStateRequests;
@@ -120,7 +123,7 @@ public long getNumberOfSuccessfulFollowIndices() {
120123
return numberOfSuccessfulFollowIndices;
121124
}
122125

123-
public NavigableMap<String, ElasticsearchException> getRecentAutoFollowErrors() {
126+
public NavigableMap<String, Tuple<Long, ElasticsearchException>> getRecentAutoFollowErrors() {
124127
return recentAutoFollowErrors;
125128
}
126129

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Licensed to Elasticsearch under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
package org.elasticsearch.client.indexlifecycle;
20+
21+
import org.elasticsearch.common.Strings;
22+
import org.elasticsearch.common.xcontent.ObjectParser;
23+
import org.elasticsearch.common.xcontent.ToXContentObject;
24+
import org.elasticsearch.common.xcontent.XContentBuilder;
25+
import org.elasticsearch.common.xcontent.XContentParser;
26+
27+
import java.io.IOException;
28+
29+
public class FreezeAction implements LifecycleAction, ToXContentObject {
30+
public static final String NAME = "freeze";
31+
32+
private static final ObjectParser<FreezeAction, Void> PARSER = new ObjectParser<>(NAME, FreezeAction::new);
33+
34+
public static FreezeAction parse(XContentParser parser) {
35+
return PARSER.apply(parser, null);
36+
}
37+
38+
public FreezeAction() {
39+
}
40+
41+
@Override
42+
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
43+
builder.startObject();
44+
builder.endObject();
45+
return builder;
46+
}
47+
48+
@Override
49+
public String getName() {
50+
return NAME;
51+
}
52+
53+
@Override
54+
public int hashCode() {
55+
return 1;
56+
}
57+
58+
@Override
59+
public boolean equals(Object obj) {
60+
if (obj == null) {
61+
return false;
62+
}
63+
if (obj.getClass() != getClass()) {
64+
return false;
65+
}
66+
return true;
67+
}
68+
69+
@Override
70+
public String toString() {
71+
return Strings.toString(this);
72+
}
73+
}

0 commit comments

Comments
 (0)