Skip to content

Commit 59bc719

Browse files
Merge branch 'main' of github.com:elastic/elasticsearch into ml-fix-ccm-restart-bug
2 parents 16f3cee + c2286e1 commit 59bc719

File tree

535 files changed

+16121
-4767
lines changed

Some content is hidden

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

535 files changed

+16121
-4767
lines changed

BUILDING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ similar to how the Gradle build-in `java-test-fixtures` plugin works.
239239
```
240240
dependencies {
241241
testImplementation(project(":fixture-providing-project')) {
242-
requireCapabilities("org.elasticsearch.gradle:fixture-providing-project-test-artifacts")
242+
requireCapabilities(${project(":fixture-providing-project').group}:fixture-providing-project-test-artifacts")
243243
}
244244
}
245245
```

benchmarks/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ dependencies {
4848
api(project(':x-pack:plugin:esql'))
4949
api(project(':x-pack:plugin:esql:compute'))
5050
api(project(':x-pack:plugin:mapper-exponential-histogram'))
51+
api(project(':x-pack:plugin:logsdb'))
5152
implementation project(path: ':libs:native')
5253
implementation project(path: ':libs:simdvec')
5354
implementation project(path: ':libs:exponential-histogram')
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
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.indices.common;
11+
12+
import org.elasticsearch.TransportVersion;
13+
import org.elasticsearch.cluster.ClusterModule;
14+
import org.elasticsearch.cluster.metadata.IndexMetadata;
15+
import org.elasticsearch.common.compress.CompressedXContent;
16+
import org.elasticsearch.common.logging.LogConfigurator;
17+
import org.elasticsearch.common.settings.IndexScopedSettings;
18+
import org.elasticsearch.common.settings.Setting;
19+
import org.elasticsearch.common.settings.Settings;
20+
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
21+
import org.elasticsearch.index.IndexSettings;
22+
import org.elasticsearch.index.IndexVersion;
23+
import org.elasticsearch.index.analysis.IndexAnalyzers;
24+
import org.elasticsearch.index.cache.bitset.BitsetFilterCache;
25+
import org.elasticsearch.index.mapper.MapperMetrics;
26+
import org.elasticsearch.index.mapper.MapperRegistry;
27+
import org.elasticsearch.index.mapper.MapperService;
28+
import org.elasticsearch.index.mapper.ProvidedIdFieldMapper;
29+
import org.elasticsearch.index.similarity.SimilarityService;
30+
import org.elasticsearch.indices.IndicesModule;
31+
import org.elasticsearch.script.Script;
32+
import org.elasticsearch.script.ScriptCompiler;
33+
import org.elasticsearch.script.ScriptContext;
34+
import org.elasticsearch.xcontent.NamedXContentRegistry;
35+
import org.elasticsearch.xcontent.XContentParserConfiguration;
36+
import org.elasticsearch.xpack.logsdb.LogsDBPlugin;
37+
import org.openjdk.jmh.annotations.Benchmark;
38+
import org.openjdk.jmh.annotations.BenchmarkMode;
39+
import org.openjdk.jmh.annotations.Fork;
40+
import org.openjdk.jmh.annotations.Measurement;
41+
import org.openjdk.jmh.annotations.Mode;
42+
import org.openjdk.jmh.annotations.OutputTimeUnit;
43+
import org.openjdk.jmh.annotations.Param;
44+
import org.openjdk.jmh.annotations.Scope;
45+
import org.openjdk.jmh.annotations.Setup;
46+
import org.openjdk.jmh.annotations.State;
47+
import org.openjdk.jmh.annotations.Warmup;
48+
49+
import java.io.IOException;
50+
import java.util.ArrayList;
51+
import java.util.HashSet;
52+
import java.util.List;
53+
import java.util.Map;
54+
import java.util.Random;
55+
import java.util.Set;
56+
import java.util.concurrent.TimeUnit;
57+
58+
@Fork(value = 1)
59+
@Warmup(iterations = 2)
60+
@Measurement(iterations = 5)
61+
@BenchmarkMode(Mode.AverageTime)
62+
@OutputTimeUnit(TimeUnit.MILLISECONDS)
63+
@State(Scope.Benchmark)
64+
public class MappingParsingBenchmark {
65+
static {
66+
// For Elasticsearch900Lucene101Codec:
67+
LogConfigurator.loadLog4jPlugins();
68+
LogConfigurator.configureESLogging();
69+
LogConfigurator.setNodeName("test");
70+
}
71+
72+
private static final String MAPPING = """
73+
{
74+
"_doc": {
75+
"dynamic": false,
76+
"properties": {
77+
"@timestamp": {
78+
"type": "date"
79+
},
80+
"host": {
81+
"type": "object",
82+
"properties": {
83+
"name": {
84+
"type": "keyword"
85+
}
86+
}
87+
},
88+
"message": {
89+
"type": "pattern_text"
90+
}
91+
}
92+
}
93+
}
94+
\s""";
95+
96+
@Param("1024")
97+
private int numIndices;
98+
99+
private List<MapperService> mapperServices;
100+
private CompressedXContent compressedMapping;
101+
102+
private Random random = new Random();
103+
private static final String CHARS = "abcdefghijklmnopqrstuvwxyz1234567890";
104+
105+
private String randomIndexName() {
106+
StringBuilder b = new StringBuilder();
107+
for (int i = 0; i < 10; i++) {
108+
b.append(CHARS.charAt(random.nextInt(CHARS.length())));
109+
}
110+
return b.toString();
111+
}
112+
113+
@Setup
114+
public void setUp() throws IOException {
115+
Settings settings = Settings.builder()
116+
.put("index.number_of_replicas", 0)
117+
.put("index.number_of_shards", 1)
118+
.put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current())
119+
.put("index.mode", "logsdb")
120+
.put("index.logsdb.sort_on_host_name", true)
121+
.put("index.logsdb.sort_on_message_template", true)
122+
.build();
123+
124+
LogsDBPlugin logsDBPlugin = new LogsDBPlugin(settings);
125+
126+
Set<Setting<?>> definedSettings = new HashSet<>(IndexScopedSettings.BUILT_IN_INDEX_SETTINGS);
127+
definedSettings.addAll(logsDBPlugin.getSettings().stream().filter(Setting::hasIndexScope).toList());
128+
IndexScopedSettings indexScopedSettings = new IndexScopedSettings(Settings.EMPTY, definedSettings);
129+
130+
mapperServices = new ArrayList<>(numIndices);
131+
for (int i = 0; i < numIndices; i++) {
132+
IndexMetadata meta = IndexMetadata.builder(randomIndexName()).settings(settings).build();
133+
IndexSettings indexSettings = new IndexSettings(meta, settings, indexScopedSettings);
134+
MapperRegistry mapperRegistry = new IndicesModule(List.of(logsDBPlugin)).getMapperRegistry();
135+
SimilarityService similarityService = new SimilarityService(indexSettings, null, Map.of());
136+
BitsetFilterCache bitsetFilterCache = new BitsetFilterCache(indexSettings, BitsetFilterCache.Listener.NOOP);
137+
MapperService mapperService = new MapperService(
138+
() -> TransportVersion.current(),
139+
indexSettings,
140+
IndexAnalyzers.of(Map.of()),
141+
XContentParserConfiguration.EMPTY.withRegistry(new NamedXContentRegistry(ClusterModule.getNamedXWriteables()))
142+
.withDeprecationHandler(LoggingDeprecationHandler.INSTANCE),
143+
similarityService,
144+
mapperRegistry,
145+
() -> {
146+
throw new UnsupportedOperationException();
147+
},
148+
new ProvidedIdFieldMapper(() -> true),
149+
new ScriptCompiler() {
150+
@Override
151+
public <T> T compile(Script script, ScriptContext<T> scriptContext) {
152+
throw new UnsupportedOperationException();
153+
}
154+
},
155+
bitsetFilterCache::getBitSetProducer,
156+
MapperMetrics.NOOP
157+
);
158+
159+
mapperServices.add(mapperService);
160+
}
161+
162+
compressedMapping = new CompressedXContent(MAPPING);
163+
}
164+
165+
@Benchmark
166+
public void mappingParsingBenchmark() {
167+
for (MapperService service : mapperServices) {
168+
service.merge("_doc", compressedMapping, MapperService.MergeReason.MAPPING_UPDATE);
169+
}
170+
}
171+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void registerTestArtifactFromSourceSet(SourceSet sourceSet) {
3434
JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);
3535
javaPluginExtension.registerFeature(name + "Artifacts", featureSpec -> {
3636
featureSpec.usingSourceSet(sourceSet);
37-
featureSpec.capability("org.elasticsearch.gradle", project.getName() + "-" + sourceSet.getName() + "-artifacts", "1.0");
37+
featureSpec.capability(project.getGroup().toString(), project.getName() + "-" + sourceSet.getName() + "-artifacts", "1.0");
3838
// This feature is only used internally in the
3939
// elasticsearch build so we do not need any publication.
4040
featureSpec.disablePublication();

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ tasks.named('zipAggregation').configure {
9595
ext.testArtifact = { p, String name = "test" ->
9696
def projectDependency = p.dependencies.create(p)
9797
projectDependency.capabilities {
98-
requireCapabilities("org.elasticsearch.gradle:${projectDependency.name}-${name}-artifacts")
98+
requireCapabilities("${p.group}:${projectDependency.name}-${name}-artifacts")
9999
};
100100
}
101101

docs/changelog/132388.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 132388
2+
summary: Added NVIDIA support to Inference Plugin
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/138072.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138072
2+
summary: Add a new setting for s3 API call timeout
3+
area: Snapshot/Restore
4+
type: enhancement
5+
issues: []

docs/changelog/138198.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138198
2+
summary: Add Embedding inference task type
3+
area: Machine Learning
4+
type: enhancement
5+
issues: []

docs/changelog/138332.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 138332
2+
summary: Do not skip a remote cluster base on the query's execution time status
3+
area: ES|QL
4+
type: bug
5+
issues: []

docs/changelog/138634.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 138634
2+
summary: Add "close_job" parameter to the stop datafeed API
3+
area: Machine Learning
4+
type: enhancement
5+
issues:
6+
- 138010

0 commit comments

Comments
 (0)