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
Constructors Constructor Description TableLongEncodingWriter(it.unimi.dsi.fastutil.longs.Long2IntMap table, it.unimi.dsi.fastutil.longs.LongList valueAddedInOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflush()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, wait
-
Methods inherited from interface org.apache.druid.segment.data.CompressionFactory.LongEncodingWriter
write
-
-
-
-
Method Detail
-
setBuffer
public void setBuffer(ByteBuffer buffer)
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
public void setOutputStream(WriteOutBytes output)
- Specified by:
setOutputStreamin interfaceCompressionFactory.LongEncodingWriter
-
write
public void write(long value) throws IOException- Specified by:
writein interfaceCompressionFactory.LongEncodingWriter- Throws:
IOException
-
flush
public void flush() throws IOExceptionDescription copied from interface:CompressionFactory.LongEncodingWriterFlush the unwritten content to the current output.- Specified by:
flushin interfaceCompressionFactory.LongEncodingWriter- Throws:
IOException
-
putMeta
public void putMeta(ByteBuffer metaOut, CompressionStrategy strategy)
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
-
-