org.apache.cassandra.dht

## Class StreamStateStore

- java.lang.Object
- - org.apache.cassandra.dht.StreamStateStore

All Implemented Interfaces:
  com.google.common.util.concurrent.FutureCallback<StreamState>, StreamEventHandler

    public class StreamStateStore
    extends java.lang.Object
    implements StreamEventHandler

Store and update available ranges (data already received) to system keyspace.

### Constructor Summary

Constructors
Constructor and Description
`StreamStateStore()`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.util.Set<Range<Token>>` `getAvailableRanges(java.lang.String keyspace, IPartitioner partitioner)`
`void` `handleStreamEvent(StreamEvent event)` When StreamSession completes, make all keyspaces/ranges in session available to be served.
`boolean` `isDataAvailable(java.lang.String keyspace, Token token)` Check if given token's data is available in this node.
`void` `onFailure(java.lang.Throwable throwable)`
`void` `onSuccess(StreamState streamState)`

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

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

### Constructor Detail

#### StreamStateStore

    public StreamStateStore()

### Method Detail

#### getAvailableRanges

    public java.util.Set<Range<Token>> getAvailableRanges(java.lang.String keyspace,
                                                          IPartitioner partitioner)

#### isDataAvailable

    public boolean isDataAvailable(java.lang.String keyspace,
                                   Token token)

Check if given token's data is available in this node.

Parameters:
  `keyspace` - keyspace name
  `token` - token to check
Returns:
  true if given token in the keyspace is already streamed and ready to be served.

#### handleStreamEvent

    public void handleStreamEvent(StreamEvent event)

When StreamSession completes, make all keyspaces/ranges in session available to be served.

Specified by:
  `handleStreamEvent` in interface `StreamEventHandler`
Parameters:
  `event` - Stream event.
See Also:
  `StreamEvent.Type`

#### onSuccess

    public void onSuccess(StreamState streamState)

Specified by:
  `onSuccess` in interface `com.google.common.util.concurrent.FutureCallback<StreamState>`

#### onFailure

    public void onFailure(java.lang.Throwable throwable)

Specified by:
  `onFailure` in interface `com.google.common.util.concurrent.FutureCallback<StreamState>`