Package org.apache.druid.segment.data
Class VSizeColumnarInts
java.lang.Object
org.apache.druid.segment.data.VSizeColumnarInts
- All Implemented Interfaces:
com.google.common.base.Supplier<ColumnarInts>,Closeable,AutoCloseable,Comparable<VSizeColumnarInts>,Supplier<ColumnarInts>,HotLoopCallee,ColumnarInts,IndexedInts,WritableSupplier<ColumnarInts>,Serializer
public class VSizeColumnarInts
extends Object
implements ColumnarInts, Comparable<VSizeColumnarInts>, WritableSupplier<ColumnarInts>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intstatic VSizeColumnarIntsfromArray(int[] array) static VSizeColumnarIntsfromArray(int[] array, int maxValue) static VSizeColumnarIntsfromIndexedInts(IndexedInts ints, int maxValue) get()intget(int index) intstatic bytegetNumBytesForMax(int maxValue) intlongReturns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on aSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.segment.file.SegmentFileBuilder)call.voidinspectRuntimeShape(RuntimeShapeInspector inspector) Implementations of this method should callinspector.visit()with all fields of this class, which meet two conditions: 1.static VSizeColumnarIntsreadFromByteBuffer(ByteBuffer buffer) intsize()voidvoidwriteTo(WritableByteChannel channel, SegmentFileBuilder fileBuilder) Writes the serialized form of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.segment.data.ColumnarInts
getMethods inherited from interface org.apache.druid.segment.data.IndexedInts
debugToString, forEach, get, get
-
Field Details
-
VERSION
public static final byte VERSION- See Also:
-
-
Constructor Details
-
VSizeColumnarInts
-
-
Method Details
-
fromArray
-
fromArray
-
fromIndexedInts
-
getNumBytesForMax
public static byte getNumBytesForMax(int maxValue) -
size
public int size()- Specified by:
sizein interfaceIndexedInts
-
get
public int get(int index) - Specified by:
getin interfaceIndexedInts
-
getNumBytesNoPadding
public int getNumBytesNoPadding() -
writeBytesNoPaddingTo
-
compareTo
- Specified by:
compareToin interfaceComparable<VSizeColumnarInts>
-
getNumBytes
public int getNumBytes() -
getSerializedSize
public long getSerializedSize()Description copied from interface:SerializerReturns the number of bytes, that this Serializer will write to the output _channel_ (not smoosher) on aSerializer.writeTo(java.nio.channels.WritableByteChannel, org.apache.druid.segment.file.SegmentFileBuilder)call.- Specified by:
getSerializedSizein interfaceSerializer
-
writeTo
Description copied from interface:SerializerWrites the serialized form of this object. The entire object may be written to the provided channel, or the object may be split over the provided channel and files added to the {@link SegmentFileBuilder], where additional channels can be created viaSegmentFileBuilder.addWithChannel(String, long). The latter approach is useful when the serialized form of the object is too large for a single smoosh container. At the time this javadoc was written, the max smoosh container size is limit to the maxByteBuffersize.- Specified by:
writeToin interfaceSerializer- Throws:
IOException
-
get
- Specified by:
getin interfacecom.google.common.base.Supplier<ColumnarInts>- Specified by:
getin interfaceSupplier<ColumnarInts>
-
readFromByteBuffer
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
inspectRuntimeShape
Description copied from interface:HotLoopCalleeImplementations of this method should callinspector.visit()with all fields of this class, which meet two conditions: 1. They are used in methods of this class, annotated withCalledFromHotLoop2. They are either: a. Nullable objects b. Instances of HotLoopCallee c. Objects, which don't always have a specific class in runtime. For example, a field of typeSetcould beHashSetorTreeSetin runtime, depending on how this instance (the instance on which inspectRuntimeShape() is called) is configured. d. ByteBuffer or similar objects, where byte order matters e. boolean flags, affecting branch taking f. Arrays of objects, meeting any of conditions a-e.- Specified by:
inspectRuntimeShapein interfaceHotLoopCallee
-