Skip to content

Commit f3a481a

Browse files
authored
Share some ESQL test infrastructure (elastic#120223) (elastic#120329)
* Share some ESQL test infrastructure This let's us use `OperatorTests` in esql itself. Good for enrich. * Remove cargo cult * Fix conflict
1 parent 5644551 commit f3a481a

File tree

46 files changed

+103
-51
lines changed

Some content is hidden

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

46 files changed

+103
-51
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void apply(Project project) {
5353
}
5454

5555
// List of root tasks, by name, whose compileJava task should not use the module path. These are test related sources.
56-
static final Set<String> EXCLUDES = Set.of(":test:framework", ":x-pack:plugin:eql:qa:common");
56+
static final Set<String> EXCLUDES = Set.of(":test:framework", ":x-pack:plugin:eql:qa:common", ":x-pack:plugin:esql:compute:test");
5757

5858
void configureCompileModulePath(Project project) {
5959
// first disable Gradle's builtin module path inference

x-pack/plugin/esql/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ dependencies {
5252
testImplementation project(path: ':modules:analysis-common')
5353
testImplementation project(path: ':modules:ingest-common')
5454
testImplementation project(path: ':modules:legacy-geo')
55+
testImplementation project(xpackModule('esql:compute:test'))
5556
testImplementation('net.nextencia:rrdiagram:0.9.4')
5657
testImplementation('org.webjars.npm:fontsource__roboto-mono:4.5.7')
5758

x-pack/plugin/esql/compute/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ dependencies {
1919
testImplementation(project(':modules:analysis-common'))
2020
testImplementation(project(':test:framework'))
2121
testImplementation(project(xpackModule('esql-core')))
22+
testImplementation(project(xpackModule('esql:compute:test'))) {
23+
/*
24+
* compute:test depends on this project's main code which is fine
25+
* but we don't need to pull in the jar because we already have
26+
* it being, you know, in this project....
27+
*/
28+
transitive = false
29+
}
2230
testImplementation(project(xpackModule('core')))
2331
testImplementation(project(xpackModule('ml')))
2432
}

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanVectorFixedBuilder.java

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/DoubleVectorFixedBuilder.java

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/FloatVectorFixedBuilder.java

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/IntVectorFixedBuilder.java

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/LongVectorFixedBuilder.java

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/AbstractBlockBuilder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import java.util.BitSet;
1313
import java.util.stream.IntStream;
1414

15-
abstract class AbstractBlockBuilder implements Block.Builder {
15+
public abstract class AbstractBlockBuilder implements Block.Builder {
1616

1717
protected final BlockFactory blockFactory;
1818

@@ -34,7 +34,7 @@ abstract class AbstractBlockBuilder implements Block.Builder {
3434
/** The number of bytes currently estimated with the breaker. */
3535
protected long estimatedBytes;
3636

37-
boolean closed = false;
37+
private boolean closed = false;
3838

3939
protected AbstractBlockBuilder(BlockFactory blockFactory) {
4040
this.blockFactory = blockFactory;
@@ -183,4 +183,8 @@ private void setFirstValue(int position, int value) {
183183
}
184184
firstValueIndexes[position] = value;
185185
}
186+
187+
public boolean isReleased() {
188+
return closed;
189+
}
186190
}

x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/AbstractVectorBuilder.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
package org.elasticsearch.compute.data;
99

10-
abstract class AbstractVectorBuilder implements Vector.Builder {
10+
public abstract class AbstractVectorBuilder implements Vector.Builder {
1111
protected int valueCount;
1212

1313
/**
1414
* Has this builder been closed already?
1515
*/
16-
boolean closed = false;
16+
private boolean closed = false;
1717

1818
protected final BlockFactory blockFactory;
1919

@@ -90,4 +90,8 @@ public final void close() {
9090
* Called when first {@link #close() closed}.
9191
*/
9292
protected void extraClose() {}
93+
94+
public boolean isReleased() {
95+
return closed;
96+
}
9397
}

0 commit comments

Comments
 (0)