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 Modifier and Type Field Description static byteVERSION
-
Constructor Summary
Constructors Constructor Description VSizeColumnarInts(ByteBuffer buffer, int numBytes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()intcompareTo(VSizeColumnarInts o)static VSizeColumnarIntsfromArray(int[] array)static VSizeColumnarIntsfromArray(int[] array, int maxValue)static VSizeColumnarIntsfromIndexedInts(IndexedInts ints, int maxValue)ColumnarIntsget()intget(int index)intgetNumBytes()static bytegetNumBytesForMax(int maxValue)intgetNumBytesNoPadding()longgetSerializedSize()Returns 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.java.util.common.io.smoosh.FileSmoosher)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()voidwriteBytesNoPaddingTo(HeapByteBufferWriteOutBytes out)voidwriteTo(WritableByteChannel channel, FileSmoosher smoosher)Writes serialized form of this object to the given channel.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.segment.data.IndexedInts
debugToString, forEach, get, get
-
-
-
-
Field Detail
-
VERSION
public static final byte VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VSizeColumnarInts
public VSizeColumnarInts(ByteBuffer buffer, int numBytes)
-
-
Method Detail
-
fromArray
public static VSizeColumnarInts fromArray(int[] array)
-
fromArray
public static VSizeColumnarInts fromArray(int[] array, int maxValue)
-
fromIndexedInts
public static VSizeColumnarInts fromIndexedInts(IndexedInts ints, int maxValue)
-
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
public void writeBytesNoPaddingTo(HeapByteBufferWriteOutBytes out)
-
compareTo
public int compareTo(VSizeColumnarInts o)
- 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.java.util.common.io.smoosh.FileSmoosher)call.- Specified by:
getSerializedSizein interfaceSerializer
-
writeTo
public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException
Description copied from interface:SerializerWrites serialized form of this object to the given channel. If parallel data streams are needed, they could be created with the provided smoosher.- Specified by:
writeToin interfaceSerializer- Throws:
IOException
-
get
public ColumnarInts get()
- Specified by:
getin interfacecom.google.common.base.Supplier<ColumnarInts>- Specified by:
getin interfaceSupplier<ColumnarInts>
-
readFromByteBuffer
public static VSizeColumnarInts readFromByteBuffer(ByteBuffer buffer)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
inspectRuntimeShape
public void inspectRuntimeShape(RuntimeShapeInspector inspector)
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
-
-