Package org.apache.cassandra.streaming
Class StreamingState
- java.lang.Object
-
- org.apache.cassandra.streaming.StreamingState
-
- All Implemented Interfaces:
com.google.common.util.concurrent.FutureCallback<StreamState>
,IMeasurableMemory
,StreamEventHandler
public class StreamingState extends java.lang.Object implements StreamEventHandler, IMeasurableMemory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
StreamingState.Phase
static class
StreamingState.Sessions
static class
StreamingState.Status
-
Field Summary
Fields Modifier and Type Field Description static long
EMPTY
StreamingState.Phase
phase
-
Constructor Summary
Constructors Constructor Description StreamingState(StreamResultFuture result)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
completeMessage()
long
durationMillis()
java.lang.String
failureCause()
boolean
follower()
StreamResultFuture
future()
void
handleStreamEvent(StreamEvent event)
Callback for various streaming events.TimeUUID
id()
boolean
isComplete()
long
lastUpdatedAtMillis()
long
lastUpdatedAtNanos()
void
onFailure(java.lang.Throwable throwable)
void
onSuccess(StreamState state)
StreamOperation
operation()
java.util.Set<java.net.InetSocketAddress>
peers()
float
progress()
StreamingState.Sessions
sessions()
java.util.EnumMap<StreamingState.Status,java.lang.Long>
stateTimesMillis()
StreamingState.Status
status()
java.lang.String
successMessage()
java.lang.String
toString()
long
unsharedHeapSize()
-
-
-
Field Detail
-
EMPTY
public static final long EMPTY
-
phase
public final StreamingState.Phase phase
-
-
Constructor Detail
-
StreamingState
public StreamingState(StreamResultFuture result)
-
-
Method Detail
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSize
in interfaceIMeasurableMemory
- Returns:
- the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
-
id
public TimeUUID id()
-
follower
public boolean follower()
-
operation
public StreamOperation operation()
-
peers
public java.util.Set<java.net.InetSocketAddress> peers()
-
completeMessage
public java.lang.String completeMessage()
-
status
public StreamingState.Status status()
-
sessions
public StreamingState.Sessions sessions()
-
isComplete
public boolean isComplete()
-
future
public StreamResultFuture future()
-
progress
public float progress()
-
stateTimesMillis
public java.util.EnumMap<StreamingState.Status,java.lang.Long> stateTimesMillis()
-
durationMillis
public long durationMillis()
-
lastUpdatedAtMillis
public long lastUpdatedAtMillis()
-
lastUpdatedAtNanos
public long lastUpdatedAtNanos()
-
failureCause
public java.lang.String failureCause()
-
successMessage
public java.lang.String successMessage()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
handleStreamEvent
public void handleStreamEvent(StreamEvent event)
Description copied from interface:StreamEventHandler
Callback for various streaming events.- Specified by:
handleStreamEvent
in interfaceStreamEventHandler
- Parameters:
event
- Stream event.- See Also:
StreamEvent.Type
-
onSuccess
public void onSuccess(@Nullable StreamState state)
- 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>
-
-