Module org.elasticsearch.server
Package org.elasticsearch.repositories
Class LocalPrimarySnapshotShardContext
java.lang.Object
org.elasticsearch.action.DelegatingActionListener<ShardSnapshotResult,ShardSnapshotResult>
org.elasticsearch.repositories.SnapshotShardContext
org.elasticsearch.repositories.LocalPrimarySnapshotShardContext
- All Implemented Interfaces:
ActionListener<ShardSnapshotResult>
A
SnapshotShardContext implementation that reads data from a local primary shard for snapshotting.-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.repositories.SnapshotShardContext
SnapshotShardContext.FileReader, SnapshotShardContext.IndexInputFileReader -
Field Summary
Fields inherited from class org.elasticsearch.action.DelegatingActionListener
delegate -
Constructor Summary
ConstructorsConstructorDescriptionLocalPrimarySnapshotShardContext(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId, SnapshotIndexCommit commitRef, String shardStateIdentifier, IndexShardSnapshotStatus snapshotStatus, IndexVersion repositoryMetaVersion, long snapshotStartTime, ActionListener<ShardSnapshotResult> listener) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidfileReader(String file, StoreFileMetadata metadata) org.apache.lucene.index.IndexCommitbooleanshardId()store()Methods inherited from class org.elasticsearch.repositories.SnapshotShardContext
addListener, getRepositoryMetaVersion, indexId, onResponse, snapshotId, snapshotStartTime, stateIdentifier, statusMethods inherited from class org.elasticsearch.action.DelegatingActionListener
onFailure, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateFailureAndWrap, delegateFailureIgnoreResponseAndWrap, delegateResponse, map, safeMap
-
Constructor Details
-
LocalPrimarySnapshotShardContext
public LocalPrimarySnapshotShardContext(Store store, MapperService mapperService, SnapshotId snapshotId, IndexId indexId, SnapshotIndexCommit commitRef, @Nullable String shardStateIdentifier, IndexShardSnapshotStatus snapshotStatus, IndexVersion repositoryMetaVersion, long snapshotStartTime, ActionListener<ShardSnapshotResult> listener) - Parameters:
store- store to be snapshottedmapperService- the shards mapper servicesnapshotId- snapshot idindexId- id for the index being snapshottedcommitRef- commit point referenceshardStateIdentifier- a unique identifier of the state of the shard that is stored with the shard's snapshot and used to detect if the shard has changed between snapshots. Ifnullis passed as the identifier snapshotting will be done by inspecting the physical files referenced bysnapshotIndexCommitsnapshotStatus- snapshot statusrepositoryMetaVersion- version of the updated repository metadata to writesnapshotStartTime- start time of the snapshot found inSnapshotsInProgress.Entry.startTime()listener- listener invoked on completion
-
-
Method Details
-
shardId
- Specified by:
shardIdin classSnapshotShardContext
-
store
-
mapperService
-
indexCommit
public org.apache.lucene.index.IndexCommit indexCommit() -
withCommitRef
-
isSearchableSnapshot
public boolean isSearchableSnapshot()- Specified by:
isSearchableSnapshotin classSnapshotShardContext
-
metadataSnapshot
- Specified by:
metadataSnapshotin classSnapshotShardContext
-
fileNames
- Specified by:
fileNamesin classSnapshotShardContext
-
assertFileContentsMatchHash
- Specified by:
assertFileContentsMatchHashin classSnapshotShardContext
-
failStoreIfCorrupted
- Specified by:
failStoreIfCorruptedin classSnapshotShardContext
-
fileReader
public SnapshotShardContext.FileReader fileReader(String file, StoreFileMetadata metadata) throws IOException - Specified by:
fileReaderin classSnapshotShardContext- Throws:
IOException
-