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
ConstructorDescriptionSnapshotShardsService(Settings settings, ClusterService clusterService, RepositoriesService repositoriesService, TransportService transportService, IndicesService indicesService)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeIndexShardClosed(ShardId shardId, IndexShard indexShard, Settings indexSettings)
Called before the index shard gets closed.void
Called when cluster state changes.currentSnapshotShards(Snapshot snapshot)
Returns status of shards that are snapshotted on the node and belong to the given snapshotprotected void
doClose()
protected void
doStart()
protected void
doStop()
Methods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop
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, 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:
doStart
in classAbstractLifecycleComponent
-
doStop
protected void doStop()- Specified by:
doStop
in classAbstractLifecycleComponent
-
doClose
protected void doClose()- Specified by:
doClose
in classAbstractLifecycleComponent
-
clusterChanged
Description copied from interface:ClusterStateListener
Called when cluster state changes.- Specified by:
clusterChanged
in interfaceClusterStateListener
-
beforeIndexShardClosed
public void beforeIndexShardClosed(ShardId shardId, @Nullable IndexShard indexShard, Settings indexSettings)Description copied from interface:IndexEventListener
Called before the index shard gets closed.- Specified by:
beforeIndexShardClosed
in interfaceIndexEventListener
indexShard
- 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
-