Package org.elasticsearch.snapshots
Class SnapshotShardsService
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- 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
Fields Modifier and Type Field Description static java.lang.String
UPDATE_SNAPSHOT_STATUS_ACTION_NAME
-
Fields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Constructor Description SnapshotShardsService(Settings settings, ClusterService clusterService, SnapshotsService snapshotsService, ThreadPool threadPool, TransportService transportService, IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods 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, shardRoutingChanged
-
-
-
-
Field Detail
-
UPDATE_SNAPSHOT_STATUS_ACTION_NAME
public static final java.lang.String UPDATE_SNAPSHOT_STATUS_ACTION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SnapshotShardsService
@Inject 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:
doStart
in classAbstractLifecycleComponent
-
doStop
protected void doStop()
- Specified by:
doStop
in classAbstractLifecycleComponent
-
doClose
protected void doClose()
- Specified by:
doClose
in classAbstractLifecycleComponent
-
clusterChanged
public void clusterChanged(ClusterChangedEvent event)
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
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
-
-