Class CassandraStreamWriter
- java.lang.Object
-
- org.apache.cassandra.db.streaming.CassandraStreamWriter
-
- Direct Known Subclasses:
CassandraCompressedStreamWriter
public class CassandraStreamWriter extends java.lang.Object
CassandraStreamWriter writes given section of the SSTable to given channel.
-
-
Field Summary
Fields Modifier and Type Field Description protected StreamManager.StreamRateLimiter
limiter
protected java.util.Collection<SSTableReader.PartitionPositionBounds>
sections
protected StreamSession
session
protected SSTableReader
sstable
-
Constructor Summary
Constructors Constructor Description CassandraStreamWriter(SSTableReader sstable, CassandraStreamHeader header, StreamSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
totalSize()
protected long
write(ChannelProxy proxy, DataIntegrityMetadata.ChecksumValidator validator, AsyncStreamingOutputPlus output, long start, int transferOffset, int toTransfer, int bufferSize)
Sequentially read bytes from the file and write them to the output streamvoid
write(DataOutputStreamPlus output)
Stream file of specified sections to given channel.
-
-
-
Field Detail
-
sstable
protected final SSTableReader sstable
-
sections
protected final java.util.Collection<SSTableReader.PartitionPositionBounds> sections
-
limiter
protected final StreamManager.StreamRateLimiter limiter
-
session
protected final StreamSession session
-
-
Constructor Detail
-
CassandraStreamWriter
public CassandraStreamWriter(SSTableReader sstable, CassandraStreamHeader header, StreamSession session)
-
-
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 fromvalidator
- validator to verify data integritystart
- The readd offset from the beginning of theproxy
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
-
-