Module org.elasticsearch.compute
Package org.elasticsearch.compute.data
Class AbstractDelegatingCompoundBlock.AbstractCompositeBlockBuilder<T extends Block>
java.lang.Object
org.elasticsearch.compute.data.AbstractDelegatingCompoundBlock.AbstractCompositeBlockBuilder<T>
- All Implemented Interfaces:
Closeable,AutoCloseable,Block.Builder,Releasable,BlockLoader.Builder
- Direct Known Subclasses:
ExponentialHistogramBlockBuilder,TDigestBlockBuilder
- Enclosing class:
AbstractDelegatingCompoundBlock<T extends Block>
protected abstract static class AbstractDelegatingCompoundBlock.AbstractCompositeBlockBuilder<T extends Block>
extends Object
implements Block.Builder
Manages firstValueIndexes and positionCount for multi-value support.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Block.BuilderBegins a multivalued entry.final Tbuild()Builds the block.final voidclose()Copy the values inblockfrombeginInclusivetoendExclusiveinto this builder.protected abstract voidcopySubBlockPositions(AbstractDelegatingCompoundBlock<?> block, int startSubBlockPos, int endSubBlockPos) Copy the range of sub-block positions from the provided block into this builder.protected abstract TdoBuild(int positionCount, int[] firstValueIndexes) final Block.BuilderEnds the current multi-value entry.longAn estimate of the number of bytes theBlockcreated byBlock.Builder.build()will use.protected voidCalled whenclose()was invoked.protected booleanprotected final voidMust be called after a new value (null or non-null) has been appended.Methods 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
appendNull, mvOrdering
-
Field Details
-
blockFactory
-
-
Constructor Details
-
AbstractCompositeBlockBuilder
-
-
Method Details
-
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
-
isPositionEntryOpen
protected boolean isPositionEntryOpen() -
valueAppended
protected final void valueAppended()Must be called after a new value (null or non-null) has been appended. -
endPositionEntry
Description copied from interface:Block.BuilderEnds the current multi-value entry.- Specified by:
endPositionEntryin interfaceBlock.Builder- Specified by:
endPositionEntryin interfaceBlockLoader.Builder
-
build
Description copied from interface:Block.BuilderBuilds the block. This method can be called multiple times.- Specified by:
buildin interfaceBlock.Builder- Specified by:
buildin interfaceBlockLoader.Builder
-
doBuild
-
copyFrom
Description copied from interface:Block.BuilderCopy the values inblockfrombeginInclusivetoendExclusiveinto this builder.For single position copies use the faster
IntBlock.Builder.copyFrom(IntBlock, int),LongBlock.Builder.copyFrom(LongBlock, int), etc.- Specified by:
copyFromin interfaceBlock.Builder
-
copySubBlockPositions
protected abstract void copySubBlockPositions(AbstractDelegatingCompoundBlock<?> block, int startSubBlockPos, int endSubBlockPos) Copy the range of sub-block positions from the provided block into this builder. -
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
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceReleasable
-
extraClose
protected void extraClose()Called whenclose()was invoked.
-