Skip to content

Commit

Permalink
fix benchmark builds
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisHegarty committed Sep 19, 2023
1 parent 3c3363e commit 91199de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.benchmark.compute.operator;

import org.apache.lucene.util.BytesRef;
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier;
import org.elasticsearch.compute.aggregation.AggregatorMode;
Expand All @@ -23,6 +24,7 @@
import org.elasticsearch.compute.aggregation.SumLongAggregatorFunctionSupplier;
import org.elasticsearch.compute.aggregation.blockhash.BlockHash;
import org.elasticsearch.compute.data.Block;
import org.elasticsearch.compute.data.BlockFactory;
import org.elasticsearch.compute.data.BooleanBlock;
import org.elasticsearch.compute.data.BytesRefBlock;
import org.elasticsearch.compute.data.DoubleArrayVector;
Expand Down Expand Up @@ -139,10 +141,11 @@ private static Operator operator(String grouping, String op, String dataType) {
);
default -> throw new IllegalArgumentException("unsupported grouping [" + grouping + "]");
};
DriverContext driverContext = driverContext();
return new HashAggregationOperator(
List.of(supplier(op, dataType, groups.size()).groupingAggregatorFactory(AggregatorMode.SINGLE)),
() -> BlockHash.build(groups, BIG_ARRAYS, 16 * 1024, false),
new DriverContext(BigArrays.NON_RECYCLING_INSTANCE)
() -> BlockHash.build(groups, driverContext, 16 * 1024, false),
driverContext
);
}

Expand Down Expand Up @@ -576,4 +579,11 @@ private static void run(String grouping, String op, String blockType, int opCoun
operator.finish();
checkExpected(grouping, op, blockType, dataType, operator.getOutput(), opCount);
}

static DriverContext driverContext() {
return new DriverContext(
BigArrays.NON_RECYCLING_INSTANCE,
BlockFactory.getInstance(new NoopCircuitBreaker("noop"), BigArrays.NON_RECYCLING_INSTANCE)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

package org.elasticsearch.benchmark.compute.operator;

import org.elasticsearch.common.breaker.NoopCircuitBreaker;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.compute.data.Block;
import org.elasticsearch.compute.data.BlockFactory;
import org.elasticsearch.compute.data.BooleanBlock;
import org.elasticsearch.compute.data.BooleanVector;
import org.elasticsearch.compute.data.IntBlock;
Expand Down Expand Up @@ -262,6 +264,9 @@ private static void run(String operation) {
}

static DriverContext driverContext() {
return new DriverContext(BigArrays.NON_RECYCLING_INSTANCE);
return new DriverContext(
BigArrays.NON_RECYCLING_INSTANCE,
BlockFactory.getInstance(new NoopCircuitBreaker("noop"), BigArrays.NON_RECYCLING_INSTANCE)
);
}
}

0 comments on commit 91199de

Please sign in to comment.