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(org.elasticsearch.cluster.metadata.SnapshotId, List, org.elasticsearch.cluster.metadata.MetaData)
with list of indices that will be included into the snapshotIndexShardRepository.snapshot(org.elasticsearch.cluster.metadata.SnapshotId, org.elasticsearch.index.shard.ShardId, org.elasticsearch.index.deletionpolicy.SnapshotIndexCommit, org.elasticsearch.index.snapshots.IndexShardSnapshotStatus)
for each shardfinalizeSnapshot(org.elasticsearch.cluster.metadata.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(String verificationToken)
Called at the end of repository verification process.
|
Snapshot |
finalizeSnapshot(SnapshotId snapshotId,
List<String> indices,
long startTime,
String failure,
int totalShards,
List<SnapshotShardFailure> shardFailures)
Finalizes snapshotting process
|
void |
initializeSnapshot(SnapshotId snapshotId,
List<String> indices,
MetaData metaData)
Starts snapshotting process
|
boolean |
readOnly()
Returns true if the repository supports only read operations
|
Snapshot |
readSnapshot(SnapshotId snapshotId)
Reads snapshot description from repository.
|
MetaData |
readSnapshotMetaData(SnapshotId snapshotId,
Snapshot snapshot,
List<String> indices)
Returns global metadata associate with the snapshot.
|
long |
restoreThrottleTimeInNanos()
Returns restore throttle time in nanoseconds
|
List<SnapshotId> |
snapshots()
Returns the list of snapshots currently stored in the repository
|
long |
snapshotThrottleTimeInNanos()
Returns snapshot throttle time in nanoseconds
|
String |
startVerification()
Verifies repository on the master node and returns the verification token.
|
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop
close
Snapshot readSnapshot(SnapshotId snapshotId)
snapshotId
- snapshot IDMetaData readSnapshotMetaData(SnapshotId snapshotId, Snapshot snapshot, List<String> indices) throws IOException
The returned meta data contains global metadata as well as metadata for all indices listed in the indices parameter.
snapshot
- snapshotindices
- list of indicesIOException
List<SnapshotId> snapshots()
void initializeSnapshot(SnapshotId snapshotId, List<String> indices, MetaData metaData)
snapshotId
- snapshot idindices
- list of indices to be snapshottedmetaData
- cluster metadataSnapshot finalizeSnapshot(SnapshotId snapshotId, List<String> indices, long startTime, String failure, int totalShards, 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()
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(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()
Copyright © 2009–2016. All rights reserved.