From f313479490e1a221c40bea6909530b6cb1055cc2 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Tue, 10 Oct 2023 07:04:38 -0700 Subject: [PATCH] Allow VectorFixedBuilder to become released without build (#100567) VectorFixedBuilder can be closed without calling build and we should move its state to released in this case. --- .../elasticsearch/compute/data/BooleanVectorFixedBuilder.java | 1 + .../org/elasticsearch/compute/data/DoubleVectorFixedBuilder.java | 1 + .../org/elasticsearch/compute/data/IntVectorFixedBuilder.java | 1 + .../org/elasticsearch/compute/data/LongVectorFixedBuilder.java | 1 + .../org/elasticsearch/compute/data/X-VectorFixedBuilder.java.st | 1 + 5 files changed, 5 insertions(+) diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanVectorFixedBuilder.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanVectorFixedBuilder.java index 93ff57f2336bd..33daff853eecb 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanVectorFixedBuilder.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/BooleanVectorFixedBuilder.java @@ -69,6 +69,7 @@ public BooleanVector build() { public void close() { if (nextIndex >= 0) { // If nextIndex < 0 we've already built the vector + nextIndex = -1; blockFactory.adjustBreaker(-preAdjustedBytes, false); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/DoubleVectorFixedBuilder.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/DoubleVectorFixedBuilder.java index aa698a86b9c4e..7353515e8ffd8 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/DoubleVectorFixedBuilder.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/DoubleVectorFixedBuilder.java @@ -69,6 +69,7 @@ public DoubleVector build() { public void close() { if (nextIndex >= 0) { // If nextIndex < 0 we've already built the vector + nextIndex = -1; blockFactory.adjustBreaker(-preAdjustedBytes, false); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/IntVectorFixedBuilder.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/IntVectorFixedBuilder.java index 3ee3bfb40d6fa..a4755addf0b16 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/IntVectorFixedBuilder.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/IntVectorFixedBuilder.java @@ -69,6 +69,7 @@ public IntVector build() { public void close() { if (nextIndex >= 0) { // If nextIndex < 0 we've already built the vector + nextIndex = -1; blockFactory.adjustBreaker(-preAdjustedBytes, false); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/LongVectorFixedBuilder.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/LongVectorFixedBuilder.java index c95b0d07bec55..4a11012e769d8 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/LongVectorFixedBuilder.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/data/LongVectorFixedBuilder.java @@ -69,6 +69,7 @@ public LongVector build() { public void close() { if (nextIndex >= 0) { // If nextIndex < 0 we've already built the vector + nextIndex = -1; blockFactory.adjustBreaker(-preAdjustedBytes, false); } } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorFixedBuilder.java.st b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorFixedBuilder.java.st index 69993d0945fe3..dfe5bb7622b2a 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorFixedBuilder.java.st +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data/X-VectorFixedBuilder.java.st @@ -69,6 +69,7 @@ final class $Type$VectorFixedBuilder implements $Type$Vector.FixedBuilder { public void close() { if (nextIndex >= 0) { // If nextIndex < 0 we've already built the vector + nextIndex = -1; blockFactory.adjustBreaker(-preAdjustedBytes, false); } }