Skip to content

Commit d86f5b2

Browse files
committed
Merge branch 'main' of https://github.com/elastic/elasticsearch into esql-reranker-boostrap
2 parents 84ff359 + 51877bb commit d86f5b2

File tree

1,476 files changed

+37621
-23699
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,476 files changed

+37621
-23699
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,8 @@ indent_size = 2
226226
[*.{xsd,xml}]
227227
indent_size = 4
228228

229+
[verification-metadata.xml]
230+
indent_size = 3
231+
229232
[*.{csv,sql}-spec]
230233
trim_trailing_whitespace = false

.gitattributes

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBasePar
1313
x-pack/plugin/esql/src/main/generated/** linguist-generated=true
1414
x-pack/plugin/esql/src/main/generated-src/** linguist-generated=true
1515

16-
# ESQL functions docs are autogenerated. More information at `docs/reference/esql/functions/README.md`
17-
docs/reference/esql/functions/*/** linguist-generated=true
16+
# ESQL functions docs are autogenerated. More information at `docs/reference/query-languages/esql/README.md`
17+
docs/reference/query-languages/esql/_snippets/functions/*/** linguist-generated=true
18+
#docs/reference/query-languages/esql/_snippets/operators/*/** linguist-generated=true
19+
docs/reference/query-languages/esql/images/** linguist-generated=true
20+
docs/reference/query-languages/esql/kibana/** linguist-generated=true
1821

Could

Whitespace-only changes.

benchmarks/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ base {
2525
archivesName = 'elasticsearch-benchmarks'
2626
}
2727

28-
tasks.named("test").configure { enabled = false }
2928
tasks.named("javadoc").configure { enabled = false }
3029

3130
configurations {
@@ -52,8 +51,10 @@ dependencies {
5251
api "org.openjdk.jmh:jmh-core:$versions.jmh"
5352
annotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
5453
// Dependencies of JMH
55-
runtimeOnly 'net.sf.jopt-simple:jopt-simple:5.0.4'
54+
runtimeOnly 'net.sf.jopt-simple:jopt-simple:5.0.2'
5655
runtimeOnly 'org.apache.commons:commons-math3:3.6.1'
56+
57+
testImplementation(project(':test:framework'))
5758
}
5859

5960
// enable the JMH's BenchmarkProcessor to generate the final benchmark classes

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

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

1212
import org.apache.lucene.util.BytesRef;
1313
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
14+
import org.elasticsearch.common.logging.LogConfigurator;
1415
import org.elasticsearch.common.settings.Settings;
1516
import org.elasticsearch.common.util.BigArrays;
1617
import org.elasticsearch.compute.data.Block;
@@ -28,6 +29,8 @@
2829
import org.elasticsearch.compute.operator.EvalOperator;
2930
import org.elasticsearch.compute.operator.Operator;
3031
import org.elasticsearch.core.TimeValue;
32+
import org.elasticsearch.logging.LogManager;
33+
import org.elasticsearch.logging.Logger;
3134
import org.elasticsearch.xpack.esql.core.expression.Expression;
3235
import org.elasticsearch.xpack.esql.core.expression.FieldAttribute;
3336
import org.elasticsearch.xpack.esql.core.expression.FoldContext;
@@ -89,9 +92,16 @@ public class EvalBenchmark {
8992
static final DriverContext driverContext = new DriverContext(BigArrays.NON_RECYCLING_INSTANCE, blockFactory);
9093

9194
static {
95+
LogConfigurator.configureESLogging();
9296
// Smoke test all the expected values and force loading subclasses more like prod
97+
selfTest();
98+
}
99+
100+
static void selfTest() {
101+
Logger log = LogManager.getLogger(EvalBenchmark.class);
93102
try {
94103
for (String operation : EvalBenchmark.class.getField("operation").getAnnotationsByType(Param.class)[0].value()) {
104+
log.info("self testing {}", operation);
95105
run(operation);
96106
}
97107
} catch (NoSuchFieldException e) {
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.benchmark.compute.operator;
11+
12+
import org.elasticsearch.test.ESTestCase;
13+
14+
public class EvalBenchmarkTests extends ESTestCase {
15+
public void testSelfTest() {
16+
EvalBenchmark.selfTest();
17+
}
18+
}

build-tools-internal/src/main/groovy/elasticsearch.bwc-test.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ plugins.withType(InternalJavaRestTestPlugin) {
4747
tasks.withType(StandaloneRestIntegTestTask).configureEach {
4848
testClassesDirs = sourceSets.javaRestTest.output.classesDirs
4949
classpath = sourceSets.javaRestTest.runtimeClasspath
50-
usesDefaultDistribution()
50+
usesDefaultDistribution("BWC tests require full distribution for now")
5151
}
5252
}
5353

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BaseInternalPluginBuildPlugin.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
import org.elasticsearch.gradle.internal.test.ClusterFeaturesMetadataPlugin;
1818
import org.elasticsearch.gradle.plugin.PluginBuildPlugin;
1919
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension;
20-
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster;
21-
import org.elasticsearch.gradle.testclusters.TestClustersPlugin;
2220
import org.elasticsearch.gradle.util.GradleUtils;
23-
import org.gradle.api.NamedDomainObjectContainer;
2421
import org.gradle.api.Plugin;
2522
import org.gradle.api.Project;
2623

@@ -81,29 +78,6 @@ public void doCall() {
8178
if (isModule == false || isXPackModule) {
8279
addNoticeGeneration(project, extension);
8380
}
84-
project.afterEvaluate(p -> {
85-
@SuppressWarnings("unchecked")
86-
NamedDomainObjectContainer<ElasticsearchCluster> testClusters = (NamedDomainObjectContainer<ElasticsearchCluster>) project
87-
.getExtensions()
88-
.getByName(TestClustersPlugin.EXTENSION_NAME);
89-
p.getExtensions().getByType(PluginPropertiesExtension.class).getExtendedPlugins().forEach(pluginName -> {
90-
// Auto add any dependent modules
91-
findModulePath(project, pluginName).ifPresent(
92-
path -> testClusters.configureEach(elasticsearchCluster -> elasticsearchCluster.module(path))
93-
);
94-
});
95-
});
96-
}
97-
98-
Optional<String> findModulePath(Project project, String pluginName) {
99-
return project.getRootProject()
100-
.getAllprojects()
101-
.stream()
102-
.filter(p -> GradleUtils.isModuleProject(p.getPath()))
103-
.filter(p -> p.getPlugins().hasPlugin(PluginBuildPlugin.class))
104-
.filter(p -> p.getExtensions().getByType(PluginPropertiesExtension.class).getName().equals(pluginName))
105-
.findFirst()
106-
.map(Project::getPath);
10781
}
10882

10983
/**

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/RestrictedBuildApiService.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
4949
map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-ec2");
5050
map.put(LegacyRestTestBasePlugin.class, ":plugins:discovery-gce");
5151
map.put(LegacyRestTestBasePlugin.class, ":plugins:mapper-annotated-text");
52-
map.put(LegacyRestTestBasePlugin.class, ":plugins:mapper-murmur3");
53-
map.put(LegacyRestTestBasePlugin.class, ":plugins:repository-hdfs");
5452
map.put(LegacyRestTestBasePlugin.class, ":plugins:store-smb");
5553
map.put(LegacyRestTestBasePlugin.class, ":qa:ccs-rolling-upgrade-remote-cluster");
5654
map.put(LegacyRestTestBasePlugin.class, ":qa:mixed-cluster");
@@ -74,11 +72,7 @@ private static ListMultimap<Class<?>, String> createLegacyRestTestBasePluginUsag
7472
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:ent-search");
7573
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:fleet");
7674
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:logstash");
77-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:mapper-constant-keyword");
78-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:mapper-unsigned-long");
79-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:mapper-version");
8075
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:vector-tile");
81-
map.put(LegacyRestTestBasePlugin.class, ":x-pack:plugin:wildcard");
8276
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:mixed-tier-cluster");
8377
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:repository-old-versions");
8478
map.put(LegacyRestTestBasePlugin.class, ":x-pack:qa:rolling-upgrade");

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rest/RestTestBasePlugin.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ public void apply(Project project) {
198198
task.getExtensions().getExtraProperties().set("usesDefaultDistribution", new Closure<Void>(task) {
199199
@Override
200200
public Void call(Object... args) {
201+
if (reasonForUsageProvided(args) == false) {
202+
throw new IllegalArgumentException(
203+
"Reason for using `usesDefaultDistribution` required.\nUse usesDefaultDistribution(\"reason why default distro is required here\")."
204+
);
205+
}
201206
task.dependsOn(defaultDistro);
202207
registerDistributionInputs(task, defaultDistro);
203208

@@ -212,6 +217,10 @@ public Void call(Object... args) {
212217

213218
return null;
214219
}
220+
221+
private static boolean reasonForUsageProvided(Object[] args) {
222+
return args.length == 1 && args[0] instanceof String && ((String) args[0]).isBlank() == false;
223+
}
215224
});
216225

217226
// Add `usesBwcDistribution(version)` extension method to test tasks to indicate they require a BWC distribution

0 commit comments

Comments
 (0)