Skip to content

Commit a7290fd

Browse files
committed
Merge branch 'main' of github.com:elastic/elasticsearch into reshard-install-source-search-filter
2 parents 945ac4f + 666a8e6 commit a7290fd

File tree

474 files changed

+24760
-10560
lines changed

Some content is hidden

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

474 files changed

+24760
-10560
lines changed

.buildkite/pipelines/periodic-java-ea.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,8 @@ steps:
385385
- signal_reason: agent_stop
386386
limit: 3
387387

388-
- label: 9.0.7 / bwc
389-
command: .ci/scripts/run-gradle.sh -Druntime.java=$$JAVA_EA_VERSION -Dbwc.checkout.align=true v9.0.7#bwcTest
388+
- label: 9.0.8 / bwc
389+
command: .ci/scripts/run-gradle.sh -Druntime.java=$$JAVA_EA_VERSION -Dbwc.checkout.align=true v9.0.8#bwcTest
390390
timeout_in_minutes: 300
391391
agents:
392392
provider: gcp
@@ -395,7 +395,7 @@ steps:
395395
buildDirectory: /dev/shm/bk
396396
preemptible: true
397397
env:
398-
BWC_VERSION: 9.0.7
398+
BWC_VERSION: 9.0.8
399399
retry:
400400
automatic:
401401
- exit_status: "-1"

.buildkite/pipelines/periodic-packaging.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ steps:
352352
env:
353353
BWC_VERSION: 8.19.8
354354

355-
- label: "{{matrix.image}} / 9.0.7 / packaging-tests-upgrade"
356-
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.7
355+
- label: "{{matrix.image}} / 9.0.8 / packaging-tests-upgrade"
356+
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.0.8
357357
timeout_in_minutes: 300
358358
matrix:
359359
setup:
@@ -366,7 +366,7 @@ steps:
366366
machineType: custom-16-32768
367367
buildDirectory: /dev/shm/bk
368368
env:
369-
BWC_VERSION: 9.0.7
369+
BWC_VERSION: 9.0.8
370370

371371
- label: "{{matrix.image}} / 9.1.8 / packaging-tests-upgrade"
372372
command: ./.ci/scripts/packaging-test.sh -Dbwc.checkout.align=true destructiveDistroUpgradeTest.v9.1.8

.buildkite/pipelines/periodic.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ steps:
382382
- signal_reason: agent_stop
383383
limit: 3
384384

385-
- label: 9.0.7 / bwc
386-
command: .ci/scripts/run-gradle.sh --continue -Dbwc.checkout.align=true v9.0.7#bwcTest
385+
- label: 9.0.8 / bwc
386+
command: .ci/scripts/run-gradle.sh --continue -Dbwc.checkout.align=true v9.0.8#bwcTest
387387
timeout_in_minutes: 300
388388
agents:
389389
provider: gcp
@@ -392,7 +392,7 @@ steps:
392392
buildDirectory: /dev/shm/bk
393393
preemptible: true
394394
env:
395-
BWC_VERSION: 9.0.7
395+
BWC_VERSION: 9.0.8
396396
retry:
397397
automatic:
398398
- exit_status: "-1"

.ci/bwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BWC_VERSION:
1919
- "8.17.10"
2020
- "8.18.8"
2121
- "8.19.8"
22-
- "9.0.7"
22+
- "9.0.8"
2323
- "9.1.8"
2424
- "9.2.2"
2525
- "9.3.0"

.gitattributes

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ CHANGELOG.asciidoc merge=union
44
# Windows
55
build-tools-internal/src/test/resources/org/elasticsearch/gradle/internal/release/*.asciidoc text eol=lf
66

7+
# ESQL parsing and source generated related assets
78
x-pack/plugin/esql/compute/src/main/generated/** linguist-generated=true
89
x-pack/plugin/esql/compute/src/main/generated-src/** linguist-generated=true
910
x-pack/plugin/esql/src/main/antlr/*.tokens linguist-generated=true
1011
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/*.interp linguist-generated=true
11-
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseLexer*.java linguist-generated=true
12-
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/EsqlBaseParser*.java linguist-generated=true
12+
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/*BaseLexer*.java linguist-generated=true
13+
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/*BaseParser*.java linguist-generated=true
1314
x-pack/plugin/esql/src/main/generated/** linguist-generated=true
1415
x-pack/plugin/esql/src/main/generated-src/** linguist-generated=true
1516

benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/QueryPlanningBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void setup() {
102102
mapping.put("field" + i, new EsField("field-" + i, TEXT, emptyMap(), true, EsField.TimeSeriesFieldType.NONE));
103103
}
104104

105-
var esIndex = new EsIndex("test", mapping, Map.of("test", IndexMode.STANDARD), Set.of());
105+
var esIndex = new EsIndex("test", mapping, Map.of("test", IndexMode.STANDARD), Map.of(), Map.of(), Set.of());
106106

107107
var functionRegistry = new EsqlFunctionRegistry();
108108

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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.scorer;
11+
12+
import org.apache.lucene.codecs.lucene99.Lucene99ScalarQuantizedVectorScorer;
13+
import org.apache.lucene.codecs.lucene99.OffHeapQuantizedByteVectorValues;
14+
import org.apache.lucene.index.VectorSimilarityFunction;
15+
import org.apache.lucene.store.Directory;
16+
import org.apache.lucene.store.IOContext;
17+
import org.apache.lucene.store.IndexInput;
18+
import org.apache.lucene.store.IndexOutput;
19+
import org.apache.lucene.store.MemorySegmentAccessInput;
20+
import org.apache.lucene.util.hnsw.RandomVectorScorer;
21+
import org.apache.lucene.util.hnsw.RandomVectorScorerSupplier;
22+
import org.apache.lucene.util.quantization.QuantizedByteVectorValues;
23+
import org.apache.lucene.util.quantization.ScalarQuantizer;
24+
import org.elasticsearch.simdvec.VectorScorerFactory;
25+
26+
import java.io.IOException;
27+
import java.util.concurrent.ThreadLocalRandom;
28+
29+
class BenchmarkUtils {
30+
// Unsigned int7 byte vectors have values in the range of 0 to 127 (inclusive).
31+
static final byte MIN_INT7_VALUE = 0;
32+
static final byte MAX_INT7_VALUE = 127;
33+
34+
static void randomInt7BytesBetween(byte[] bytes) {
35+
var random = ThreadLocalRandom.current();
36+
for (int i = 0, len = bytes.length; i < len;) {
37+
bytes[i++] = (byte) random.nextInt(MIN_INT7_VALUE, MAX_INT7_VALUE + 1);
38+
}
39+
}
40+
41+
static void createRandomInt7VectorData(ThreadLocalRandom random, Directory dir, int dims, int numVectors) throws IOException {
42+
try (IndexOutput out = dir.createOutput("vector.data", IOContext.DEFAULT)) {
43+
var vec = new byte[dims];
44+
for (int v = 0; v < numVectors; v++) {
45+
randomInt7BytesBetween(vec);
46+
var vecOffset = random.nextFloat();
47+
out.writeBytes(vec, 0, vec.length);
48+
out.writeInt(Float.floatToIntBits(vecOffset));
49+
}
50+
}
51+
}
52+
53+
static VectorScorerFactory getScorerFactoryOrDie() {
54+
var optionalVectorScorerFactory = VectorScorerFactory.instance();
55+
if (optionalVectorScorerFactory.isEmpty()) {
56+
String msg = "JDK=["
57+
+ Runtime.version()
58+
+ "], os.name=["
59+
+ System.getProperty("os.name")
60+
+ "], os.arch=["
61+
+ System.getProperty("os.arch")
62+
+ "]";
63+
throw new AssertionError("Vector scorer factory not present. Cannot run the benchmark. " + msg);
64+
}
65+
return optionalVectorScorerFactory.get();
66+
}
67+
68+
static boolean supportsHeapSegments() {
69+
return Runtime.version().feature() >= 22;
70+
}
71+
72+
static QuantizedByteVectorValues vectorValues(int dims, int size, IndexInput in, VectorSimilarityFunction sim) throws IOException {
73+
var sq = new ScalarQuantizer(0.1f, 0.9f, (byte) 7);
74+
var slice = in.slice("values", 0, in.length());
75+
return new OffHeapQuantizedByteVectorValues.DenseOffHeapVectorValues(dims, size, sq, false, sim, null, slice);
76+
}
77+
78+
static RandomVectorScorerSupplier luceneScoreSupplier(QuantizedByteVectorValues values, VectorSimilarityFunction sim)
79+
throws IOException {
80+
return new Lucene99ScalarQuantizedVectorScorer(null).getRandomVectorScorerSupplier(sim, values);
81+
}
82+
83+
static RandomVectorScorer luceneScorer(QuantizedByteVectorValues values, VectorSimilarityFunction sim, float[] queryVec)
84+
throws IOException {
85+
return new Lucene99ScalarQuantizedVectorScorer(null).getRandomVectorScorer(sim, values, queryVec);
86+
}
87+
88+
static float readNodeCorrectionConstant(QuantizedByteVectorValues values, int targetOrd) throws IOException {
89+
var vectorByteSize = values.getVectorByteLength();
90+
var input = (MemorySegmentAccessInput) values.getSlice();
91+
long byteOffset = (long) targetOrd * (vectorByteSize + Float.BYTES);
92+
return Float.intBitsToFloat(input.readInt(byteOffset + vectorByteSize));
93+
}
94+
}

0 commit comments

Comments
 (0)