java.lang.Object
org.elasticsearch.compute.data.AbstractBlockBuilder
- All Implemented Interfaces:
Closeable,AutoCloseable,Block.Builder,org.elasticsearch.core.Releasable,BlockLoader.Builder
- Direct Known Subclasses:
AggregateMetricDoubleBlockBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BlockFactoryprotected longThe number of bytes currently estimated with the breaker.protected int[]protected booleanprotected booleanprotected Block.MvOrderingprotected BitSetprotected intprotected booleanprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadjustBreaker(long deltaBytes) Appends a null value to the block.Begins a multivalued entry.protected final voidbuilt()Called during implementations ofBlock.Builder.build()as a last step to mark the Builder as closed and make sure that further closes don't double free memory.final voidclose()protected abstract intThe number of bytes used to represent each value element.Ends the current multi-value entry.protected final voidlongAn estimate of the number of bytes theBlockcreated byBlock.Builder.build()will use.protected voidCalled when firstclosed.protected final voidfinish()Called during implementations ofBlock.Builder.build()as a first step to check if the block is still open and to finish the last position.protected abstract voidgrowValuesArray(int newSize) protected final booleanisDense()booleanprotected final booleanprotected final voidprotected abstract intThe length of the internal values array.protected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.compute.data.Block.Builder
build, copyFrom, mvOrdering
-
Field Details
-
blockFactory
-
firstValueIndexes
protected int[] firstValueIndexes -
nullsMask
-
valueCount
protected int valueCount -
positionCount
protected int positionCount -
positionEntryIsOpen
protected boolean positionEntryIsOpen -
hasNonNullValue
protected boolean hasNonNullValue -
hasMultiValues
protected boolean hasMultiValues -
mvOrdering
-
estimatedBytes
protected long estimatedBytesThe number of bytes currently estimated with the breaker.
-
-
Constructor Details
-
AbstractBlockBuilder
-
-
Method Details
-
appendNull
Description copied from interface:Block.BuilderAppends a null value to the block.- Specified by:
appendNullin interfaceBlock.Builder- Specified by:
appendNullin interfaceBlockLoader.Builder
-
writeNullValue
protected void writeNullValue() -
valuesLength
protected abstract int valuesLength()The length of the internal values array. -
beginPositionEntry
Description copied from interface:Block.BuilderBegins a multivalued entry. Calling this for the first time will put the builder into a mode that generates Blocks that returntruefromBlock.mayHaveMultivaluedFields()which can force less optimized code paths. So don't call this unless you are sure you are emitting more than one value for this position.- Specified by:
beginPositionEntryin interfaceBlock.Builder- Specified by:
beginPositionEntryin interfaceBlockLoader.Builder
-
endPositionEntry
Description copied from interface:Block.BuilderEnds the current multi-value entry.- Specified by:
endPositionEntryin interfaceBlock.Builder- Specified by:
endPositionEntryin interfaceBlockLoader.Builder
-
isDense
protected final boolean isDense() -
singleValued
protected final boolean singleValued() -
updatePosition
protected final void updatePosition() -
finish
protected final void finish()Called during implementations ofBlock.Builder.build()as a first step to check if the block is still open and to finish the last position. -
estimatedBytes
public long estimatedBytes()Description copied from interface:Block.BuilderAn estimate of the number of bytes theBlockcreated byBlock.Builder.build()will use. This may overestimate the size but shouldn't underestimate it.- Specified by:
estimatedBytesin interfaceBlock.Builder
-
built
protected final void built()Called during implementations ofBlock.Builder.build()as a last step to mark the Builder as closed and make sure that further closes don't double free memory. -
growValuesArray
protected abstract void growValuesArray(int newSize) -
elementSize
protected abstract int elementSize()The number of bytes used to represent each value element. -
ensureCapacity
protected final void ensureCapacity() -
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
extraClose
protected void extraClose()Called when firstclosed. -
adjustBreaker
protected void adjustBreaker(long deltaBytes) -
isReleased
public boolean isReleased()
-