- All Superinterfaces:
AutoCloseable,BlockLoader.Builder,Closeable,org.elasticsearch.core.Releasable
- All Known Subinterfaces:
BooleanBlock.Builder,BytesRefBlock.Builder,DoubleBlock.Builder,FloatBlock.Builder,IntBlock.Builder,LongBlock.Builder
- All Known Implementing Classes:
AbstractBlockBuilder,AggregateMetricDoubleBlockBuilder,DocBlock.Builder,SingletonLongBuilder,SingletonOrdinalsBuilder,SortedSetOrdinalsBuilder
- Enclosing interface:
Block
public static interface Block.Builder
extends BlockLoader.Builder, org.elasticsearch.core.Releasable
Builds
Blocks. Typically, you use one of it's direct supinterfaces like IntBlock.Builder.
This is Releasable and should be released after building the block or if building the block fails.-
Method Summary
Modifier and TypeMethodDescriptionAppends a null value to the block.Begins a multivalued entry.build()Builds the block.static Block[]buildAll(Block.Builder... builders) Build manyBlocks at once, releasing any partially built blocks if any fail.Copy the values inblockfrombeginInclusivetoendExclusiveinto this builder.Ends the current multi-value entry.longmvOrdering(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.Methods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
appendNull
Block.Builder appendNull()Appends a null value to the block.- Specified by:
appendNullin interfaceBlockLoader.Builder
-
beginPositionEntry
Block.Builder beginPositionEntry()Begins 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 interfaceBlockLoader.Builder
-
endPositionEntry
Block.Builder endPositionEntry()Ends the current multi-value entry.- Specified by:
endPositionEntryin interfaceBlockLoader.Builder
-
copyFrom
Copy the values inblockfrombeginInclusivetoendExclusiveinto this builder.For single position copies use the faster
IntBlock.Builder.copyFrom(IntBlock, int),LongBlock.Builder.copyFrom(LongBlock, int), etc. -
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. 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. -
estimatedBytes
long estimatedBytes() -
build
Block build()Builds the block. This method can be called multiple times.- Specified by:
buildin interfaceBlockLoader.Builder
-
buildAll
Build manyBlocks at once, releasing any partially built blocks if any fail.
-