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

org.apache.cassandra.streaming

## Class StreamReceiveTask

- java.lang.Object
- - org.apache.cassandra.streaming.StreamTask
  - - org.apache.cassandra.streaming.StreamReceiveTask

-     public class StreamReceiveTask
      extends StreamTask

  Task that manages receiving files for the session for certain ColumnFamily.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Collection<SSTableWriter>` | `sstables`

    - ### Fields inherited from class org.apache.cassandra.streaming.StreamTask

      `cfId, session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StreamReceiveTask(StreamSession session, java.util.UUID cfId, int totalFiles, long totalSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `abort()` Abort this task.
    `int` | `getTotalNumberOfFiles()`
    `long` | `getTotalSize()`
    `void` | `received(SSTableWriter sstable)` Process received file.

    - ### Methods inherited from class org.apache.cassandra.streaming.StreamTask

      `getSummary`

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

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

- - ### Field Detail

    - #### sstables

          protected java.util.Collection<SSTableWriter> sstables

  - ### Constructor Detail

    - #### StreamReceiveTask

          public StreamReceiveTask(StreamSession session,
                                   java.util.UUID cfId,
                                   int totalFiles,
                                   long totalSize)

  - ### Method Detail

    - #### received

          public void received(SSTableWriter sstable)

      Process received file.
      Parameters:
        `sstable` - SSTable file received.

    - #### getTotalNumberOfFiles

          public int getTotalNumberOfFiles()

      Specified by:
        `getTotalNumberOfFiles` in class `StreamTask`
      Returns:
        total number of files this task receives/streams.

    - #### getTotalSize

          public long getTotalSize()

      Specified by:
        `getTotalSize` in class `StreamTask`
      Returns:
        total bytes expected to receive

    - #### abort

          public void abort()

      Abort this task. If the task already received all files and `StreamReceiveTask.OnCompletionRunnable` task is submitted, then task cannot be aborted.
      Specified by:
        `abort` in class `StreamTask`

Copyright © 2018 The Apache Software Foundation