Skip to content

Commit

Permalink
merging main
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed Jan 3, 2024
2 parents a36fec8 + ed7bbf7 commit aeba60d
Show file tree
Hide file tree
Showing 1,339 changed files with 32,499 additions and 11,984 deletions.
2 changes: 1 addition & 1 deletion .buildkite/pipelines/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ steps:
image: family/elasticsearch-ubuntu-2004
machineType: n2-standard-8
buildDirectory: /dev/shm/bk
if: build.branch == "main" || build.branch =~ /^[0-9]+\.[0-9]+\$/
if: build.branch == "main" || build.branch == "7.17"
- label: Check branch consistency
command: .ci/scripts/run-gradle.sh branchConsistency
timeout_in_minutes: 15
Expand Down
13 changes: 13 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/sto
# APM Data index templates, etc.
x-pack/plugin/apm-data/src/main/resources @elastic/apm-server
x-pack/plugin/apm-data/src/yamlRestTest/resources @elastic/apm-server

# Delivery
gradle @elastic/es-delivery
build-conventions @elastic/es-delivery
build-tools @elastic/es-delivery
build-tools-internal @elastic/es-delivery
*.gradle @elastic/es-delivery
.buildkite @elastic/es-delivery
.ci @elastic/es-delivery
.idea @elastic/es-delivery
distribution/src @elastic/es-delivery
distribution/packages/src @elastic/es-delivery
distribution/docker/src @elastic/es-delivery
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@
import org.elasticsearch.compute.data.BlockFactory;
import org.elasticsearch.compute.data.BooleanBlock;
import org.elasticsearch.compute.data.BytesRefBlock;
import org.elasticsearch.compute.data.DoubleArrayVector;
import org.elasticsearch.compute.data.DoubleBlock;
import org.elasticsearch.compute.data.ElementType;
import org.elasticsearch.compute.data.IntBlock;
import org.elasticsearch.compute.data.LongArrayVector;
import org.elasticsearch.compute.data.LongBlock;
import org.elasticsearch.compute.data.Page;
import org.elasticsearch.compute.operator.AggregationOperator;
Expand Down Expand Up @@ -67,6 +65,10 @@ public class AggregatorBenchmark {
private static final int GROUPS = 5;

private static final BigArrays BIG_ARRAYS = BigArrays.NON_RECYCLING_INSTANCE; // TODO real big arrays?
private static final BlockFactory blockFactory = BlockFactory.getInstance(
new NoopCircuitBreaker("noop"),
BigArrays.NON_RECYCLING_INSTANCE
);

private static final String LONGS = "longs";
private static final String INTS = "ints";
Expand Down Expand Up @@ -116,8 +118,7 @@ public class AggregatorBenchmark {
@Param({ VECTOR_LONGS, HALF_NULL_LONGS, VECTOR_DOUBLES, HALF_NULL_DOUBLES })
public String blockType;

private static Operator operator(String grouping, String op, String dataType) {
DriverContext driverContext = driverContext();
private static Operator operator(DriverContext driverContext, String grouping, String op, String dataType) {
if (grouping.equals("none")) {
return new AggregationOperator(
List.of(supplier(op, dataType, 0).aggregatorFactory(AggregatorMode.SINGLE).apply(driverContext)),
Expand Down Expand Up @@ -432,24 +433,24 @@ private static void checkUngrouped(String prefix, String op, String dataType, Pa
}
}

private static Page page(String grouping, String blockType) {
Block dataBlock = dataBlock(blockType);
private static Page page(BlockFactory blockFactory, String grouping, String blockType) {
Block dataBlock = dataBlock(blockFactory, blockType);
if (grouping.equals("none")) {
return new Page(dataBlock);
}
List<Block> blocks = groupingBlocks(grouping, blockType);
return new Page(Stream.concat(blocks.stream(), Stream.of(dataBlock)).toArray(Block[]::new));
}

private static Block dataBlock(String blockType) {
private static Block dataBlock(BlockFactory blockFactory, String blockType) {
return switch (blockType) {
case VECTOR_LONGS -> new LongArrayVector(LongStream.range(0, BLOCK_LENGTH).toArray(), BLOCK_LENGTH).asBlock();
case VECTOR_DOUBLES -> new DoubleArrayVector(
case VECTOR_LONGS -> blockFactory.newLongArrayVector(LongStream.range(0, BLOCK_LENGTH).toArray(), BLOCK_LENGTH).asBlock();
case VECTOR_DOUBLES -> blockFactory.newDoubleArrayVector(
LongStream.range(0, BLOCK_LENGTH).mapToDouble(l -> Long.valueOf(l).doubleValue()).toArray(),
BLOCK_LENGTH
).asBlock();
case MULTIVALUED_LONGS -> {
var builder = LongBlock.newBlockBuilder(BLOCK_LENGTH);
var builder = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
builder.beginPositionEntry();
for (int i = 0; i < BLOCK_LENGTH; i++) {
builder.appendLong(i);
Expand All @@ -462,15 +463,15 @@ private static Block dataBlock(String blockType) {
yield builder.build();
}
case HALF_NULL_LONGS -> {
var builder = LongBlock.newBlockBuilder(BLOCK_LENGTH);
var builder = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
builder.appendLong(i);
builder.appendNull();
}
yield builder.build();
}
case HALF_NULL_DOUBLES -> {
var builder = DoubleBlock.newBlockBuilder(BLOCK_LENGTH);
var builder = blockFactory.newDoubleBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
builder.appendDouble(i);
builder.appendNull();
Expand Down Expand Up @@ -502,7 +503,7 @@ private static Block groupingBlock(String grouping, String blockType) {
};
return switch (grouping) {
case LONGS -> {
var builder = LongBlock.newBlockBuilder(BLOCK_LENGTH);
var builder = blockFactory.newLongBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
for (int v = 0; v < valuesPerGroup; v++) {
builder.appendLong(i % GROUPS);
Expand All @@ -511,7 +512,7 @@ private static Block groupingBlock(String grouping, String blockType) {
yield builder.build();
}
case INTS -> {
var builder = IntBlock.newBlockBuilder(BLOCK_LENGTH);
var builder = blockFactory.newIntBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
for (int v = 0; v < valuesPerGroup; v++) {
builder.appendInt(i % GROUPS);
Expand All @@ -520,7 +521,7 @@ private static Block groupingBlock(String grouping, String blockType) {
yield builder.build();
}
case DOUBLES -> {
var builder = DoubleBlock.newBlockBuilder(BLOCK_LENGTH);
var builder = blockFactory.newDoubleBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
for (int v = 0; v < valuesPerGroup; v++) {
builder.appendDouble(i % GROUPS);
Expand All @@ -529,7 +530,7 @@ private static Block groupingBlock(String grouping, String blockType) {
yield builder.build();
}
case BOOLEANS -> {
BooleanBlock.Builder builder = BooleanBlock.newBlockBuilder(BLOCK_LENGTH);
BooleanBlock.Builder builder = blockFactory.newBooleanBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
for (int v = 0; v < valuesPerGroup; v++) {
builder.appendBoolean(i % 2 == 1);
Expand All @@ -538,7 +539,7 @@ private static Block groupingBlock(String grouping, String blockType) {
yield builder.build();
}
case BYTES_REFS -> {
BytesRefBlock.Builder builder = BytesRefBlock.newBlockBuilder(BLOCK_LENGTH);
BytesRefBlock.Builder builder = blockFactory.newBytesRefBlockBuilder(BLOCK_LENGTH);
for (int i = 0; i < BLOCK_LENGTH; i++) {
for (int v = 0; v < valuesPerGroup; v++) {
builder.appendBytesRef(bytesGroup(i % GROUPS));
Expand Down Expand Up @@ -574,8 +575,9 @@ private static void run(String grouping, String op, String blockType, int opCoun
default -> throw new IllegalArgumentException();
};

Operator operator = operator(grouping, op, dataType);
Page page = page(grouping, blockType);
DriverContext driverContext = driverContext();
Operator operator = operator(driverContext, grouping, op, dataType);
Page page = page(driverContext.blockFactory(), grouping, blockType);
for (int i = 0; i < opCount; i++) {
operator.addInput(page);
}
Expand All @@ -584,9 +586,6 @@ private static void run(String grouping, String op, String blockType, int opCoun
}

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

0 comments on commit aeba60d

Please sign in to comment.