java.lang.Object
org.elasticsearch.compute.data.AbstractBlockBuilder
org.elasticsearch.compute.data.LongRangeBlockBuilder
- All Implemented Interfaces:
Closeable,AutoCloseable,Block.Builder,LongRangeBlock.Builder,Releasable,BlockLoader.Builder,BlockLoader.LongRangeBuilder
public final class LongRangeBlockBuilder
extends AbstractBlockBuilder
implements LongRangeBlock.Builder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA mutable container for a half-open[from, to)long range. -
Field Summary
Fields inherited from class org.elasticsearch.compute.data.AbstractBlockBuilder
blockFactory, estimatedBytes, firstValueIndexes, hasMultiValues, hasNonNullValue, mvOrdering, nullsMask, positionCount, positionEntryIsOpen, valueCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendLongRange(long from, long to) Append the given range to this builder.Append the given range to this builder.Appends a null value to the block.Begins a multivalued entry.build()Builds the block.Copy the values inblockfrombeginInclusivetoendExclusiveinto this builder.copyFrom(LongRangeBlock block, int pos) Copy the value(s) at the given position ofblockinto this builder.protected intThe number of bytes used to represent each value element.Ends the current multi-value entry.longAn estimate of the number of bytes theBlockcreated byBlock.Builder.build()will use.protected voidCalled when firstclosed.from()protected voidgrowValuesArray(int newSize) mvOrdering(Block.MvOrdering mvOrdering) How are multivalued fields ordered? This defaults toBlock.MvOrdering.UNORDEREDbut when you set it toBlock.MvOrdering.DEDUPLICATED_AND_SORTED_ASCENDINGsome operators can optimize themselves.to()protected intThe length of the internal values array.Methods inherited from class org.elasticsearch.compute.data.AbstractBlockBuilder
adjustBreaker, built, close, ensureCapacity, ensureCapacity, finish, isDense, isReleased, singleValued, updatePosition, updatePositions, writeNullValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.Releasable
close
-
Constructor Details
-
LongRangeBlockBuilder
-
-
Method Details
-
valuesLength
protected int valuesLength()Description copied from class:AbstractBlockBuilderThe length of the internal values array.- Specified by:
valuesLengthin classAbstractBlockBuilder
-
growValuesArray
protected void growValuesArray(int newSize) - Specified by:
growValuesArrayin classAbstractBlockBuilder
-
elementSize
protected int elementSize()Description copied from class:AbstractBlockBuilderThe number of bytes used to represent each value element.- Specified by:
elementSizein classAbstractBlockBuilder
-
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- Overrides:
estimatedBytesin classAbstractBlockBuilder
-
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
-
copyFrom
Description copied from interface:LongRangeBlock.BuilderCopy the value(s) at the given position ofblockinto this builder.- Specified by:
copyFromin interfaceLongRangeBlock.Builder
-
appendNull
Description copied from interface:Block.BuilderAppends a null value to the block.- Specified by:
appendNullin interfaceBlock.Builder- Specified by:
appendNullin interfaceBlockLoader.Builder- Overrides:
appendNullin classAbstractBlockBuilder
-
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- Overrides:
beginPositionEntryin classAbstractBlockBuilder
-
endPositionEntry
Description copied from interface:Block.BuilderEnds the current multi-value entry.- Specified by:
endPositionEntryin interfaceBlock.Builder- Specified by:
endPositionEntryin interfaceBlockLoader.Builder- Overrides:
endPositionEntryin classAbstractBlockBuilder
-
appendLongRange
Description copied from interface:LongRangeBlock.BuilderAppend the given range to this builder.- Specified by:
appendLongRangein interfaceLongRangeBlock.Builder
-
appendLongRange
Description copied from interface:LongRangeBlock.BuilderAppend the given range to this builder.- Specified by:
appendLongRangein interfaceLongRangeBlock.Builder
-
mvOrdering
Description copied from interface:Block.BuilderHow are multivalued fields ordered? This defaults toBlock.MvOrdering.UNORDEREDbut when you set it toBlock.MvOrdering.DEDUPLICATED_AND_SORTED_ASCENDINGsome operators can optimize themselves. This is a promise that is never checked. If you set this to anything other thanBlock.MvOrdering.UNORDEREDbe sure the values are in that order or other operators will make mistakes. The actual ordering isn't checked at runtime.- Specified by:
mvOrderingin interfaceBlock.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- Specified by:
buildin interfaceLongRangeBlock.Builder
-
extraClose
protected void extraClose()Description copied from class:AbstractBlockBuilderCalled when firstclosed.- Overrides:
extraClosein classAbstractBlockBuilder
-
from
- Specified by:
fromin interfaceBlockLoader.LongRangeBuilder
-
to
- Specified by:
toin interfaceBlockLoader.LongRangeBuilder
-