Package org.apache.druid.segment.data
Class LongsLongEncodingWriter
java.lang.Object
org.apache.druid.segment.data.LongsLongEncodingWriter
- All Implemented Interfaces:
CompressionFactory.LongEncodingWriter
public class LongsLongEncodingWriter
extends Object
implements CompressionFactory.LongEncodingWriter
-
Constructor Summary
Constructors -
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) voidwrite(long[] values, int offset, int length)
-
Constructor Details
-
LongsLongEncodingWriter
-
-
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
-
write
- Specified by:
writein interfaceCompressionFactory.LongEncodingWriter- Throws:
IOException
-
flush
public void flush()Description copied from interface:CompressionFactory.LongEncodingWriterFlush the unwritten content to the current output.- Specified by:
flushin interfaceCompressionFactory.LongEncodingWriter
-
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
-