java.lang.Object
org.elasticsearch.compute.data.BlockFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ByteSizeValuestatic final ByteSizeValuestatic final ByteSizeValuestatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionBlockFactory(CircuitBreaker breaker, BigArrays bigArrays) BlockFactory(CircuitBreaker breaker, BigArrays bigArrays, ByteSizeValue maxPrimitiveArraySize) protectedBlockFactory(CircuitBreaker breaker, BigArrays bigArrays, ByteSizeValue maxPrimitiveArraySize, BlockFactory parent) -
Method Summary
Modifier and TypeMethodDescriptionvoidadjustBreaker(long delta) Adjust the circuit breaker with the given delta, if the delta is negative, the breaker will be adjusted without tripping.breaker()static BlockFactorygetInstance(CircuitBreaker breaker, BigArrays bigArrays) longReturns the maximum number of bytes that a Block should be backed by a primitive array before switching to using BigArrays.newAggregateMetricDoubleBlockBuilder(int estimatedSize) final BooleanBlocknewBooleanArrayBlock(boolean[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) newBooleanArrayBlock(boolean[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrder, long preAdjustedBytes) final BooleanVectornewBooleanArrayVector(boolean[] values, int positionCount) newBooleanArrayVector(boolean[] values, int positionCount, long preAdjustedBytes) newBooleanBlockBuilder(int estimatedSize) newBooleanVectorBuilder(int estimatedSize) newBooleanVectorFixedBuilder(int size) Build aBooleanVector.FixedBuilderthat never grows.newBytesRefArrayBlock(BytesRefArray values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) newBytesRefArrayVector(BytesRefArray values, int positionCount) newBytesRefBlockBuilder(int estimatedSize) newBytesRefVectorBuilder(int estimatedSize) newChildFactory(LocalCircuitBreaker childBreaker) final BlocknewConstantAggregateMetricDoubleBlock(AggregateMetricDoubleBlockBuilder.AggregateMetricDoubleLiteral value, int positions) final BooleanBlocknewConstantBooleanBlockWith(boolean value, int positions) newConstantBooleanBlockWith(boolean value, int positions, long preAdjustedBytes) newConstantBooleanVector(boolean value, int positions) newConstantBytesRefBlockWith(org.apache.lucene.util.BytesRef value, int positions) newConstantBytesRefVector(org.apache.lucene.util.BytesRef value, int positions) final DoubleBlocknewConstantDoubleBlockWith(double value, int positions) newConstantDoubleBlockWith(double value, int positions, long preAdjustedBytes) newConstantDoubleVector(double value, int positions) final FloatBlocknewConstantFloatBlockWith(float value, int positions) newConstantFloatBlockWith(float value, int positions, long preAdjustedBytes) newConstantFloatVector(float value, int positions) final IntBlocknewConstantIntBlockWith(int value, int positions) newConstantIntBlockWith(int value, int positions, long preAdjustedBytes) newConstantIntVector(int value, int positions) final LongBlocknewConstantLongBlockWith(long value, int positions) newConstantLongBlockWith(long value, int positions, long preAdjustedBytes) newConstantLongVector(long value, int positions) newConstantNullBlock(int positions) final DoubleBlocknewDoubleArrayBlock(double[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) newDoubleArrayBlock(double[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) final DoubleVectornewDoubleArrayVector(double[] values, int positionCount) newDoubleArrayVector(double[] values, int positionCount, long preAdjustedBytes) newDoubleBlockBuilder(int estimatedSize) newDoubleVectorBuilder(int estimatedSize) newDoubleVectorFixedBuilder(int size) Build aDoubleVector.FixedBuilderthat never grows.final FloatBlocknewFloatArrayBlock(float[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) newFloatArrayBlock(float[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) final FloatVectornewFloatArrayVector(float[] values, int positionCount) newFloatArrayVector(float[] values, int positionCount, long preAdjustedBytes) newFloatBlockBuilder(int estimatedSize) newFloatVectorBuilder(int estimatedSize) newFloatVectorFixedBuilder(int size) Build aFloatVector.FixedBuilderthat never grows.final IntBlocknewIntArrayBlock(int[] values, int positionCount, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) newIntArrayBlock(int[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) final IntVectornewIntArrayVector(int[] values, int positionCount) Creates a new Vector with the given values and positionCount.newIntArrayVector(int[] values, int positionCount, long preAdjustedBytes) Creates a new Vector with the given values and positionCount, where the caller has already pre-adjusted a number of bytes with the factory's breaker.newIntBlockBuilder(int estimatedSize) newIntVectorBuilder(int estimatedSize) newIntVectorFixedBuilder(int size) Build aIntVector.FixedBuilderthat never grows.final LongBlocknewLongArrayBlock(long[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) newLongArrayBlock(long[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) final LongVectornewLongArrayVector(long[] values, int positionCount) newLongArrayVector(long[] values, int positionCount, long preAdjustedBytes) newLongBlockBuilder(int estimatedSize) newLongVectorBuilder(int estimatedSize) newLongVectorFixedBuilder(int size) Build aLongVector.FixedBuilderthat never grows.protected BlockFactoryparent()longpreAdjustBreakerForBoolean(int positionCount) Pre-adjusts the breaker for the given position count and element type.longpreAdjustBreakerForDouble(int positionCount) longpreAdjustBreakerForInt(int positionCount) longpreAdjustBreakerForLong(int positionCount)
-
Field Details
-
LOCAL_BREAKER_OVER_RESERVED_SIZE_SETTING
- See Also:
-
LOCAL_BREAKER_OVER_RESERVED_DEFAULT_SIZE
-
LOCAL_BREAKER_OVER_RESERVED_MAX_SIZE_SETTING
- See Also:
-
LOCAL_BREAKER_OVER_RESERVED_DEFAULT_MAX_SIZE
-
MAX_BLOCK_PRIMITIVE_ARRAY_SIZE_SETTING
- See Also:
-
DEFAULT_MAX_BLOCK_PRIMITIVE_ARRAY_SIZE
-
-
Constructor Details
-
BlockFactory
-
BlockFactory
public BlockFactory(CircuitBreaker breaker, BigArrays bigArrays, ByteSizeValue maxPrimitiveArraySize) -
BlockFactory
protected BlockFactory(CircuitBreaker breaker, BigArrays bigArrays, ByteSizeValue maxPrimitiveArraySize, BlockFactory parent)
-
-
Method Details
-
getInstance
-
breaker
-
bigArrays
-
parent
-
newChildFactory
-
adjustBreaker
Adjust the circuit breaker with the given delta, if the delta is negative, the breaker will be adjusted without tripping.- Throws:
CircuitBreakingException- if the breaker was put above its limit
-
preAdjustBreakerForBoolean
public long preAdjustBreakerForBoolean(int positionCount) Pre-adjusts the breaker for the given position count and element type. Returns the pre-adjusted amount. -
preAdjustBreakerForInt
public long preAdjustBreakerForInt(int positionCount) -
preAdjustBreakerForLong
public long preAdjustBreakerForLong(int positionCount) -
preAdjustBreakerForDouble
public long preAdjustBreakerForDouble(int positionCount) -
newBooleanBlockBuilder
-
newBooleanVectorFixedBuilder
Build aBooleanVector.FixedBuilderthat never grows. -
newBooleanArrayBlock
public final BooleanBlock newBooleanArrayBlock(boolean[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) -
newBooleanArrayBlock
public BooleanBlock newBooleanArrayBlock(boolean[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrder, long preAdjustedBytes) -
newBooleanVectorBuilder
-
newBooleanArrayVector
-
newBooleanArrayVector
public BooleanVector newBooleanArrayVector(boolean[] values, int positionCount, long preAdjustedBytes) -
newConstantBooleanBlockWith
-
newConstantBooleanBlockWith
public BooleanBlock newConstantBooleanBlockWith(boolean value, int positions, long preAdjustedBytes) -
newConstantBooleanVector
-
newIntBlockBuilder
-
newIntArrayBlock
public final IntBlock newIntArrayBlock(int[] values, int positionCount, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) -
newIntArrayBlock
public IntBlock newIntArrayBlock(int[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) -
newIntVectorBuilder
-
newIntVectorFixedBuilder
Build aIntVector.FixedBuilderthat never grows. -
newIntArrayVector
Creates a new Vector with the given values and positionCount. Equivalent to: newIntArrayVector(values, positionCount, 0L); // with zero pre-adjusted bytes -
newIntArrayVector
Creates a new Vector with the given values and positionCount, where the caller has already pre-adjusted a number of bytes with the factory's breaker. long preAdjustedBytes = blockFactory.preAdjustBreakerForInt(positionCount); int[] values = new int[positionCount]; for (int i = 0; i < positionCount; i++) { values[i] = doWhateverStuff } var vector = blockFactory.newIntArrayVector(values, positionCount, preAdjustedBytes); -
newConstantIntBlockWith
-
newConstantIntBlockWith
-
newConstantIntVector
-
newFloatBlockBuilder
-
newFloatArrayBlock
public final FloatBlock newFloatArrayBlock(float[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) -
newFloatArrayBlock
public FloatBlock newFloatArrayBlock(float[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) -
newFloatVectorBuilder
-
newFloatVectorFixedBuilder
Build aFloatVector.FixedBuilderthat never grows. -
newFloatArrayVector
-
newFloatArrayVector
-
newConstantFloatBlockWith
-
newConstantFloatBlockWith
-
newConstantFloatVector
-
newLongBlockBuilder
-
newLongArrayBlock
public final LongBlock newLongArrayBlock(long[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) -
newLongArrayBlock
public LongBlock newLongArrayBlock(long[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) -
newLongVectorBuilder
-
newLongVectorFixedBuilder
Build aLongVector.FixedBuilderthat never grows. -
newLongArrayVector
-
newLongArrayVector
-
newConstantLongBlockWith
-
newConstantLongBlockWith
-
newConstantLongVector
-
newDoubleBlockBuilder
-
newDoubleArrayBlock
public final DoubleBlock newDoubleArrayBlock(double[] values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) -
newDoubleArrayBlock
public DoubleBlock newDoubleArrayBlock(double[] values, int pc, int[] fvi, BitSet nulls, Block.MvOrdering mvOrdering, long preAdjustedBytes) -
newDoubleVectorBuilder
-
newDoubleVectorFixedBuilder
Build aDoubleVector.FixedBuilderthat never grows. -
newDoubleArrayVector
-
newDoubleArrayVector
-
newConstantDoubleBlockWith
-
newConstantDoubleBlockWith
-
newConstantDoubleVector
-
newBytesRefBlockBuilder
-
newBytesRefArrayBlock
public BytesRefBlock newBytesRefArrayBlock(BytesRefArray values, int pc, int[] firstValueIndexes, BitSet nulls, Block.MvOrdering mvOrdering) -
newBytesRefVectorBuilder
-
newBytesRefArrayVector
-
newConstantBytesRefBlockWith
public BytesRefBlock newConstantBytesRefBlockWith(org.apache.lucene.util.BytesRef value, int positions) -
newConstantBytesRefVector
public BytesRefVector newConstantBytesRefVector(org.apache.lucene.util.BytesRef value, int positions) -
newConstantNullBlock
-
newAggregateMetricDoubleBlockBuilder
-
newConstantAggregateMetricDoubleBlock
public final Block newConstantAggregateMetricDoubleBlock(AggregateMetricDoubleBlockBuilder.AggregateMetricDoubleLiteral value, int positions) -
maxPrimitiveArrayBytes
public long maxPrimitiveArrayBytes()Returns the maximum number of bytes that a Block should be backed by a primitive array before switching to using BigArrays.
-