org.apache.cassandra.streaming

## Class StreamReader

- java.lang.Object
- - org.apache.cassandra.streaming.StreamReader

Direct Known Subclasses:
  CompressedStreamReader

    public class StreamReader
    extends java.lang.Object

StreamReader reads from stream and writes to SSTable.

### Nested Class Summary

Nested Classes
`static class` `StreamReader.StreamDeserializer`

### Field Summary

Fields
`protected java.util.UUID` `cfId`
`protected long` `estimatedKeys`
`protected int` `fileSeqNum`
`protected SSTableFormat.Type` `format`
`protected SerializationHeader.Component` `header`
`protected Version` `inputVersion`
`protected long` `repairedAt`
`protected java.util.Collection<Pair<java.lang.Long,java.lang.Long>>` `sections`
`protected StreamSession` `session`
`protected int` `sstableLevel`

### Constructor Summary

Constructors
Constructor and Description
`StreamReader(FileMessageHeader header, StreamSession session)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected SSTableMultiWriter` `createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, SSTableFormat.Type format)`
`protected SerializationHeader` `getHeader(CFMetaData metadata)`
`SSTableMultiWriter` `read(java.nio.channels.ReadableByteChannel channel)`
`protected long` `totalSize()`
`protected void` `writePartition(StreamReader.StreamDeserializer deserializer, SSTableMultiWriter writer)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### cfId

    protected final java.util.UUID cfId

#### estimatedKeys

    protected final long estimatedKeys

#### sections

    protected final java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections

#### session

    protected final StreamSession session

#### inputVersion

    protected final Version inputVersion

#### repairedAt

    protected final long repairedAt

#### format

    protected final SSTableFormat.Type format

#### sstableLevel

    protected final int sstableLevel

#### header

    protected final SerializationHeader.Component header

#### fileSeqNum

    protected final int fileSeqNum

### Constructor Detail

#### StreamReader

    public StreamReader(FileMessageHeader header,
                        StreamSession session)

### Method Detail

#### read

    public SSTableMultiWriter read(java.nio.channels.ReadableByteChannel channel)
                            throws java.io.IOException

Parameters:
  `channel` - 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.

#### getHeader

    protected SerializationHeader getHeader(CFMetaData metadata)

#### createWriter

    protected SSTableMultiWriter createWriter(ColumnFamilyStore cfs,
                                              long totalSize,
                                              long repairedAt,
                                              SSTableFormat.Type format)
                                       throws java.io.IOException

Throws:
  `java.io.IOException`

#### totalSize

    protected long totalSize()

#### writePartition

    protected void writePartition(StreamReader.StreamDeserializer deserializer,
                                  SSTableMultiWriter writer)
                           throws java.io.IOException

Throws:
  `java.io.IOException`