Module org.elasticsearch.compute
Class SingletonLongBuilder
java.lang.Object
org.elasticsearch.compute.lucene.read.SingletonLongBuilder
- All Implemented Interfaces:
Closeable,AutoCloseable,Block.Builder,org.elasticsearch.core.Releasable,BlockLoader.Builder,BlockLoader.SingletonLongBuilder
public final class SingletonLongBuilder
extends Object
implements BlockLoader.SingletonLongBuilder, org.elasticsearch.core.Releasable, Block.Builder
Like
LongBlockBuilder but optimized for collecting dense single valued values.
Additionally, this builder doesn't grow its array.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendLong(long value) appendLongs(long[] values, int from, int length) Appends a null value to the block.Begins a multivalued entry.build()Builds the block.voidclose()Copy the values inblockfrombeginInclusivetoendExclusiveinto this builder.Ends the current multi-value entry.longAn estimate of the number of bytes theBlockcreated byBlock.Builder.build()will use.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.
-
Constructor Details
-
SingletonLongBuilder
-
-
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
-
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
-
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
-
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
-
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
-
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
-
appendLong
- Specified by:
appendLongin interfaceBlockLoader.SingletonLongBuilder
-
appendLongs
- Specified by:
appendLongsin interfaceBlockLoader.SingletonLongBuilder
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-