Class FixedByteChunkForwardIndexWriter
- java.lang.Object
-
- org.apache.pinot.segment.local.io.writer.impl.BaseChunkForwardIndexWriter
-
- org.apache.pinot.segment.local.io.writer.impl.FixedByteChunkForwardIndexWriter
-
- All Implemented Interfaces:
Closeable,AutoCloseable
@NotThreadSafe public class FixedByteChunkForwardIndexWriter extends BaseChunkForwardIndexWriter
Chunk-based raw (non-dictionary-encoded) forward index writer where each chunk contains fixed number of docs, and each entry has fixed number of bytes.
-
-
Field Summary
-
Fields inherited from class org.apache.pinot.segment.local.io.writer.impl.BaseChunkForwardIndexWriter
_chunkBuffer, _chunkCompressor, _chunkSize, _compressedBuffer, _dataFile, _dataOffset, _header
-
-
Constructor Summary
Constructors Constructor Description FixedByteChunkForwardIndexWriter(File file, ChunkCompressionType compressionType, int totalDocs, int numDocsPerChunk, int sizeOfEntry, int writerVersion)Constructor for the class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidputDouble(double value)voidputFloat(float value)voidputInt(int value)voidputLong(long value)protected voidwriteChunk()Helper method to compress and write the current chunk.-
Methods inherited from class org.apache.pinot.segment.local.io.writer.impl.BaseChunkForwardIndexWriter
close
-
-
-
-
Constructor Detail
-
FixedByteChunkForwardIndexWriter
public FixedByteChunkForwardIndexWriter(File file, ChunkCompressionType compressionType, int totalDocs, int numDocsPerChunk, int sizeOfEntry, int writerVersion) throws IOException
Constructor for the class.- Parameters:
file- File to write to.compressionType- Type of compression to use.totalDocs- Total number of docs to write.numDocsPerChunk- Number of documents per chunk.sizeOfEntry- Size of entry (in bytes)writerVersion- writer format version- Throws:
FileNotFoundException- ThrowsFileNotFoundExceptionif the specified file is not found.IOException- ThrowsIOExceptionif there are any errors mapping the underlying ByteBuffer.
-
-
Method Detail
-
putInt
public void putInt(int value)
-
putLong
public void putLong(long value)
-
putFloat
public void putFloat(float value)
-
putDouble
public void putDouble(double value)
-
writeChunk
protected void writeChunk()
Description copied from class:BaseChunkForwardIndexWriterHelper method to compress and write the current chunk.- Chunk header is of fixed size, so fills out any remaining offsets for partially filled chunks.
- Compresses (if required) and writes the chunk to the data file.
- Updates the header with the current chunks offset.
- Clears up the buffers, so that they can be reused.
- Overrides:
writeChunkin classBaseChunkForwardIndexWriter
-
-