Class CassandraStreamWriter

  • Direct Known Subclasses:
    CassandraCompressedStreamWriter

    public class CassandraStreamWriter
    extends java.lang.Object
    CassandraStreamWriter writes given section of the SSTable to given channel.
    • Method Detail

      • write

        public void write​(DataOutputStreamPlus output)
                   throws java.io.IOException
        Stream file of specified sections to given channel. CassandraStreamWriter uses LZF compression on wire to decrease size to transfer.
        Parameters:
        output - where this writes data to
        Throws:
        java.io.IOException - on any I/O error
      • totalSize

        protected long totalSize()
      • write

        protected long write​(ChannelProxy proxy,
                             DataIntegrityMetadata.ChecksumValidator validator,
                             AsyncStreamingOutputPlus output,
                             long start,
                             int transferOffset,
                             int toTransfer,
                             int bufferSize)
                      throws java.io.IOException
        Sequentially read bytes from the file and write them to the output stream
        Parameters:
        proxy - The file reader to read from
        validator - validator to verify data integrity
        start - The readd offset from the beginning of the proxy file.
        transferOffset - number of bytes to skip transfer, but include for validation.
        toTransfer - The number of bytes to be transferred.
        Returns:
        Number of bytes transferred.
        Throws:
        java.io.IOException - on any I/O error