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.
|
boolean |
cancelRecoveriesForShard(ShardId shardId,
java.lang.String reason)
cancel all ongoing recoveries for the given shard, if their status match a predicate
|
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, nodeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitafterIndexCreated, afterIndexRemoved, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardCreated, beforeIndexShardDeleted, indexShardStateChanged, onShardInactive, onStoreClosed, shardRoutingChangedpublic PeerRecoveryTargetService(Settings settings, ThreadPool threadPool, TransportService transportService, RecoverySettings recoverySettings, ClusterService clusterService)
public void beforeIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings)
IndexEventListenerbeforeIndexShardClosed in interface IndexEventListenerindexShard - The index shardpublic boolean cancelRecoveriesForShard(ShardId shardId, java.lang.String reason)
reason - reason for cancellationshardId - shardId for which to cancel recoveriespublic void startRecovery(IndexShard indexShard, DiscoveryNode sourceNode, PeerRecoveryTargetService.RecoveryListener listener)
protected void retryRecovery(long recoveryId,
java.lang.Throwable reason,
TimeValue retryAfter,
TimeValue activityTimeout)