StreamReader (apache-cassandra API)
Date: 2018-02-12

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.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.UUID` | `cfId`
    `protected Descriptor` | `desc`
    `protected long` | `estimatedKeys`
    `protected int` | `fileSeqNum`
    `protected SSTableFormat.Type` | `format`
    `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
    Modifier and Type | Method and Description
    --- | ---
    `protected SSTableWriter` | `createWriter(ColumnFamilyStore cfs, long totalSize, long repairedAt, SSTableFormat.Type format)`
    `SSTableWriter` | `read(java.nio.channels.ReadableByteChannel channel)`
    `protected long` | `totalSize()`
    `protected void` | `writeRow(DecoratedKey key, SSTableWriter writer, java.io.DataInput in, ColumnFamilyStore cfs)`

    - ### 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

    - #### fileSeqNum

          protected final int fileSeqNum

    - #### desc

          protected Descriptor desc

  - ### Constructor Detail

    - #### StreamReader

          public StreamReader(FileMessageHeader header,
                              StreamSession session)

  - ### Method Detail

    - #### read

          public SSTableWriter 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.

    - #### createWriter

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

      Throws:
        `java.io.IOException`

    - #### totalSize

          protected long totalSize()

    - #### writeRow

          protected void writeRow(DecoratedKey key,
                                  SSTableWriter writer,
                                  java.io.DataInput in,
                                  ColumnFamilyStore cfs)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2018 The Apache Software Foundation