Package org.elasticsearch.snapshots
Class SnapshotShardsService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.snapshots.SnapshotShardsService
- All Implemented Interfaces:
Closeable,AutoCloseable,ClusterStateListener,LifecycleComponent,org.elasticsearch.core.Releasable,IndexEventListener
public class SnapshotShardsService
extends AbstractLifecycleComponent
implements ClusterStateListener, IndexEventListener
This service runs on data nodes and controls currently running shard snapshots on these nodes. It is responsible for
starting and stopping shard level snapshots.
See package level documentation of
org.elasticsearch.snapshots for details.-
Field Summary
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle -
Constructor Summary
ConstructorsConstructorDescriptionSnapshotShardsService(Settings settings, ClusterService clusterService, RepositoriesService repositoriesService, TransportService transportService, IndicesService indicesService) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeIndexShardClosed(ShardId shardId, IndexShard indexShard, Settings indexSettings)Called before the index shard gets closed.voidCalled when cluster state changes.currentSnapshotShards(Snapshot snapshot)Returns status of shards that are snapshotted on the node and belong to the given snapshotprotected voiddoClose()protected voiddoStart()protected voiddoStop()Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, 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
afterIndexCreated, afterIndexRemoved, afterIndexShardClosed, afterIndexShardCreated, afterIndexShardDeleted, afterIndexShardStarted, beforeIndexAddedToCluster, beforeIndexCreated, beforeIndexRemoved, beforeIndexShardCreated, beforeIndexShardDeleted, beforeIndexShardRecovery, indexShardStateChanged, onShardInactive, onStoreClosed, onStoreCreated, shardRoutingChanged
-
Constructor Details
-
SnapshotShardsService
public SnapshotShardsService(Settings settings, ClusterService clusterService, RepositoriesService repositoriesService, TransportService transportService, IndicesService indicesService)
-
-
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
-
clusterChanged
Description copied from interface:ClusterStateListenerCalled when cluster state changes.- Specified by:
clusterChangedin interfaceClusterStateListener
-
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
-
currentSnapshotShards
Returns status of shards that are snapshotted on the node and belong to the given snapshotThis method is executed on data node
- Parameters:
snapshot- snapshot- Returns:
- map of shard id to snapshot status
-