Class CompressedSequentialWriter

    • Constructor Detail

      • CompressedSequentialWriter

        public CompressedSequentialWriter​(java.io.File file,
                                          java.lang.String offsetsPath,
                                          java.io.File digestFile,
                                          SequentialWriterOption option,
                                          CompressionParams parameters,
                                          MetadataCollector sstableMetadataCollector)
        Create CompressedSequentialWriter without digest file.
        Parameters:
        file - File to write
        offsetsPath - File name to write compression metadata
        digestFile - File to write digest
        option - Write option (buffer size and type will be set the same as compression params)
        parameters - Compression mparameters
        sstableMetadataCollector - Metadata collector
    • Method Detail

      • getOnDiskFilePointer

        public long getOnDiskFilePointer()
        Description copied from class: SequentialWriter
        Returns the current file pointer of the underlying on-disk file. Note that since write works by buffering data, the value of this will increase by buffer size and not every write to the writer will modify this value. Furthermore, for compressed files, this value refers to compressed data, while the writer getFilePointer() refers to uncompressedFile
        Overrides:
        getOnDiskFilePointer in class SequentialWriter
        Returns:
        the current file pointer
      • getEstimatedOnDiskBytesWritten

        public long getEstimatedOnDiskBytesWritten()
        Get a quick estimation on how many bytes have been written to disk It should for the most part be exactly the same as getOnDiskFilePointer()
        Overrides:
        getEstimatedOnDiskBytesWritten in class SequentialWriter
      • resetAndTruncate

        public void resetAndTruncate​(DataPosition mark)
        Description copied from class: SequentialWriter
        Drops all buffered data that's past the limits of our new file mark + buffer capacity, or syncs and truncates the underlying file to the marked position
        Overrides:
        resetAndTruncate in class SequentialWriter