Skip to content

Commit 5960eed

Browse files
committed
Merge branch 'master' into feature/extensible-values-source
Conflicts: server/src/test/java/org/elasticsearch/search/aggregations/bucket/missing/MissingAggregatorTests.java x-pack/plugin/analytics/src/main/java/org/elasticsearch/xpack/analytics/topmetrics/TopMetricsAggregatorFactory.java
2 parents 6636402 + 800ba31 commit 5960eed

File tree

323 files changed

+11727
-2493
lines changed

Some content is hidden

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

323 files changed

+11727
-2493
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ IntelliJ or Eclipse like describe above to use
171171
Elasticsearch typically uses singular nouns rather than plurals in URLs.
172172
For example:
173173

174-
/_ingest/pipline
175-
/_ingest/pipline/{id}
174+
/_ingest/pipeline
175+
/_ingest/pipeline/{id}
176176

177177
but not:
178178

179-
/_ingest/piplines
180-
/_ingest/piplines/{id}
179+
/_ingest/pipelines
180+
/_ingest/pipelines/{id}
181181

182182
You may find counterexamples, but new endpoints should use the singular
183183
form.

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ subprojects {
117117
':qa:os',
118118
':qa:wildfly',
119119
':x-pack:plugin:autoscaling',
120-
':x-pack:plugin:enrich'
120+
':x-pack:plugin:enrich',
121+
':x-pack:plugin:logstash'
121122
]
122123

123124
if (projectPathsToFormat.contains(project.path)) {
@@ -220,8 +221,8 @@ task verifyVersions {
220221
* after the backport of the backcompat code is complete.
221222
*/
222223

223-
boolean bwc_tests_enabled = true
224-
final String bwc_tests_disabled_issue = "" /* place a PR link here when committing bwc changes */
224+
boolean bwc_tests_enabled = false
225+
final String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/issues/53477" /* place a PR link here when committing bwc changes */
225226
if (bwc_tests_enabled == false) {
226227
if (bwc_tests_disabled_issue.isEmpty()) {
227228
throw new GradleException("bwc_tests_disabled_issue must be set when bwc_tests_enabled == false")

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

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,21 @@ private void setupRootDownload(Project rootProject, ElasticsearchDistribution di
174174
}
175175

176176
private static void addIvyRepo(Project project, String name, String url, String group) {
177-
project.getRepositories().ivy(ivyRepo -> {
178-
ivyRepo.setName(name);
179-
ivyRepo.setUrl(url);
180-
ivyRepo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
177+
IvyArtifactRepository ivyRepo = project.getRepositories().ivy(repo -> {
178+
repo.setName(name);
179+
repo.setUrl(url);
180+
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
181181
// this header is not a credential but we hack the capability to send this header to avoid polluting our download stats
182-
ivyRepo.credentials(HttpHeaderCredentials.class, creds -> {
182+
repo.credentials(HttpHeaderCredentials.class, creds -> {
183183
creds.setName("X-Elastic-No-KPI");
184184
creds.setValue("1");
185185
});
186-
ivyRepo.getAuthentication().create("header", HttpHeaderAuthentication.class);
187-
ivyRepo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
188-
ivyRepo.content(content -> content.includeGroup(group));
186+
repo.getAuthentication().create("header", HttpHeaderAuthentication.class);
187+
repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
189188
});
190-
project.getRepositories().all(repo -> {
191-
if (repo.getName().equals(name) == false) {
192-
// all other repos should ignore the special group name
193-
repo.content(content -> content.excludeGroup(group));
194-
}
189+
project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
190+
exclusiveContentRepository.filter(config -> config.includeGroup(group));
191+
exclusiveContentRepository.forRepositories(ivyRepo);
195192
});
196193
}
197194

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

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ public void apply(Project project) {
7979
setupRootJdkDownload(project.getRootProject(), jdk);
8080
}
8181
});
82-
83-
// all other repos should ignore the special jdk artifacts
84-
project.getRootProject().getRepositories().all(repo -> {
85-
if (repo.getName().startsWith(REPO_NAME_PREFIX) == false) {
86-
repo.content(content -> {
87-
content.excludeGroup("adoptopenjdk");
88-
content.excludeGroup("openjdk");
89-
});
90-
}
91-
});
9282
}
9383

9484
@SuppressWarnings("unchecked")
@@ -145,13 +135,16 @@ private static void setupRootJdkDownload(Project rootProject, Jdk jdk) {
145135
}
146136

147137
// Define the repository if we haven't already
148-
if (rootProject.getRepositories().findByName(repoName) == null) {
149-
repositories.ivy(ivyRepo -> {
150-
ivyRepo.setName(repoName);
151-
ivyRepo.setUrl(repoUrl);
152-
ivyRepo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
153-
ivyRepo.patternLayout(layout -> layout.artifact(artifactPattern));
154-
ivyRepo.content(content -> content.includeGroup(jdk.getVendor()));
138+
if (repositories.findByName(repoName) == null) {
139+
IvyArtifactRepository ivyRepo = repositories.ivy(repo -> {
140+
repo.setName(repoName);
141+
repo.setUrl(repoUrl);
142+
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
143+
repo.patternLayout(layout -> layout.artifact(artifactPattern));
144+
});
145+
repositories.exclusiveContent(exclusiveContentRepository -> {
146+
exclusiveContentRepository.filter(config -> config.includeGroup(jdk.getVendor()));
147+
exclusiveContentRepository.forRepositories(ivyRepo);
155148
});
156149
}
157150

buildSrc/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
elasticsearch = 8.0.0
2-
lucene = 8.5.0-snapshot-c4475920b08
2+
lucene = 8.5.0-snapshot-7f057455901
33

44
bundled_jdk_vendor = adoptopenjdk
55
bundled_jdk = 13.0.2+8

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
import org.elasticsearch.common.xcontent.ObjectParser;
2525
import org.elasticsearch.common.xcontent.ToXContent;
2626
import org.elasticsearch.common.xcontent.XContentBuilder;
27-
import org.elasticsearch.common.xcontent.XContentParser;
2827
import org.elasticsearch.common.xcontent.XContentParserUtils;
2928
import org.elasticsearch.search.aggregations.ParsedAggregation;
3029

3130
import java.io.IOException;
32-
import java.util.HashMap;
3331
import java.util.List;
3432
import java.util.Map;
3533

@@ -88,9 +86,9 @@ public static class TopMetrics implements ToXContent {
8886
private static final ParseField METRICS_FIELD = new ParseField("metrics");
8987

9088
private final List<Object> sort;
91-
private final Map<String, Double> metrics;
89+
private final Map<String, Object> metrics;
9290

93-
private TopMetrics(List<Object> sort, Map<String, Double> metrics) {
91+
private TopMetrics(List<Object> sort, Map<String, Object> metrics) {
9492
this.sort = sort;
9593
this.metrics = metrics;
9694
}
@@ -105,7 +103,7 @@ public List<Object> getSort() {
105103
/**
106104
* The top metric values returned by the aggregation.
107105
*/
108-
public Map<String, Double> getMetrics() {
106+
public Map<String, Object> getMetrics() {
109107
return metrics;
110108
}
111109

@@ -114,13 +112,13 @@ public Map<String, Double> getMetrics() {
114112
@SuppressWarnings("unchecked")
115113
List<Object> sort = (List<Object>) args[0];
116114
@SuppressWarnings("unchecked")
117-
Map<String, Double> metrics = (Map<String, Double>) args[1];
115+
Map<String, Object> metrics = (Map<String, Object>) args[1];
118116
return new TopMetrics(sort, metrics);
119117
});
120118
static {
121119
PARSER.declareFieldArray(constructorArg(), (p, c) -> XContentParserUtils.parseFieldsValue(p),
122120
SORT_FIELD, ObjectParser.ValueType.VALUE_ARRAY);
123-
PARSER.declareObject(constructorArg(), (p, c) -> p.map(HashMap::new, XContentParser::doubleValue), METRICS_FIELD);
121+
PARSER.declareObject(constructorArg(), (p, c) -> p.map(), METRICS_FIELD);
124122
}
125123

126124
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Classification.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static Builder builder(String dependentVariable) {
4444
static final ParseField LAMBDA = new ParseField("lambda");
4545
static final ParseField GAMMA = new ParseField("gamma");
4646
static final ParseField ETA = new ParseField("eta");
47-
static final ParseField MAXIMUM_NUMBER_TREES = new ParseField("maximum_number_trees");
47+
static final ParseField MAX_TREES = new ParseField("max_trees");
4848
static final ParseField FEATURE_BAG_FRACTION = new ParseField("feature_bag_fraction");
4949
static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values");
5050
static final ParseField PREDICTION_FIELD_NAME = new ParseField("prediction_field_name");
@@ -74,7 +74,7 @@ public static Builder builder(String dependentVariable) {
7474
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), LAMBDA);
7575
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), GAMMA);
7676
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), ETA);
77-
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), MAXIMUM_NUMBER_TREES);
77+
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), MAX_TREES);
7878
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), FEATURE_BAG_FRACTION);
7979
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), NUM_TOP_FEATURE_IMPORTANCE_VALUES);
8080
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), PREDICTION_FIELD_NAME);
@@ -87,7 +87,7 @@ public static Builder builder(String dependentVariable) {
8787
private final Double lambda;
8888
private final Double gamma;
8989
private final Double eta;
90-
private final Integer maximumNumberTrees;
90+
private final Integer maxTrees;
9191
private final Double featureBagFraction;
9292
private final Integer numTopFeatureImportanceValues;
9393
private final String predictionFieldName;
@@ -96,14 +96,14 @@ public static Builder builder(String dependentVariable) {
9696
private final Long randomizeSeed;
9797

9898
private Classification(String dependentVariable, @Nullable Double lambda, @Nullable Double gamma, @Nullable Double eta,
99-
@Nullable Integer maximumNumberTrees, @Nullable Double featureBagFraction,
99+
@Nullable Integer maxTrees, @Nullable Double featureBagFraction,
100100
@Nullable Integer numTopFeatureImportanceValues, @Nullable String predictionFieldName,
101101
@Nullable Double trainingPercent, @Nullable Integer numTopClasses, @Nullable Long randomizeSeed) {
102102
this.dependentVariable = Objects.requireNonNull(dependentVariable);
103103
this.lambda = lambda;
104104
this.gamma = gamma;
105105
this.eta = eta;
106-
this.maximumNumberTrees = maximumNumberTrees;
106+
this.maxTrees = maxTrees;
107107
this.featureBagFraction = featureBagFraction;
108108
this.numTopFeatureImportanceValues = numTopFeatureImportanceValues;
109109
this.predictionFieldName = predictionFieldName;
@@ -133,8 +133,8 @@ public Double getEta() {
133133
return eta;
134134
}
135135

136-
public Integer getMaximumNumberTrees() {
137-
return maximumNumberTrees;
136+
public Integer getMaxTrees() {
137+
return maxTrees;
138138
}
139139

140140
public Double getFeatureBagFraction() {
@@ -174,8 +174,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
174174
if (eta != null) {
175175
builder.field(ETA.getPreferredName(), eta);
176176
}
177-
if (maximumNumberTrees != null) {
178-
builder.field(MAXIMUM_NUMBER_TREES.getPreferredName(), maximumNumberTrees);
177+
if (maxTrees != null) {
178+
builder.field(MAX_TREES.getPreferredName(), maxTrees);
179179
}
180180
if (featureBagFraction != null) {
181181
builder.field(FEATURE_BAG_FRACTION.getPreferredName(), featureBagFraction);
@@ -201,7 +201,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
201201

202202
@Override
203203
public int hashCode() {
204-
return Objects.hash(dependentVariable, lambda, gamma, eta, maximumNumberTrees, featureBagFraction, numTopFeatureImportanceValues,
204+
return Objects.hash(dependentVariable, lambda, gamma, eta, maxTrees, featureBagFraction, numTopFeatureImportanceValues,
205205
predictionFieldName, trainingPercent, randomizeSeed, numTopClasses);
206206
}
207207

@@ -214,7 +214,7 @@ public boolean equals(Object o) {
214214
&& Objects.equals(lambda, that.lambda)
215215
&& Objects.equals(gamma, that.gamma)
216216
&& Objects.equals(eta, that.eta)
217-
&& Objects.equals(maximumNumberTrees, that.maximumNumberTrees)
217+
&& Objects.equals(maxTrees, that.maxTrees)
218218
&& Objects.equals(featureBagFraction, that.featureBagFraction)
219219
&& Objects.equals(numTopFeatureImportanceValues, that.numTopFeatureImportanceValues)
220220
&& Objects.equals(predictionFieldName, that.predictionFieldName)
@@ -233,7 +233,7 @@ public static class Builder {
233233
private Double lambda;
234234
private Double gamma;
235235
private Double eta;
236-
private Integer maximumNumberTrees;
236+
private Integer maxTrees;
237237
private Double featureBagFraction;
238238
private Integer numTopFeatureImportanceValues;
239239
private String predictionFieldName;
@@ -260,8 +260,8 @@ public Builder setEta(Double eta) {
260260
return this;
261261
}
262262

263-
public Builder setMaximumNumberTrees(Integer maximumNumberTrees) {
264-
this.maximumNumberTrees = maximumNumberTrees;
263+
public Builder setMaxTrees(Integer maxTrees) {
264+
this.maxTrees = maxTrees;
265265
return this;
266266
}
267267

@@ -296,7 +296,7 @@ public Builder setNumTopClasses(Integer numTopClasses) {
296296
}
297297

298298
public Classification build() {
299-
return new Classification(dependentVariable, lambda, gamma, eta, maximumNumberTrees, featureBagFraction,
299+
return new Classification(dependentVariable, lambda, gamma, eta, maxTrees, featureBagFraction,
300300
numTopFeatureImportanceValues, predictionFieldName, trainingPercent, numTopClasses, randomizeSeed);
301301
}
302302
}

client/rest-high-level/src/main/java/org/elasticsearch/client/ml/dataframe/Regression.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static Builder builder(String dependentVariable) {
4444
static final ParseField LAMBDA = new ParseField("lambda");
4545
static final ParseField GAMMA = new ParseField("gamma");
4646
static final ParseField ETA = new ParseField("eta");
47-
static final ParseField MAXIMUM_NUMBER_TREES = new ParseField("maximum_number_trees");
47+
static final ParseField MAX_TREES = new ParseField("max_trees");
4848
static final ParseField FEATURE_BAG_FRACTION = new ParseField("feature_bag_fraction");
4949
static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values");
5050
static final ParseField PREDICTION_FIELD_NAME = new ParseField("prediction_field_name");
@@ -72,7 +72,7 @@ public static Builder builder(String dependentVariable) {
7272
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), LAMBDA);
7373
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), GAMMA);
7474
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), ETA);
75-
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), MAXIMUM_NUMBER_TREES);
75+
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), MAX_TREES);
7676
PARSER.declareDouble(ConstructingObjectParser.optionalConstructorArg(), FEATURE_BAG_FRACTION);
7777
PARSER.declareInt(ConstructingObjectParser.optionalConstructorArg(), NUM_TOP_FEATURE_IMPORTANCE_VALUES);
7878
PARSER.declareString(ConstructingObjectParser.optionalConstructorArg(), PREDICTION_FIELD_NAME);
@@ -84,22 +84,22 @@ public static Builder builder(String dependentVariable) {
8484
private final Double lambda;
8585
private final Double gamma;
8686
private final Double eta;
87-
private final Integer maximumNumberTrees;
87+
private final Integer maxTrees;
8888
private final Double featureBagFraction;
8989
private final Integer numTopFeatureImportanceValues;
9090
private final String predictionFieldName;
9191
private final Double trainingPercent;
9292
private final Long randomizeSeed;
9393

9494
private Regression(String dependentVariable, @Nullable Double lambda, @Nullable Double gamma, @Nullable Double eta,
95-
@Nullable Integer maximumNumberTrees, @Nullable Double featureBagFraction,
95+
@Nullable Integer maxTrees, @Nullable Double featureBagFraction,
9696
@Nullable Integer numTopFeatureImportanceValues, @Nullable String predictionFieldName,
9797
@Nullable Double trainingPercent, @Nullable Long randomizeSeed) {
9898
this.dependentVariable = Objects.requireNonNull(dependentVariable);
9999
this.lambda = lambda;
100100
this.gamma = gamma;
101101
this.eta = eta;
102-
this.maximumNumberTrees = maximumNumberTrees;
102+
this.maxTrees = maxTrees;
103103
this.featureBagFraction = featureBagFraction;
104104
this.numTopFeatureImportanceValues = numTopFeatureImportanceValues;
105105
this.predictionFieldName = predictionFieldName;
@@ -128,8 +128,8 @@ public Double getEta() {
128128
return eta;
129129
}
130130

131-
public Integer getMaximumNumberTrees() {
132-
return maximumNumberTrees;
131+
public Integer getMaxTrees() {
132+
return maxTrees;
133133
}
134134

135135
public Double getFeatureBagFraction() {
@@ -165,8 +165,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
165165
if (eta != null) {
166166
builder.field(ETA.getPreferredName(), eta);
167167
}
168-
if (maximumNumberTrees != null) {
169-
builder.field(MAXIMUM_NUMBER_TREES.getPreferredName(), maximumNumberTrees);
168+
if (maxTrees != null) {
169+
builder.field(MAX_TREES.getPreferredName(), maxTrees);
170170
}
171171
if (featureBagFraction != null) {
172172
builder.field(FEATURE_BAG_FRACTION.getPreferredName(), featureBagFraction);
@@ -189,7 +189,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
189189

190190
@Override
191191
public int hashCode() {
192-
return Objects.hash(dependentVariable, lambda, gamma, eta, maximumNumberTrees, featureBagFraction, numTopFeatureImportanceValues,
192+
return Objects.hash(dependentVariable, lambda, gamma, eta, maxTrees, featureBagFraction, numTopFeatureImportanceValues,
193193
predictionFieldName, trainingPercent, randomizeSeed);
194194
}
195195

@@ -202,7 +202,7 @@ public boolean equals(Object o) {
202202
&& Objects.equals(lambda, that.lambda)
203203
&& Objects.equals(gamma, that.gamma)
204204
&& Objects.equals(eta, that.eta)
205-
&& Objects.equals(maximumNumberTrees, that.maximumNumberTrees)
205+
&& Objects.equals(maxTrees, that.maxTrees)
206206
&& Objects.equals(featureBagFraction, that.featureBagFraction)
207207
&& Objects.equals(numTopFeatureImportanceValues, that.numTopFeatureImportanceValues)
208208
&& Objects.equals(predictionFieldName, that.predictionFieldName)
@@ -220,7 +220,7 @@ public static class Builder {
220220
private Double lambda;
221221
private Double gamma;
222222
private Double eta;
223-
private Integer maximumNumberTrees;
223+
private Integer maxTrees;
224224
private Double featureBagFraction;
225225
private Integer numTopFeatureImportanceValues;
226226
private String predictionFieldName;
@@ -246,8 +246,8 @@ public Builder setEta(Double eta) {
246246
return this;
247247
}
248248

249-
public Builder setMaximumNumberTrees(Integer maximumNumberTrees) {
250-
this.maximumNumberTrees = maximumNumberTrees;
249+
public Builder setMaxTrees(Integer maxTrees) {
250+
this.maxTrees = maxTrees;
251251
return this;
252252
}
253253

@@ -277,7 +277,7 @@ public Builder setRandomizeSeed(Long randomizeSeed) {
277277
}
278278

279279
public Regression build() {
280-
return new Regression(dependentVariable, lambda, gamma, eta, maximumNumberTrees, featureBagFraction,
280+
return new Regression(dependentVariable, lambda, gamma, eta, maxTrees, featureBagFraction,
281281
numTopFeatureImportanceValues, predictionFieldName, trainingPercent, randomizeSeed);
282282
}
283283
}

0 commit comments

Comments
 (0)