Package org.apache.druid.segment.data
Interface CompressionFactory.LongEncodingWriter
-
- All Known Implementing Classes:
DeltaLongEncodingWriter,LongsLongEncodingWriter,TableLongEncodingWriter
- Enclosing class:
- CompressionFactory
public static interface CompressionFactory.LongEncodingWriterThis writer output encoded values to the given ByteBuffer or OutputStream.setBuffer(ByteBuffer)orsetOutputStream(WriteOutBytes)must be called before any value is written, andflush()must be called before calling setBuffer or setOutputStream again to set another output.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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)default voidwrite(long[] values, int offset, int length)
-
-
-
Method Detail
-
setBuffer
void setBuffer(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.
-
setOutputStream
void setOutputStream(WriteOutBytes output)
-
write
void write(long value) throws IOException- Throws:
IOException
-
write
default void write(long[] values, int offset, int length) throws IOException- Throws:
IOException
-
flush
void flush() throws IOExceptionFlush the unwritten content to the current output.- Throws:
IOException
-
putMeta
void putMeta(ByteBuffer metaOut, CompressionStrategy strategy)
Output 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.
-
metaSize
int metaSize()
-
getBlockSize
int getBlockSize(int bytesPerBlock)
Get the number of values that can be encoded into each block for the given block size in bytes
-
getNumBytes
int getNumBytes(int values)
Get the number of bytes required to encoding the given number of values
-
-