public class BlobStoreIndexShardRepository extends AbstractComponent implements IndexShardRepository
Modifier and Type | Class and Description |
---|---|
static interface |
BlobStoreIndexShardRepository.RateLimiterListener |
componentSettings, logger, settings
Constructor and Description |
---|
BlobStoreIndexShardRepository(Settings settings,
RepositoryName repositoryName,
IndicesService indicesService,
ClusterService clusterService) |
Modifier and Type | Method and Description |
---|---|
void |
delete(SnapshotId snapshotId,
ShardId shardId)
Delete shard snapshot
|
void |
initialize(BlobStore blobStore,
BlobPath basePath,
ByteSizeValue chunkSize,
org.apache.lucene.store.RateLimiter snapshotRateLimiter,
org.apache.lucene.store.RateLimiter restoreRateLimiter,
BlobStoreIndexShardRepository.RateLimiterListener rateLimiterListener)
Called by
BlobStoreRepository on repository startup |
static BlobStoreIndexShardSnapshot |
readSnapshot(InputStream stream)
Parses JSON representation of a snapshot
|
void |
restore(SnapshotId snapshotId,
ShardId shardId,
ShardId snapshotShardId,
RecoveryState recoveryState)
Restores snapshot of the shard.
|
void |
snapshot(SnapshotId snapshotId,
ShardId shardId,
SnapshotIndexCommit snapshotIndexCommit,
IndexShardSnapshotStatus snapshotStatus)
Creates a snapshot of the shard based on the index commit point.
|
IndexShardSnapshotStatus |
snapshotStatus(SnapshotId snapshotId,
ShardId shardId)
Retrieve shard snapshot status for the stored snapshot
|
String |
toString() |
void |
verify(String seed)
Verifies repository settings on data node
|
static void |
writeSnapshot(BlobStoreIndexShardSnapshot snapshot,
OutputStream stream)
Serializes snapshot to JSON
|
nodeName
@Inject public BlobStoreIndexShardRepository(Settings settings, RepositoryName repositoryName, IndicesService indicesService, ClusterService clusterService)
public void initialize(BlobStore blobStore, BlobPath basePath, ByteSizeValue chunkSize, org.apache.lucene.store.RateLimiter snapshotRateLimiter, org.apache.lucene.store.RateLimiter restoreRateLimiter, BlobStoreIndexShardRepository.RateLimiterListener rateLimiterListener)
BlobStoreRepository
on repository startupblobStore
- blob storebasePath
- base path to blob storechunkSize
- chunk sizepublic void snapshot(SnapshotId snapshotId, ShardId shardId, SnapshotIndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus)
Engine.snapshotIndex()
method.
IndexShardRepository implementations shouldn't release the snapshot index commit point. It is done by the method caller.
As snapshot process progresses, implementation of this method should update IndexShardSnapshotStatus
object and check
IndexShardSnapshotStatus.aborted()
to see if the snapshot process should be aborted.snapshot
in interface IndexShardRepository
snapshotId
- snapshot idshardId
- shard to be snapshottedsnapshotIndexCommit
- commit pointsnapshotStatus
- snapshot statuspublic void restore(SnapshotId snapshotId, ShardId shardId, ShardId snapshotShardId, RecoveryState recoveryState)
shardId
and snapshotShardId
are supplied.restore
in interface IndexShardRepository
snapshotId
- snapshot idshardId
- shard id (in the current index)snapshotShardId
- shard id (in the snapshot)recoveryState
- recovery statepublic IndexShardSnapshotStatus snapshotStatus(SnapshotId snapshotId, ShardId shardId)
snapshotStatus
in interface IndexShardRepository
snapshotId
- snapshot idshardId
- shard idpublic void verify(String seed)
IndexShardRepository
verify
in interface IndexShardRepository
seed
- value returned by Repository.startVerification()
public void delete(SnapshotId snapshotId, ShardId shardId)
snapshotId
- snapshot idshardId
- shard idpublic static void writeSnapshot(BlobStoreIndexShardSnapshot snapshot, OutputStream stream) throws IOException
snapshot
- snapshotstream
- the stream to output the snapshot JSON represetation toIOException
- if an IOException occurspublic static BlobStoreIndexShardSnapshot readSnapshot(InputStream stream) throws IOException
stream
- JSONIOException
- if an IOException occursCopyright © 2009–2015. All rights reserved.