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 Object implements StreamEventHandler
Store and update available ranges (data already received) to system keyspace.
  • Constructor Details

    • StreamStateStore

      public StreamStateStore()
  • Method Details

    • getAvailableRanges

      public SystemKeyspace.AvailableRanges getAvailableRanges(String keyspace, IPartitioner partitioner)
    • isDataAvailable

      public boolean isDataAvailable(String keyspace, Token token)
      Check if given token's data is available in this node. This doesn't handle transientness in a useful way so it's only used by a legacy test
      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:
    • onSuccess

      public void onSuccess(StreamState streamState)
      Specified by:
      onSuccess in interface com.google.common.util.concurrent.FutureCallback<StreamState>
    • onFailure

      public void onFailure(Throwable throwable)
      Specified by:
      onFailure in interface com.google.common.util.concurrent.FutureCallback<StreamState>