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 classSnapshotShardsService.UpdateIndexShardSnapshotStatusRequestInternal request that is used to send changes in snapshot status to master
-
Field Summary
-
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
-
Constructor Summary
Constructors Constructor Description SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
Modifier and Type Method Description voidbeforeIndexShardClosed(ShardId shardId, IndexShard indexShard, Settings indexSettings)Called before the index shard gets closed.voidclusterChanged(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 voiddoClose()protected voiddoStart()protected voiddoStop()-
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 Detail
-
SnapshotShardsService
public SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
-
Method Detail
-
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
public void clusterChanged(ClusterChangedEvent event)
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
public java.util.Map<ShardId,IndexShardSnapshotStatus> currentSnapshotShards(Snapshot snapshot)
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
-
-