Class CassandraStreamWriter
java.lang.Object
org.apache.cassandra.db.streaming.CassandraStreamWriter
- Direct Known Subclasses:
CassandraCompressedStreamWriter
CassandraStreamWriter writes given section of the SSTable to given channel.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StreamManager.StreamRateLimiterprotected final Collection<SSTableReader.PartitionPositionBounds>protected final StreamSessionprotected final SSTableReader -
Constructor Summary
ConstructorsConstructorDescriptionCassandraStreamWriter(SSTableReader sstable, CassandraStreamHeader header, StreamSession session) -
Method Summary
Modifier and TypeMethodDescriptionprotected longprotected 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 streamvoidStream file of specified sections to given channel.
-
Field Details
-
sstable
-
sections
-
limiter
-
session
-
-
Constructor Details
-
CassandraStreamWriter
public CassandraStreamWriter(SSTableReader sstable, CassandraStreamHeader header, StreamSession session)
-
-
Method Details
-
write
Stream file of specified sections to given channel.- Parameters:
out- where this writes data to- Throws:
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 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:
IOException- on any I/O error
-