Class CassandraStreamReader
- java.lang.Object
-
- org.apache.cassandra.db.streaming.CassandraStreamReader
-
- All Implemented Interfaces:
IStreamReader
- Direct Known Subclasses:
CassandraCompressedStreamReader
public class CassandraStreamReader extends java.lang.Object implements IStreamReader
CassandraStreamReader reads from stream and writes to SSTable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CassandraStreamReader.StreamDeserializer
-
Field Summary
Fields Modifier and Type Field Description protected long
estimatedKeys
protected int
fileSeqNum
protected SerializationHeader.Component
header
protected Version
inputVersion
protected TimeUUID
pendingRepair
protected long
repairedAt
protected java.util.Collection<SSTableReader.PartitionPositionBounds>
sections
protected StreamSession
session
protected int
sstableLevel
protected TableId
tableId
-
Constructor Summary
Constructors Constructor Description CassandraStreamReader(StreamMessageHeader header, CassandraStreamHeader streamHeader, StreamSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SSTableMultiWriter
createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, TimeUUID pendingRepair, SSTableFormat<?,?> format)
protected SerializationHeader
getHeader(TableMetadata metadata)
SSTableMultiWriter
read(DataInputPlus inputPlus)
protected long
totalSize()
protected void
writePartition(CassandraStreamReader.StreamDeserializer deserializer, SSTableMultiWriter writer)
-
-
-
Field Detail
-
tableId
protected final TableId tableId
-
estimatedKeys
protected final long estimatedKeys
-
sections
protected final java.util.Collection<SSTableReader.PartitionPositionBounds> sections
-
session
protected final StreamSession session
-
inputVersion
protected final Version inputVersion
-
repairedAt
protected final long repairedAt
-
pendingRepair
protected final TimeUUID pendingRepair
-
sstableLevel
protected final int sstableLevel
-
header
protected final SerializationHeader.Component header
-
fileSeqNum
protected final int fileSeqNum
-
-
Constructor Detail
-
CassandraStreamReader
public CassandraStreamReader(StreamMessageHeader header, CassandraStreamHeader streamHeader, StreamSession session)
-
-
Method Detail
-
read
public SSTableMultiWriter read(DataInputPlus inputPlus) throws java.lang.Throwable
- Specified by:
read
in interfaceIStreamReader
- Parameters:
inputPlus
- where this reads data from- Returns:
- SSTable transferred
- Throws:
java.io.IOException
- if reading the remote sstable fails. Will throw an RTE if local write fails.java.lang.Throwable
-
getHeader
protected SerializationHeader getHeader(TableMetadata metadata) throws UnknownColumnException
- Throws:
UnknownColumnException
-
createWriter
protected SSTableMultiWriter createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, TimeUUID pendingRepair, SSTableFormat<?,?> format) throws java.io.IOException
- Throws:
java.io.IOException
-
totalSize
protected long totalSize()
-
writePartition
protected void writePartition(CassandraStreamReader.StreamDeserializer deserializer, SSTableMultiWriter writer) throws java.io.IOException
- Throws:
java.io.IOException
-
-