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() |
boolean |
isCancelled() |
boolean |
isCompletedSuccessfully() |
boolean |
isStartedSuccessfully() |
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()
true
if the transfer was started, otherwise false
public void cancelSegments(Set<Integer> cancelledSegments)
cancelledSegments
- the segments to be cancelledpublic void cancel()
public boolean isCancelled()
public void onStateReceived(int segmentId, boolean isLastChunk)
public boolean awaitCompletion() throws InterruptedException
terminate()
.InterruptedException
- if the thread is interrupted while waitingpublic boolean isCompletedSuccessfully()
public boolean isStartedSuccessfully()
public void terminate()
Copyright © 2022 JBoss, a division of Red Hat. All rights reserved.