Class CassandraStreamWriter
- java.lang.Object
-
- org.apache.cassandra.db.streaming.CassandraStreamWriter
-
- Direct Known Subclasses:
CassandraCompressedStreamWriter
public class CassandraStreamWriter extends java.lang.ObjectCassandraStreamWriter writes given section of the SSTable to given channel.
-
-
Field Summary
Fields Modifier and Type Field Description protected StreamManager.StreamRateLimiterlimiterprotected java.util.Collection<SSTableReader.PartitionPositionBounds>sectionsprotected StreamSessionsessionprotected SSTableReadersstable
-
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 longtotalSize()protected longwrite(ChannelProxy proxy, DataIntegrityMetadata.ChecksumValidator validator, StreamingDataOutputPlus output, long start, int transferOffset, int toTransfer, int bufferSize)Sequentially read bytes from the file and write them to the output streamvoidwrite(StreamingDataOutputPlus out)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(StreamingDataOutputPlus out) throws java.io.IOException
Stream file of specified sections to given channel.- Parameters:
out- 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, StreamingDataOutputPlus 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 theproxyfile.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
-
-