Module org.elasticsearch.server
Class PeerRecoverySourceService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.indices.recovery.PeerRecoverySourceService
- All Implemented Interfaces:
Closeable,AutoCloseable,ClusterStateListener,LifecycleComponent,Releasable,IndexEventListener
public class PeerRecoverySourceService
extends AbstractLifecycleComponent
implements IndexEventListener, ClusterStateListener
The source recovery accepts recovery requests from other peer shards and start the recovery process from this
source shard to the target shard.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle -
Constructor Summary
ConstructorsConstructorDescriptionPeerRecoverySourceService(TransportService transportService, IndicesService indicesService, RecoverySettings recoverySettings, RecoveryPlannerService recoveryPlannerService) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeIndexShardClosed(ShardId shardId, IndexShard indexShard, Settings indexSettings) Called before the index shard gets closed.voidCalled when cluster state changes.protected voiddoClose()protected voiddoStart()protected voiddoStop()Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.shard.IndexEventListener
afterFilesRestoredFromRepository, afterIndexCreated, afterIndexRemoved, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardCreated, beforeIndexShardDeleted, beforeIndexShardRecovery, indexShardStateChanged, onStoreClosed, onStoreCreated, shardRoutingChanged
-
Constructor Details
-
PeerRecoverySourceService
@Inject public PeerRecoverySourceService(TransportService transportService, IndicesService indicesService, RecoverySettings recoverySettings, RecoveryPlannerService recoveryPlannerService)
-
-
Method Details
-
doStart
protected void doStart()- Specified by:
doStartin classAbstractLifecycleComponent
-
doStop
protected void doStop()- Specified by:
doStopin classAbstractLifecycleComponent
-
doClose
protected void doClose()- Specified by:
doClosein classAbstractLifecycleComponent
-
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
-
clusterChanged
Description copied from interface:ClusterStateListenerCalled when cluster state changes.Cluster states are applied one-by-one which means they can be a performance bottleneck. Implementations of this method should therefore be fast, so please consider forking work into the background rather than doing everything inline.
- Specified by:
clusterChangedin interfaceClusterStateListener
-