Class PeerRecoveryTargetService
- java.lang.Object
-
- org.elasticsearch.indices.recovery.PeerRecoveryTargetService
-
- All Implemented Interfaces:
IndexEventListener
public class PeerRecoveryTargetService extends java.lang.Object implements IndexEventListener
The recovery target handles recoveries of peer shards of the shard+node to recover to.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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPeerRecoveryTargetService.Actionsstatic interfacePeerRecoveryTargetService.RecoveryListener
-
Constructor Summary
Constructors Constructor Description PeerRecoveryTargetService(ThreadPool threadPool, TransportService transportService, RecoverySettings recoverySettings, ClusterService clusterService)
-
Method Summary
Modifier and Type Method Description voidbeforeIndexShardClosed(ShardId shardId, IndexShard indexShard, Settings indexSettings)Called before the index shard gets closed.static StartRecoveryRequestgetStartRecoveryRequest(RecoveryTarget recoveryTarget, DiscoveryNode localNode, org.apache.logging.log4j.Logger logger)Prepare the start recovery request.protected voidretryRecovery(long recoveryId, java.lang.String reason, TimeValue retryAfter, TimeValue activityTimeout)protected voidretryRecovery(long recoveryId, java.lang.Throwable reason, TimeValue retryAfter, TimeValue activityTimeout)voidstartRecovery(IndexShard indexShard, DiscoveryNode sourceNode, PeerRecoveryTargetService.RecoveryListener listener)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.index.shard.IndexEventListener
afterIndexCreated, afterIndexRemoved, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardCreated, beforeIndexShardDeleted, indexShardStateChanged, onShardInactive, onStoreClosed, shardRoutingChanged
-
-
-
-
Constructor Detail
-
PeerRecoveryTargetService
public PeerRecoveryTargetService(ThreadPool threadPool, TransportService transportService, RecoverySettings recoverySettings, ClusterService clusterService)
-
-
Method Detail
-
beforeIndexShardClosed
public void beforeIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings)
Description copied from interface:IndexEventListenerCalled before the index shard gets closed.- Specified by:
beforeIndexShardClosedin interfaceIndexEventListenerindexShard- The index shard
-
startRecovery
public void startRecovery(IndexShard indexShard, DiscoveryNode sourceNode, PeerRecoveryTargetService.RecoveryListener listener)
-
retryRecovery
protected void retryRecovery(long recoveryId, java.lang.Throwable reason, TimeValue retryAfter, TimeValue activityTimeout)
-
retryRecovery
protected void retryRecovery(long recoveryId, java.lang.String reason, TimeValue retryAfter, TimeValue activityTimeout)
-
getStartRecoveryRequest
public static StartRecoveryRequest getStartRecoveryRequest(RecoveryTarget recoveryTarget, DiscoveryNode localNode, org.apache.logging.log4j.Logger logger)
Prepare the start recovery request.- Parameters:
recoveryTarget- the target of the recovery- Returns:
- a start recovery request
-
-