Class BaseChunkSVForwardIndexWriter

    • Field Detail

      • _chunkBuffer

        protected final ByteBuffer _chunkBuffer
      • _compressedBuffer

        protected final ByteBuffer _compressedBuffer
      • _chunkSize

        protected int _chunkSize
      • _dataOffset

        protected long _dataOffset
    • Constructor Detail

      • BaseChunkSVForwardIndexWriter

        protected BaseChunkSVForwardIndexWriter​(File file,
                                                ChunkCompressionType compressionType,
                                                int totalDocs,
                                                int numDocsPerChunk,
                                                long chunkSize,
                                                int sizeOfEntry,
                                                int version,
                                                boolean fixed)
                                         throws IOException
        Constructor for the class.
        Parameters:
        file - Data file to write into
        compressionType - Type of compression
        totalDocs - Total docs to write
        numDocsPerChunk - Number of docs per data chunk
        chunkSize - Size of chunk
        sizeOfEntry - Size of entry (in bytes), max size for variable byte implementation.
        version - version of File
        fixed - if the data type is fixed width (required for version validation)
        Throws:
        IOException - if the file isn't found or can't be mapped
    • Method Detail

      • getHeaderEntryChunkOffsetSize

        public static int getHeaderEntryChunkOffsetSize​(int version)
      • writeChunk

        protected void writeChunk()
        Helper 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.