Package org.apache.druid.segment.data
Class TableLongEncodingWriter
java.lang.Object
org.apache.druid.segment.data.TableLongEncodingWriter
- All Implemented Interfaces:
CompressionFactory.LongEncodingWriter
public class TableLongEncodingWriter
extends Object
implements CompressionFactory.LongEncodingWriter
-
Constructor Summary
ConstructorsConstructorDescriptionTableLongEncodingWriter(it.unimi.dsi.fastutil.longs.Long2IntMap table, it.unimi.dsi.fastutil.longs.LongList valueAddedInOrder) -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Flush the unwritten content to the current output.intgetBlockSize(int bytesPerBlock) Get the number of values that can be encoded into each block for the given block size in bytesintgetNumBytes(int values) Get the number of bytes required to encoding the given number of valuesintmetaSize()voidputMeta(ByteBuffer metaOut, CompressionStrategy strategy) Output the header values of the associating encoding format to the given outputStream.voidsetBuffer(ByteBuffer buffer) Data will be written starting from current position of the buffer, and the position of the buffer will be updated as content is written.voidsetOutputStream(WriteOutBytes output) voidwrite(long value) 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.CompressionFactory.LongEncodingWriter
write
-
Constructor Details
-
TableLongEncodingWriter
public TableLongEncodingWriter(it.unimi.dsi.fastutil.longs.Long2IntMap table, it.unimi.dsi.fastutil.longs.LongList valueAddedInOrder)
-
-
Method Details
-
setBuffer
Description copied from interface:CompressionFactory.LongEncodingWriterData will be written starting from current position of the buffer, and the position of the buffer will be updated as content is written.- Specified by:
setBufferin interfaceCompressionFactory.LongEncodingWriter
-
setOutputStream
- Specified by:
setOutputStreamin interfaceCompressionFactory.LongEncodingWriter
-
write
- Specified by:
writein interfaceCompressionFactory.LongEncodingWriter- Throws:
IOException
-
flush
Description copied from interface:CompressionFactory.LongEncodingWriterFlush the unwritten content to the current output.- Specified by:
flushin interfaceCompressionFactory.LongEncodingWriter- Throws:
IOException
-
putMeta
Description copied from interface:CompressionFactory.LongEncodingWriterOutput the header values of the associating encoding format to the given outputStream. The header also include bytes for compression strategy and encoding format(optional) as described above in Compression Storage Format.- Specified by:
putMetain interfaceCompressionFactory.LongEncodingWriter
-
metaSize
public int metaSize()- Specified by:
metaSizein interfaceCompressionFactory.LongEncodingWriter
-
getBlockSize
public int getBlockSize(int bytesPerBlock) Description copied from interface:CompressionFactory.LongEncodingWriterGet the number of values that can be encoded into each block for the given block size in bytes- Specified by:
getBlockSizein interfaceCompressionFactory.LongEncodingWriter
-
getNumBytes
public int getNumBytes(int values) Description copied from interface:CompressionFactory.LongEncodingWriterGet the number of bytes required to encoding the given number of values- Specified by:
getNumBytesin interfaceCompressionFactory.LongEncodingWriter
-