Skip to content

Commit 43d280e

Browse files
committed
Merge branch 'main' into lucene_snapshot
2 parents ccb407a + e2c29f5 commit 43d280e

File tree

119 files changed

+3566
-730
lines changed

Some content is hidden

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

119 files changed

+3566
-730
lines changed

.github/CODEOWNERS

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,30 @@ server/src/main/java/org/elasticsearch/bootstrap @elastic/es-core-infra
6565
server/src/main/java/org/elasticsearch/node @elastic/es-core-infra
6666
server/src/main/java/org/elasticsearch/plugins @elastic/es-core-infra
6767
server/src/main/java/org/elasticsearch/threadpool @elastic/es-core-infra
68+
server/src/main/java/org/elasticsearch/common/breaker @elastic/es-core-infra
69+
server/src/main/java/org/elasticsearch/common/bytes @elastic/es-core-infra
70+
server/src/main/java/org/elasticsearch/common/cli @elastic/es-core-infra
71+
server/src/main/java/org/elasticsearch/common/collect @elastic/es-core-infra
72+
server/src/main/java/org/elasticsearch/common/component @elastic/es-core-infra
73+
server/src/main/java/org/elasticsearch/common/compress @elastic/es-core-infra
74+
server/src/main/java/org/elasticsearch/common/document @elastic/es-core-infra
75+
server/src/main/java/org/elasticsearch/common/file @elastic/es-core-infra
76+
server/src/main/java/org/elasticsearch/common/hash @elastic/es-core-infra
77+
server/src/main/java/org/elasticsearch/common/io @elastic/es-core-infra
78+
server/src/main/java/org/elasticsearch/common/logging @elastic/es-core-infra
79+
server/src/main/java/org/elasticsearch/common/metrics @elastic/es-core-infra
80+
server/src/main/java/org/elasticsearch/common/network @elastic/es-core-infra
81+
server/src/main/java/org/elasticsearch/common/path @elastic/es-core-infra
82+
server/src/main/java/org/elasticsearch/common/recycler @elastic/es-core-infra
83+
server/src/main/java/org/elasticsearch/common/regex @elastic/es-core-infra
84+
server/src/main/java/org/elasticsearch/common/scheduler @elastic/es-core-infra
85+
server/src/main/java/org/elasticsearch/common/settings @elastic/es-core-infra
86+
server/src/main/java/org/elasticsearch/common/text @elastic/es-core-infra
87+
server/src/main/java/org/elasticsearch/common/time @elastic/es-core-infra
88+
server/src/main/java/org/elasticsearch/common/transport @elastic/es-core-infra
89+
server/src/main/java/org/elasticsearch/common/unit @elastic/es-core-infra
90+
server/src/main/java/org/elasticsearch/common/util @elastic/es-core-infra
91+
server/src/main/java/org/elasticsearch/common/xcontent @elastic/es-core-infra
6892

6993
# Security
7094
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege @elastic/es-security

README.asciidoc

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Elasticsearch is a distributed search and analytics engine, scalable data store
44

55
Use cases enabled by Elasticsearch include:
66

7-
* https://www.elastic.co/search-labs/blog/articles/retrieval-augmented-generation-rag[Retrieval Augmented Generation (RAG)]
7+
* https://www.elastic.co/search-labs/blog/articles/retrieval-augmented-generation-rag[Retrieval Augmented Generation (RAG)]
88
* https://www.elastic.co/search-labs/blog/categories/vector-search[Vector search]
99
* Full-text search
1010
* Logs
@@ -17,7 +17,7 @@ Use cases enabled by Elasticsearch include:
1717
To learn more about Elasticsearch's features and capabilities, see our
1818
https://www.elastic.co/products/elasticsearch[product page].
1919

20-
To access information on https://www.elastic.co/search-labs/blog/categories/ml-research[machine learning innovations] and the latest https://www.elastic.co/search-labs/blog/categories/lucene[Lucene contributions from Elastic], more information can be found in https://www.elastic.co/search-labs[Search Labs].
20+
To access information on https://www.elastic.co/search-labs/blog/categories/ml-research[machine learning innovations] and the latest https://www.elastic.co/search-labs/blog/categories/lucene[Lucene contributions from Elastic], more information can be found in https://www.elastic.co/search-labs[Search Labs].
2121

2222
[[get-started]]
2323
== Get started
@@ -27,20 +27,20 @@ https://www.elastic.co/cloud/as-a-service[Elasticsearch Service on Elastic
2727
Cloud].
2828

2929
If you prefer to install and manage Elasticsearch yourself, you can download
30-
the latest version from
30+
the latest version from
3131
https://www.elastic.co/downloads/elasticsearch[elastic.co/downloads/elasticsearch].
3232

3333
=== Run Elasticsearch locally
3434

35-
////
35+
////
3636
IMPORTANT: This content is replicated in the Elasticsearch repo. See `run-elasticsearch-locally.asciidoc`.
3737
Ensure both files are in sync.
3838
3939
https://github.com/elastic/start-local is the source of truth.
40-
////
40+
////
4141

4242
[WARNING]
43-
====
43+
====
4444
DO NOT USE THESE INSTRUCTIONS FOR PRODUCTION DEPLOYMENTS.
4545
4646
This setup is intended for local development and testing only.
@@ -93,20 +93,20 @@ Use this key to connect to Elasticsearch with a https://www.elastic.co/guide/en/
9393
From the `elastic-start-local` folder, check the connection to Elasticsearch using `curl`:
9494

9595
[source,sh]
96-
----
96+
----
9797
source .env
9898
curl $ES_LOCAL_URL -H "Authorization: ApiKey ${ES_LOCAL_API_KEY}"
9999
----
100100
// NOTCONSOLE
101101

102102
=== Send requests to Elasticsearch
103103

104-
You send data and other requests to Elasticsearch through REST APIs.
105-
You can interact with Elasticsearch using any client that sends HTTP requests,
104+
You send data and other requests to Elasticsearch through REST APIs.
105+
You can interact with Elasticsearch using any client that sends HTTP requests,
106106
such as the https://www.elastic.co/guide/en/elasticsearch/client/index.html[Elasticsearch
107-
language clients] and https://curl.se[curl].
107+
language clients] and https://curl.se[curl].
108108

109-
==== Using curl
109+
==== Using curl
110110

111111
Here's an example curl command to create a new Elasticsearch index, using basic auth:
112112

@@ -149,19 +149,19 @@ print(client.info())
149149

150150
==== Using the Dev Tools Console
151151

152-
Kibana's developer console provides an easy way to experiment and test requests.
152+
Kibana's developer console provides an easy way to experiment and test requests.
153153
To access the console, open Kibana, then go to **Management** > **Dev Tools**.
154154

155155
**Add data**
156156

157-
You index data into Elasticsearch by sending JSON objects (documents) through the REST APIs.
158-
Whether you have structured or unstructured text, numerical data, or geospatial data,
159-
Elasticsearch efficiently stores and indexes it in a way that supports fast searches.
157+
You index data into Elasticsearch by sending JSON objects (documents) through the REST APIs.
158+
Whether you have structured or unstructured text, numerical data, or geospatial data,
159+
Elasticsearch efficiently stores and indexes it in a way that supports fast searches.
160160

161161
For timestamped data such as logs and metrics, you typically add documents to a
162162
data stream made up of multiple auto-generated backing indices.
163163

164-
To add a single document to an index, submit an HTTP post request that targets the index.
164+
To add a single document to an index, submit an HTTP post request that targets the index.
165165

166166
----
167167
POST /customer/_doc/1
@@ -171,19 +171,19 @@ POST /customer/_doc/1
171171
}
172172
----
173173

174-
This request automatically creates the `customer` index if it doesn't exist,
175-
adds a new document that has an ID of 1, and
174+
This request automatically creates the `customer` index if it doesn't exist,
175+
adds a new document that has an ID of 1, and
176176
stores and indexes the `firstname` and `lastname` fields.
177177

178-
The new document is available immediately from any node in the cluster.
178+
The new document is available immediately from any node in the cluster.
179179
You can retrieve it with a GET request that specifies its document ID:
180180

181181
----
182182
GET /customer/_doc/1
183183
----
184184

185185
To add multiple documents in one request, use the `_bulk` API.
186-
Bulk data must be newline-delimited JSON (NDJSON).
186+
Bulk data must be newline-delimited JSON (NDJSON).
187187
Each line must end in a newline character (`\n`), including the last line.
188188

189189
----
@@ -200,15 +200,15 @@ PUT customer/_bulk
200200

201201
**Search**
202202

203-
Indexed documents are available for search in near real-time.
204-
The following search matches all customers with a first name of _Jennifer_
203+
Indexed documents are available for search in near real-time.
204+
The following search matches all customers with a first name of _Jennifer_
205205
in the `customer` index.
206206

207207
----
208208
GET customer/_search
209209
{
210210
"query" : {
211-
"match" : { "firstname": "Jennifer" }
211+
"match" : { "firstname": "Jennifer" }
212212
}
213213
}
214214
----
@@ -223,9 +223,9 @@ data streams, or index aliases.
223223

224224
. Go to **Management > Stack Management > Kibana > Data Views**.
225225
. Select **Create data view**.
226-
. Enter a name for the data view and a pattern that matches one or more indices,
227-
such as _customer_.
228-
. Select **Save data view to Kibana**.
226+
. Enter a name for the data view and a pattern that matches one or more indices,
227+
such as _customer_.
228+
. Select **Save data view to Kibana**.
229229

230230
To start exploring, go to **Analytics > Discover**.
231231

@@ -254,11 +254,6 @@ To build a distribution for another platform, run the related command:
254254
./gradlew :distribution:archives:windows-zip:assemble
255255
----
256256

257-
To build distributions for all supported platforms, run:
258-
----
259-
./gradlew assemble
260-
----
261-
262257
Distributions are output to `distribution/archives`.
263258

264259
To run the test suite, see xref:TESTING.asciidoc[TESTING].
@@ -281,7 +276,7 @@ The https://github.com/elastic/elasticsearch-labs[`elasticsearch-labs`] repo con
281276
[[contribute]]
282277
== Contribute
283278

284-
For contribution guidelines, see xref:CONTRIBUTING.md[CONTRIBUTING].
279+
For contribution guidelines, see xref:CONTRIBUTING.md[CONTRIBUTING].
285280

286281
[[questions]]
287282
== Questions? Problems? Suggestions?
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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.resolution;
11+
12+
import org.elasticsearch.action.IndicesRequest;
13+
import org.elasticsearch.action.support.IndicesOptions;
14+
import org.elasticsearch.cluster.ClusterName;
15+
import org.elasticsearch.cluster.ClusterState;
16+
import org.elasticsearch.cluster.metadata.DataStream;
17+
import org.elasticsearch.cluster.metadata.IndexMetadata;
18+
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
19+
import org.elasticsearch.cluster.metadata.Metadata;
20+
import org.elasticsearch.common.settings.Settings;
21+
import org.elasticsearch.common.util.concurrent.ThreadContext;
22+
import org.elasticsearch.index.Index;
23+
import org.elasticsearch.index.IndexVersion;
24+
import org.elasticsearch.indices.SystemIndices;
25+
import org.openjdk.jmh.annotations.Benchmark;
26+
import org.openjdk.jmh.annotations.BenchmarkMode;
27+
import org.openjdk.jmh.annotations.Fork;
28+
import org.openjdk.jmh.annotations.Mode;
29+
import org.openjdk.jmh.annotations.OutputTimeUnit;
30+
import org.openjdk.jmh.annotations.Param;
31+
import org.openjdk.jmh.annotations.Scope;
32+
import org.openjdk.jmh.annotations.Setup;
33+
import org.openjdk.jmh.annotations.State;
34+
35+
import java.util.ArrayList;
36+
import java.util.List;
37+
import java.util.concurrent.TimeUnit;
38+
39+
@State(Scope.Benchmark)
40+
@Fork(3)
41+
@BenchmarkMode(Mode.AverageTime)
42+
@OutputTimeUnit(TimeUnit.MILLISECONDS)
43+
@SuppressWarnings("unused") // invoked by benchmarking framework
44+
public class IndexNameExpressionResolverBenchmark {
45+
46+
private static final String DATA_STREAM_PREFIX = "my-ds-";
47+
private static final String INDEX_PREFIX = "my-index-";
48+
49+
@Param(
50+
{
51+
// # data streams | # indices
52+
" 1000| 100",
53+
" 5000| 500",
54+
" 10000| 1000" }
55+
)
56+
public String resourceMix = "100|10";
57+
58+
@Setup
59+
public void setUp() {
60+
final String[] params = resourceMix.split("\\|");
61+
62+
int numDataStreams = toInt(params[0]);
63+
int numIndices = toInt(params[1]);
64+
65+
Metadata.Builder mb = Metadata.builder();
66+
String[] indices = new String[numIndices + numDataStreams * (numIndices + 1)];
67+
int position = 0;
68+
for (int i = 1; i <= numIndices; i++) {
69+
String indexName = INDEX_PREFIX + i;
70+
createIndexMetadata(indexName, mb);
71+
indices[position++] = indexName;
72+
}
73+
74+
for (int i = 1; i <= numDataStreams; i++) {
75+
String dataStreamName = DATA_STREAM_PREFIX + i;
76+
List<Index> backingIndices = new ArrayList<>();
77+
for (int j = 1; j <= numIndices; j++) {
78+
String backingIndexName = DataStream.getDefaultBackingIndexName(dataStreamName, j);
79+
backingIndices.add(createIndexMetadata(backingIndexName, mb).getIndex());
80+
indices[position++] = backingIndexName;
81+
}
82+
indices[position++] = dataStreamName;
83+
mb.put(DataStream.builder(dataStreamName, backingIndices).build());
84+
}
85+
int mid = indices.length / 2;
86+
clusterState = ClusterState.builder(ClusterName.DEFAULT).metadata(mb).build();
87+
resolver = new IndexNameExpressionResolver(new ThreadContext(Settings.EMPTY), new SystemIndices(List.of()));
88+
indexListRequest = new Request(IndicesOptions.lenientExpandOpenHidden(), indices);
89+
starRequest = new Request(IndicesOptions.lenientExpandOpenHidden(), "*");
90+
String[] mixed = indices.clone();
91+
mixed[mid] = "my-*";
92+
mixedRequest = new Request(IndicesOptions.lenientExpandOpenHidden(), mixed);
93+
}
94+
95+
private IndexMetadata createIndexMetadata(String indexName, Metadata.Builder mb) {
96+
IndexMetadata indexMetadata = IndexMetadata.builder(indexName)
97+
.settings(Settings.builder().put(IndexMetadata.SETTING_VERSION_CREATED, IndexVersion.current()))
98+
.numberOfShards(1)
99+
.numberOfReplicas(0)
100+
.build();
101+
mb.put(indexMetadata, false);
102+
return indexMetadata;
103+
}
104+
105+
private IndexNameExpressionResolver resolver;
106+
private ClusterState clusterState;
107+
private Request starRequest;
108+
private Request indexListRequest;
109+
private Request mixedRequest;
110+
111+
@Benchmark
112+
public String[] resolveResourcesListToConcreteIndices() {
113+
return resolver.concreteIndexNames(clusterState, indexListRequest);
114+
}
115+
116+
@Benchmark
117+
public String[] resolveAllStarToConcreteIndices() {
118+
return resolver.concreteIndexNames(clusterState, starRequest);
119+
}
120+
121+
@Benchmark
122+
public String[] resolveMixedConcreteIndices() {
123+
return resolver.concreteIndexNames(clusterState, mixedRequest);
124+
}
125+
126+
private int toInt(String v) {
127+
return Integer.parseInt(v.trim());
128+
}
129+
130+
record Request(IndicesOptions indicesOptions, String... indices) implements IndicesRequest {
131+
132+
}
133+
}

0 commit comments

Comments
 (0)