public class PeerRecoveryTargetService extends AbstractComponent implements IndexEventListener
Note, it can be safely assumed that there will only be a single recovery per shard (index+id) and not several of them (since we don't allocate several shard replicas to the same node).
Modifier and Type | Class and Description |
---|---|
static class |
PeerRecoveryTargetService.Actions |
static interface |
PeerRecoveryTargetService.RecoveryListener |
deprecationLogger, logger, settings
Constructor and Description |
---|
PeerRecoveryTargetService(Settings settings,
ThreadPool threadPool,
TransportService transportService,
RecoverySettings recoverySettings,
ClusterService clusterService) |
Modifier and Type | Method and Description |
---|---|
void |
beforeIndexShardClosed(ShardId shardId,
IndexShard indexShard,
Settings indexSettings)
Called before the index shard gets closed.
|
static long |
getStartingSeqNo(RecoveryTarget recoveryTarget)
Get the starting sequence number for a sequence-number-based request.
|
protected void |
retryRecovery(long recoveryId,
java.lang.String reason,
TimeValue retryAfter,
TimeValue activityTimeout) |
protected void |
retryRecovery(long recoveryId,
java.lang.Throwable reason,
TimeValue retryAfter,
TimeValue activityTimeout) |
void |
startRecovery(IndexShard indexShard,
DiscoveryNode sourceNode,
PeerRecoveryTargetService.RecoveryListener listener) |
logDeprecatedSetting, logRemovedSetting, nodeName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterIndexCreated, afterIndexRemoved, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardCreated, beforeIndexShardDeleted, indexShardStateChanged, onShardInactive, onStoreClosed, shardRoutingChanged
public PeerRecoveryTargetService(Settings settings, ThreadPool threadPool, TransportService transportService, RecoverySettings recoverySettings, ClusterService clusterService)
public void beforeIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings)
IndexEventListener
beforeIndexShardClosed
in interface IndexEventListener
indexShard
- The index shardpublic void startRecovery(IndexShard indexShard, DiscoveryNode sourceNode, PeerRecoveryTargetService.RecoveryListener listener)
protected void retryRecovery(long recoveryId, java.lang.Throwable reason, TimeValue retryAfter, TimeValue activityTimeout)
protected void retryRecovery(long recoveryId, java.lang.String reason, TimeValue retryAfter, TimeValue activityTimeout)
public static long getStartingSeqNo(RecoveryTarget recoveryTarget)
recoveryTarget
- the target of the recoverySequenceNumbers.UNASSIGNED_SEQ_NO
if obtaining the starting sequence number
failed