public interface Repository extends LifecycleComponent<Repository>
Responsible for index and cluster level operations. It's called only on master.
Shard-level operations are performed using IndexShardRepository
interface on data nodes.
Typical snapshot usage pattern:
initializeSnapshot(SnapshotId, List, org.elasticsearch.cluster.metadata.MetaData)
with list of indices that will be included into the snapshotIndexShardRepository.snapshot(SnapshotId, ShardId, IndexCommit, IndexShardSnapshotStatus)
for each shardfinalizeSnapshot(org.elasticsearch.snapshots.SnapshotId, java.util.List<java.lang.String>, long, java.lang.String, int, java.util.List<org.elasticsearch.snapshots.SnapshotShardFailure>)
with possible list of failuresModifier and Type | Method and Description |
---|---|
void |
deleteSnapshot(SnapshotId snapshotId)
Deletes snapshot
|
void |
endVerification(java.lang.String verificationToken)
Called at the end of repository verification process.
|
SnapshotInfo |
finalizeSnapshot(SnapshotId snapshotId,
java.util.List<java.lang.String> indices,
long startTime,
java.lang.String failure,
int totalShards,
java.util.List<SnapshotShardFailure> shardFailures)
Finalizes snapshotting process
|
void |
initializeSnapshot(SnapshotId snapshotId,
java.util.List<java.lang.String> indices,
MetaData metaData)
Starts snapshotting process
|
boolean |
readOnly()
Returns true if the repository supports only read operations
|
SnapshotInfo |
readSnapshot(SnapshotId snapshotId)
Reads snapshot description from repository.
|
MetaData |
readSnapshotMetaData(SnapshotInfo snapshot,
java.util.List<java.lang.String> indices)
Returns global metadata associate with the snapshot.
|
long |
restoreThrottleTimeInNanos()
Returns restore throttle time in nanoseconds
|
java.util.List<SnapshotId> |
snapshots()
Returns the list of snapshots currently stored in the repository that match the given predicate on the snapshot name.
|
long |
snapshotThrottleTimeInNanos()
Returns snapshot throttle time in nanoseconds
|
java.lang.String |
startVerification()
Verifies repository on the master node and returns the verification token.
|
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
SnapshotInfo readSnapshot(SnapshotId snapshotId)
snapshotId
- snapshot idMetaData readSnapshotMetaData(SnapshotInfo snapshot, java.util.List<java.lang.String> indices) throws java.io.IOException
The returned meta data contains global metadata as well as metadata for all indices listed in the indices parameter.
snapshot
- snapshotindices
- list of indicesjava.io.IOException
java.util.List<SnapshotId> snapshots()
void initializeSnapshot(SnapshotId snapshotId, java.util.List<java.lang.String> indices, MetaData metaData)
snapshotId
- snapshot idindices
- list of indices to be snapshottedmetaData
- cluster metadataSnapshotInfo finalizeSnapshot(SnapshotId snapshotId, java.util.List<java.lang.String> indices, long startTime, java.lang.String failure, int totalShards, java.util.List<SnapshotShardFailure> shardFailures)
This method is called on master after all shards are snapshotted.
snapshotId
- snapshot idfailure
- global failure reason or nulltotalShards
- total number of shardsshardFailures
- list of shard failuresvoid deleteSnapshot(SnapshotId snapshotId)
snapshotId
- snapshot idlong snapshotThrottleTimeInNanos()
long restoreThrottleTimeInNanos()
java.lang.String startVerification()
If the verification token is not null, it's passed to all data nodes for verification. If it's null - no additional verification is required
void endVerification(java.lang.String verificationToken)
This method should perform all necessary cleanup of the temporary files created in the repository
verificationToken
- verification request generated by startVerification()
commandboolean readOnly()