Package 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 Description StreamStateStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SystemKeyspace.AvailableRanges
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)
-
-
-
Method Detail
-
getAvailableRanges
public SystemKeyspace.AvailableRanges 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. This doesn't handle transientness in a useful way so it's only used by a legacy test- Parameters:
keyspace
- keyspace nametoken
- 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 interfaceStreamEventHandler
- Parameters:
event
- Stream event.- See Also:
StreamEvent.Type
-
onSuccess
public void onSuccess(StreamState streamState)
- Specified by:
onSuccess
in interfacecom.google.common.util.concurrent.FutureCallback<StreamState>
-
onFailure
public void onFailure(java.lang.Throwable throwable)
- Specified by:
onFailure
in interfacecom.google.common.util.concurrent.FutureCallback<StreamState>
-
-