Skip to content

Commit 2508ce6

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ps250410-exposeMergeEvents
2 parents ae030b5 + a684e10 commit 2508ce6

File tree

123 files changed

+6904
-2980
lines changed

Some content is hidden

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

123 files changed

+6904
-2980
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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.vector;
11+
12+
import org.apache.lucene.index.VectorSimilarityFunction;
13+
import org.elasticsearch.common.logging.LogConfigurator;
14+
import org.elasticsearch.index.codec.vectors.OptimizedScalarQuantizer;
15+
import org.openjdk.jmh.annotations.Benchmark;
16+
import org.openjdk.jmh.annotations.BenchmarkMode;
17+
import org.openjdk.jmh.annotations.Fork;
18+
import org.openjdk.jmh.annotations.Level;
19+
import org.openjdk.jmh.annotations.Measurement;
20+
import org.openjdk.jmh.annotations.Mode;
21+
import org.openjdk.jmh.annotations.OutputTimeUnit;
22+
import org.openjdk.jmh.annotations.Param;
23+
import org.openjdk.jmh.annotations.Scope;
24+
import org.openjdk.jmh.annotations.Setup;
25+
import org.openjdk.jmh.annotations.State;
26+
import org.openjdk.jmh.annotations.Warmup;
27+
28+
import java.util.concurrent.ThreadLocalRandom;
29+
import java.util.concurrent.TimeUnit;
30+
31+
@BenchmarkMode(Mode.Throughput)
32+
@OutputTimeUnit(TimeUnit.MILLISECONDS)
33+
@State(Scope.Benchmark)
34+
@Warmup(iterations = 3, time = 1)
35+
@Measurement(iterations = 5, time = 1)
36+
@Fork(value = 3)
37+
public class OptimizedScalarQuantizerBenchmark {
38+
static {
39+
LogConfigurator.configureESLogging(); // native access requires logging to be initialized
40+
}
41+
@Param({ "384", "702", "1024" })
42+
int dims;
43+
44+
float[] vector;
45+
float[] centroid;
46+
byte[] destination;
47+
48+
@Param({ "1", "4", "7" })
49+
byte bits;
50+
51+
OptimizedScalarQuantizer osq = new OptimizedScalarQuantizer(VectorSimilarityFunction.DOT_PRODUCT);
52+
53+
@Setup(Level.Iteration)
54+
public void init() {
55+
ThreadLocalRandom random = ThreadLocalRandom.current();
56+
// random byte arrays for binary methods
57+
destination = new byte[dims];
58+
vector = new float[dims];
59+
centroid = new float[dims];
60+
for (int i = 0; i < dims; ++i) {
61+
vector[i] = random.nextFloat();
62+
centroid[i] = random.nextFloat();
63+
}
64+
}
65+
66+
@Benchmark
67+
public byte[] scalar() {
68+
osq.scalarQuantize(vector, destination, bits, centroid);
69+
return destination;
70+
}
71+
72+
@Benchmark
73+
@Fork(jvmArgsPrepend = { "--add-modules=jdk.incubator.vector" })
74+
public byte[] vector() {
75+
osq.scalarQuantize(vector, destination, bits, centroid);
76+
return destination;
77+
}
78+
}

distribution/docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ for (final Architecture architecture : Architecture.values()) {
590590
}
591591
if(base == DockerBase.DEFAULT) {
592592
// Add additional docker hub specific context which we use solely for publishing to docker hub.
593-
// At the moment it only differs in not labels added that we need for openshift certification
593+
// At the moment it is exactly the same as the default context.
594594
addBuildDockerContextTask(architecture, base, 'DockerHubContext', "docker-hub-build-context")
595595
}
596596
}

distribution/docker/src/docker/Dockerfile.default

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,13 @@ LABEL org.label-schema.build-date="${build_date}" \\
139139
org.opencontainers.image.vendor="Elastic" \\
140140
org.opencontainers.image.version="${version}"
141141

142-
<% if (docker_context != 'docker-hub-build-context') { %>
143142
LABEL name="Elasticsearch" \\
144143
maintainer="[email protected]" \\
145144
vendor="Elastic" \\
146145
version="${version}" \\
147146
release="1" \\
148147
summary="Elasticsearch" \\
149148
description="You know, for search."
150-
<% } %>
151149

152150
RUN mkdir /licenses && ln LICENSE.txt /licenses/LICENSE
153151

docs/changelog/125570.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 125570
2+
summary: ES|QL random sampling
3+
area: Machine Learning
4+
type: feature
5+
issues: []

docs/changelog/126990.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pr: 126990
2+
summary: "Fix: consider case sensitiveness differences in Windows/Unix-like filesystems\
3+
\ for files entitlements"
4+
area: Infra/Core
5+
type: bug
6+
issues:
7+
- 127047

docs/changelog/127118.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127118
2+
summary: Panama vector accelerated optimized scalar quantization
3+
area: Vector Search
4+
type: enhancement
5+
issues: []

docs/changelog/127267.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 127267
2+
summary: Bypass competitive iteration in single filter bucket case
3+
area: "Aggregations"
4+
type: bug
5+
issues: [127262]

docs/reference/elasticsearch/index-settings/index-modules.md

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,27 @@ $$$index-codec$$$ `index.codec`
4949

5050
$$$index-mode-setting$$$ `index.mode`
5151
: The `index.mode` setting is used to control settings applied in specific domains like ingestion of time series data or logs. Different mutually exclusive modes exist, which are used to apply settings or default values controlling indexing of documents, sorting and other parameters whose value affects indexing or query performance.
52-
53-
```console
54-
PUT my-index-000001
55-
{
56-
"settings": {
57-
"index":{
58-
"mode":"standard" <1>
59-
}
60-
}
61-
}
62-
```
63-
64-
1. This index uses the `standard` index mode
65-
66-
67-
Index mode supports the following values:
68-
69-
`null`
70-
: Default value (same as `standard`).
71-
72-
`standard`
73-
: Standard indexing with default settings.
74-
75-
`lookup`
76-
: Index that can be used for lookup joins in ES|QL. Limited to 1 shard.
77-
78-
79-
`time_series`
80-
: *(data streams only)* Index mode optimized for storage of metrics. For more information, see [Time series index settings](time-series.md).
81-
82-
`logsdb`
83-
: *(data streams only)* Index mode optimized for [logs](docs-content://manage-data/data-store/data-streams/logs-data-stream.md).
84-
52+
53+
**Example**
54+
55+
```console
56+
PUT my-index-000001
57+
{
58+
"settings": {
59+
"index":{
60+
"mode":"standard" # This index uses the `standard` index mode
61+
}
62+
}
63+
}
64+
```
65+
**Supported values**
66+
67+
The `index.mode` setting supports the following values:
68+
- `null`: Default value (same as `standard`).
69+
- `standard`: Standard indexing with default settings.
70+
- `lookup`: Index that can be used for [LOOKUP JOIN](/reference/query-languages/esql/esql-lookup-join.md) in ES|QL. Limited to 1 shard.
71+
- `time_series`: *(data streams only)* Index mode optimized for storage of metrics. For more information, see [Time series index settings](time-series.md).
72+
- `logsdb`: *(data streams only)* Index mode optimized for [logs](docs-content://manage-data/data-store/data-streams/logs-data-stream.md).
8573

8674
$$$routing-partition-size$$$ `index.routing_partition_size`
8775
: The number of shards a custom routing value can go to. Defaults to 1 and can only be set at index creation time. This value must be less than the `index.number_of_routing_shards` unless the `index.number_of_routing_shards` value is also 1. for more details about how this setting is used, refer to [](/reference/elasticsearch/mapping-reference/mapping-routing-field.md#routing-index-partition).
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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.entitlement.runtime.policy;
11+
12+
class CaseInsensitiveComparison extends FileAccessTreeComparison {
13+
14+
CaseInsensitiveComparison(char separatorChar) {
15+
super(CaseInsensitiveComparison::caseInsensitiveCharacterComparator, separatorChar);
16+
}
17+
18+
private static int caseInsensitiveCharacterComparator(char c1, char c2) {
19+
return Character.compare(Character.toLowerCase(c1), Character.toLowerCase(c2));
20+
}
21+
22+
@Override
23+
protected boolean pathStartsWith(String pathString, String pathPrefix) {
24+
return pathString.regionMatches(true, 0, pathPrefix, 0, pathPrefix.length());
25+
}
26+
27+
@Override
28+
protected boolean pathsAreEqual(String path1, String path2) {
29+
return path1.equalsIgnoreCase(path2);
30+
}
31+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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.entitlement.runtime.policy;
11+
12+
class CaseSensitiveComparison extends FileAccessTreeComparison {
13+
14+
CaseSensitiveComparison(char separatorChar) {
15+
super(Character::compare, separatorChar);
16+
}
17+
18+
@Override
19+
protected boolean pathStartsWith(String pathString, String pathPrefix) {
20+
return pathString.startsWith(pathPrefix);
21+
}
22+
23+
@Override
24+
protected boolean pathsAreEqual(String path1, String path2) {
25+
return path1.equals(path2);
26+
}
27+
}

0 commit comments

Comments
 (0)