Skip to content

Commit 37b6128

Browse files
committed
Merge remote-tracking branch 'origin/tsdb/bulk-load-float' into tsdb/bulk-load-float
2 parents 33f6ee6 + 72fe3ec commit 37b6128

File tree

476 files changed

+5311
-511
lines changed

Some content is hidden

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

476 files changed

+5311
-511
lines changed

.github/workflows/docs-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
with:
1414
path-pattern: docs/**
1515
path-pattern-ignore: docs/changelog/**/*.yaml
16+
enable-cumulative-comment: true
1617
permissions:
1718
deployments: write
1819
id-token: write

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/AggregatorBenchmark.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,11 @@ public Block eval(Page page) {
666666
return mask;
667667
}
668668

669+
@Override
670+
public long baseRamBytesUsed() {
671+
return 0;
672+
}
673+
669674
@Override
670675
public void close() {
671676
mask.close();

benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static void selfTest() {
144144
public String operation;
145145

146146
private static Operator operator(String operation) {
147-
return new EvalOperator(driverContext.blockFactory(), evaluator(operation));
147+
return new EvalOperator(driverContext, evaluator(operation));
148148
}
149149

150150
private static EvalOperator.ExpressionEvaluator evaluator(String operation) {

distribution/build.gradle

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -629,22 +629,6 @@ subprojects {
629629
}
630630
}
631631

632-
['archives:windows-zip',
633-
'archives:darwin-tar',
634-
'archives:darwin-aarch64-tar',
635-
'archives:linux-aarch64-tar',
636-
'archives:linux-tar',
637-
'archives:integ-test-zip',
638-
'packages:rpm', 'packages:deb',
639-
'packages:aarch64-rpm', 'packages:aarch64-deb',
640-
].forEach { subName ->
641-
Project subproject = project("${project.path}:${subName}")
642-
Configuration configuration = configurations.create(subproject.name)
643-
dependencies {
644-
"${configuration.name}" project(path: subproject.path, configuration:'default')
645-
}
646-
}
647-
648632
// This artifact makes it possible for other projects to pull
649633
// in the final log4j2.properties configuration, as it appears in the
650634
// archive distribution.

docs/changelog/133392.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 133392
2+
summary: Track memory in evaluators
3+
area: ES|QL
4+
type: bug
5+
issues: []

muted-tests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,18 @@ tests:
675675
- class: org.elasticsearch.xpack.logsdb.qa.LogsDbVersusReindexedLogsDbChallengeRestIT
676676
method: testEsqlSource
677677
issue: https://github.com/elastic/elasticsearch/issues/133520
678+
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
679+
method: testTopNPushedToLucene
680+
issue: https://github.com/elastic/elasticsearch/issues/133556
681+
- class: org.elasticsearch.xpack.esql.action.EsqlActionBreakerIT
682+
method: testFilterNestedFields
683+
issue: https://github.com/elastic/elasticsearch/issues/133557
684+
- class: org.elasticsearch.xpack.logsdb.qa.LogsDbVersusReindexedLogsDbChallengeRestIT
685+
method: testMatchAllQuery
686+
issue: https://github.com/elastic/elasticsearch/issues/133560
687+
- class: org.elasticsearch.test.rest.yaml.RcsCcsCommonYamlTestSuiteIT
688+
method: test {p0=search/10_source_filtering/no filtering}
689+
issue: https://github.com/elastic/elasticsearch/issues/133561
678690

679691
# Examples:
680692
#

server/src/main/java/org/elasticsearch/index/codec/tsdb/es819/ES819TSDBDocValuesProducer.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,6 +1747,7 @@ private static class TermsDictEntry {
17471747

17481748
static final class SingletonLongToSingletonOrdinalDelegate implements BlockLoader.SingletonLongBuilder {
17491749
private final BlockLoader.SingletonOrdinalsBuilder builder;
1750+
private final int[] buffer = new int[ES819TSDBDocValuesFormat.NUMERIC_BLOCK_SIZE];
17501751

17511752
SingletonLongToSingletonOrdinalDelegate(BlockLoader.SingletonOrdinalsBuilder builder) {
17521753
this.builder = builder;
@@ -1759,20 +1760,21 @@ public BlockLoader.SingletonLongBuilder appendLong(long value) {
17591760

17601761
@Override
17611762
public BlockLoader.SingletonLongBuilder appendLongs(long[] values, int from, int length) {
1763+
assert length <= buffer.length;
17621764
// Unfortunately, no array copy here...
17631765
// Since we need to loop here, let's also keep track of min/max.
17641766
int minOrd = Integer.MAX_VALUE;
17651767
int maxOrd = Integer.MIN_VALUE;
17661768
int counter = 0;
1767-
int[] convertedOrds = new int[length];
17681769
int end = from + length;
17691770
for (int j = from; j < end; j++) {
17701771
int ord = Math.toIntExact(values[j]);
1771-
convertedOrds[counter++] = ord;
1772+
buffer[counter++] = ord;
17721773
minOrd = Math.min(minOrd, ord);
17731774
maxOrd = Math.max(maxOrd, ord);
17741775
}
1775-
builder.appendOrds(convertedOrds, 0, length, minOrd, maxOrd);
1776+
assert counter == length;
1777+
builder.appendOrds(buffer, 0, length, minOrd, maxOrd);
17761778
return this;
17771779
}
17781780

test/framework/src/main/java/org/elasticsearch/index/mapper/MapperTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ public void testSingletonLongBulkBlockReading() throws IOException {
15221522
}
15231523

15241524
public void testSingletonDoubleBulkBlockReading() throws IOException {
1525-
assumeTrue("field type supports bulk singleton long reading", supportsBulkDoubleBlockReading());
1525+
assumeTrue("field type supports bulk singleton double reading", supportsBulkDoubleBlockReading());
15261526
testSingletonBulkBlockReading(columnAtATimeReader -> (BlockDocValuesReader.SingletonDoubles) columnAtATimeReader);
15271527
}
15281528

x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/Literal.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
package org.elasticsearch.xpack.esql.core.expression;
88

9+
import org.apache.lucene.util.Accountable;
910
import org.apache.lucene.util.BytesRef;
11+
import org.apache.lucene.util.RamUsageEstimator;
1012
import org.elasticsearch.TransportVersions;
1113
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
1214
import org.elasticsearch.common.io.stream.StreamInput;
@@ -35,7 +37,9 @@
3537
/**
3638
* Literal or constant.
3739
*/
38-
public class Literal extends LeafExpression {
40+
public class Literal extends LeafExpression implements Accountable {
41+
private static final long BASE_RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(Literal.class);
42+
3943
public static final NamedWriteableRegistry.Entry ENTRY = new NamedWriteableRegistry.Entry(
4044
Expression.class,
4145
"Literal",
@@ -169,6 +173,17 @@ public String nodeString() {
169173
return toString() + "[" + dataType + "]";
170174
}
171175

176+
@Override
177+
public long ramBytesUsed() {
178+
long ramBytesUsed = BASE_RAM_BYTES_USED;
179+
if (value instanceof BytesRef b) {
180+
ramBytesUsed += b.length;
181+
} else {
182+
ramBytesUsed += RamUsageEstimator.sizeOfObject(value);
183+
}
184+
return ramBytesUsed;
185+
}
186+
172187
/**
173188
* Utility method for creating a literal out of a foldable expression.
174189
* Throws an exception if the expression is not foldable.

x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/ConvertEvaluatorImplementer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import javax.lang.model.type.TypeMirror;
2424
import javax.lang.model.util.Elements;
2525

26+
import static org.elasticsearch.compute.gen.EvaluatorImplementer.baseRamBytesUsed;
2627
import static org.elasticsearch.compute.gen.Methods.buildFromFactory;
2728
import static org.elasticsearch.compute.gen.Methods.getMethod;
2829
import static org.elasticsearch.compute.gen.Types.ABSTRACT_CONVERT_FUNCTION_EVALUATOR;
@@ -98,6 +99,7 @@ private TypeSpec type() {
9899
builder.addJavadoc("This class is generated. Edit {@code " + getClass().getSimpleName() + "} instead.");
99100
builder.addModifiers(Modifier.PUBLIC, Modifier.FINAL);
100101
builder.superclass(ABSTRACT_CONVERT_FUNCTION_EVALUATOR);
102+
builder.addField(baseRamBytesUsed(implementation));
101103

102104
for (EvaluatorImplementer.ProcessFunctionArg a : processFunction.args) {
103105
a.declareField(builder);
@@ -113,6 +115,7 @@ private TypeSpec type() {
113115
}
114116
builder.addMethod(processFunction.toStringMethod(implementation));
115117
builder.addMethod(processFunction.close());
118+
builder.addMethod(processFunction.baseRamBytesUsed());
116119
builder.addType(factory());
117120
return builder.build();
118121
}

0 commit comments

Comments
 (0)