Skip to content

Commit 16c88eb

Browse files
committed
Restore original BucketedSort
1 parent ed18e7c commit 16c88eb

File tree

5 files changed

+0
-245
lines changed

5 files changed

+0
-245
lines changed

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

Lines changed: 0 additions & 49 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/sort/FloatBucketedSort.java

Lines changed: 0 additions & 49 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/sort/IntBucketedSort.java

Lines changed: 0 additions & 49 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/sort/LongBucketedSort.java

Lines changed: 0 additions & 49 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/sort/X-BucketedSort.java.st

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ public class $Type$BucketedSort implements Releasable {
9191
* </p>
9292
*/
9393
public void collect($type$ value, int bucket) {
94-
if (bucketSize == 0) {
95-
return;
96-
}
97-
9894
long rootIndex = (long) bucket * bucketSize;
9995
if (inHeapMode(bucket)) {
10096
if (betterThan(value, values.get(rootIndex))) {
@@ -150,51 +146,6 @@ public class $Type$BucketedSort implements Releasable {
150146
return Tuple.tuple(start, end);
151147
}
152148

153-
/**
154-
* Returns the amount of elements in the given bucket.
155-
*/
156-
public int getBucketCount(int bucket) {
157-
long rootIndex = (long) bucket * bucketSize;
158-
if (rootIndex >= values.size()) {
159-
// We've never seen this bucket.
160-
return 0;
161-
}
162-
long start = inHeapMode(bucket) ? rootIndex : (rootIndex + getNextGatherOffset(rootIndex) + 1);
163-
long end = rootIndex + bucketSize;
164-
165-
return (int) (end - start);
166-
}
167-
168-
/**
169-
* Returns the worst value in the given bucket.
170-
* <p>
171-
* This method shouldn't be called if the bucket is empty.
172-
* </p>
173-
* <p>
174-
* This method is O(1) if the bucket is full; O(n) otherwise.
175-
* </p>
176-
*/
177-
public $type$ getWorstValue(int bucket) {
178-
assert getBucketCount(bucket) > 0 : "Cannot get the worst value of an empty bucket";
179-
180-
long rootIndex = (long) bucket * bucketSize;
181-
long start = inHeapMode(bucket) ? rootIndex : (rootIndex + getNextGatherOffset(rootIndex) + 1);
182-
long end = rootIndex + bucketSize;
183-
184-
if (inHeapMode(bucket)) {
185-
return values.get(start);
186-
}
187-
188-
$type$ worstValue = values.get(start);
189-
for (long i = start + 1; i < end; i++) {
190-
if (betterThan(worstValue, values.get(i))) {
191-
worstValue = values.get(i);
192-
}
193-
}
194-
195-
return worstValue;
196-
}
197-
198149
/**
199150
* Merge the values from {@code other}'s {@code otherGroupId} into {@code groupId}.
200151
*/

0 commit comments

Comments
 (0)