org.elasticsearch.compute.data.LongVectorBlock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of x-pack-esql-compute Show documentation
Show all versions of x-pack-esql-compute Show documentation
Elasticsearch subproject :x-pack:plugin:esql:compute
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
package org.elasticsearch.compute.data;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.core.ReleasableIterator;
import org.elasticsearch.core.Releasables;
/**
* Block view of a {@link LongVector}. Cannot represent multi-values or nulls.
* This class is generated. Do not edit it.
*/
public final class LongVectorBlock extends AbstractVectorBlock implements LongBlock {
private final LongVector vector;
/**
* @param vector considered owned by the current block; must not be used in any other {@code Block}
*/
LongVectorBlock(LongVector vector) {
this.vector = vector;
}
@Override
public LongVector asVector() {
return vector;
}
@Override
public long getLong(int valueIndex) {
return vector.getLong(valueIndex);
}
@Override
public int getPositionCount() {
return vector.getPositionCount();
}
@Override
public ElementType elementType() {
return vector.elementType();
}
@Override
public LongBlock filter(int... positions) {
return vector.filter(positions).asBlock();
}
@Override
public ReleasableIterator extends LongBlock> lookup(IntBlock positions, ByteSizeValue targetBlockSize) {
return vector.lookup(positions, targetBlockSize);
}
@Override
public LongBlock expand() {
incRef();
return this;
}
@Override
public long ramBytesUsed() {
return vector.ramBytesUsed();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof LongBlock that) {
return LongBlock.equals(this, that);
}
return false;
}
@Override
public int hashCode() {
return LongBlock.hash(this);
}
@Override
public String toString() {
return getClass().getSimpleName() + "[vector=" + vector + "]";
}
@Override
public void closeInternal() {
assert (vector.isReleased() == false) : "can't release block [" + this + "] containing already released vector";
Releasables.closeExpectNoException(vector);
}
@Override
public void allowPassingToDifferentDriver() {
vector.allowPassingToDifferentDriver();
}
@Override
public BlockFactory blockFactory() {
return vector.blockFactory();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy