public class InboundTransferTask extends Object
Constructor and Description |
---|
InboundTransferTask(Set<Integer> segments,
Address source,
int topologyId,
StateConsumerImpl stateConsumer,
RpcManager rpcManager,
CommandsFactory commandsFactory,
long timeout,
String cacheName) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitCompletion()
Wait until all segments are received, cancelled, or the task is terminated abruptly by
terminate() . |
void |
cancel() |
void |
cancelSegments(Set<Integer> cancelledSegments)
Cancels a subset of the segments.
|
Set<Integer> |
getSegments() |
Address |
getSource() |
Set<Integer> |
getUnfinishedSegments() |
void |
onStateReceived(int segmentId,
boolean isLastChunk) |
boolean |
requestSegments()
Send START_STATE_TRANSFER request to source node.
|
void |
terminate()
Terminate abruptly regardless if the segments were received or not.
|
String |
toString() |
public InboundTransferTask(Set<Integer> segments, Address source, int topologyId, StateConsumerImpl stateConsumer, RpcManager rpcManager, CommandsFactory commandsFactory, long timeout, String cacheName)
public Address getSource()
public boolean requestSegments()
public void cancelSegments(Set<Integer> cancelledSegments)
cancelledSegments
- the segments to be cancelledpublic void cancel()
public void onStateReceived(int segmentId, boolean isLastChunk)
public boolean awaitCompletion() throws InterruptedException
terminate()
.InterruptedException
- if the thread is interrupted while waitingpublic void terminate()
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.