Package org.elasticsearch.snapshots
Class SnapshotShardsService
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.snapshots.SnapshotShardsService
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,ClusterStateListener
,LifecycleComponent
,Releasable
,IndexEventListener
public class SnapshotShardsService extends AbstractLifecycleComponent implements ClusterStateListener, IndexEventListener
This service runs on data and master nodes and controls currently snapshotted shards on these nodes. It is responsible for
starting and stopping shard level snapshots
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SnapshotShardsService.UpdateIndexShardSnapshotStatusRequest
Internal request that is used to send changes in snapshot status to master -
Field Summary
-
Constructor Summary
Constructors Constructor Description SnapshotShardsService(Settings settings, ClusterService clusterService, RepositoriesService repositoriesService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
Modifier and Type Method Description void
beforeIndexShardClosed(ShardId shardId, IndexShard indexShard, Settings indexSettings)
Called before the index shard gets closed.void
clusterChanged(ClusterChangedEvent event)
Called when cluster state changes.java.util.Map<ShardId,IndexShardSnapshotStatus>
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, indexShardStateChanged, onShardInactive, onStoreClosed, onStoreCreated, shardRoutingChanged
-
Constructor Details
-
SnapshotShardsService
public SnapshotShardsService(Settings settings, ClusterService clusterService, RepositoriesService repositoriesService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
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
-