public class BlobStoreIndexShardRepository extends AbstractComponent implements IndexShardRepository
Modifier and Type | Class and Description |
---|---|
static interface |
BlobStoreIndexShardRepository.RateLimiterListener |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DATA_BLOB_PREFIX |
protected static java.lang.String |
LEGACY_SNAPSHOT_NAME_FORMAT |
protected static java.lang.String |
LEGACY_SNAPSHOT_PREFIX |
protected static java.lang.String |
SNAPSHOT_CODEC |
protected static java.lang.String |
SNAPSHOT_INDEX_CODEC |
protected static java.lang.String |
SNAPSHOT_INDEX_NAME_FORMAT |
protected static java.lang.String |
SNAPSHOT_INDEX_PREFIX |
protected static java.lang.String |
SNAPSHOT_NAME_FORMAT |
protected static java.lang.String |
SNAPSHOT_PREFIX |
deprecationLogger, logger, settings
Constructor and Description |
---|
BlobStoreIndexShardRepository(Settings settings,
RepositoryName repositoryName,
IndicesService indicesService,
ClusterService clusterService) |
Modifier and Type | Method and Description |
---|---|
void |
delete(SnapshotId snapshotId,
Version version,
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,
boolean compress)
Called by
BlobStoreRepository on repository startup |
protected boolean |
isCompress()
Returns true if metadata files should be compressed
|
void |
restore(SnapshotId snapshotId,
Version version,
ShardId shardId,
ShardId snapshotShardId,
RecoveryState recoveryState)
Restores snapshot of the shard.
|
void |
snapshot(SnapshotId snapshotId,
ShardId shardId,
org.apache.lucene.index.IndexCommit snapshotIndexCommit,
IndexShardSnapshotStatus snapshotStatus)
Creates a snapshot of the shard based on the index commit point.
|
IndexShardSnapshotStatus |
snapshotStatus(SnapshotId snapshotId,
Version version,
ShardId shardId)
Retrieve shard snapshot status for the stored snapshot
|
java.lang.String |
toString() |
void |
verify(java.lang.String seed)
Verifies repository settings on data node
|
logDeprecatedSetting, logRemovedSetting, nodeName
protected static final java.lang.String LEGACY_SNAPSHOT_PREFIX
protected static final java.lang.String LEGACY_SNAPSHOT_NAME_FORMAT
protected static final java.lang.String SNAPSHOT_PREFIX
protected static final java.lang.String SNAPSHOT_NAME_FORMAT
protected static final java.lang.String SNAPSHOT_CODEC
protected static final java.lang.String SNAPSHOT_INDEX_PREFIX
protected static final java.lang.String SNAPSHOT_INDEX_NAME_FORMAT
protected static final java.lang.String SNAPSHOT_INDEX_CODEC
protected static final java.lang.String DATA_BLOB_PREFIX
@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, boolean compress)
BlobStoreRepository
on repository startupblobStore
- blob storebasePath
- base path to blob storechunkSize
- chunk sizepublic void snapshot(SnapshotId snapshotId, ShardId shardId, org.apache.lucene.index.IndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus)
The index commit point can be obtained by using Engine.snapshotIndex(boolean)
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, Version version, ShardId shardId, ShardId snapshotShardId, RecoveryState recoveryState)
The index can be renamed on restore, hence different shardId
and snapshotShardId
are supplied.
restore
in interface IndexShardRepository
snapshotId
- snapshot idversion
- version of elasticsearch that created this snapshotshardId
- shard id (in the current index)snapshotShardId
- shard id (in the snapshot)recoveryState
- recovery statepublic IndexShardSnapshotStatus snapshotStatus(SnapshotId snapshotId, Version version, ShardId shardId)
snapshotStatus
in interface IndexShardRepository
snapshotId
- snapshot idversion
- version of elasticsearch that created this snapshotshardId
- shard idpublic void verify(java.lang.String seed)
IndexShardRepository
verify
in interface IndexShardRepository
seed
- value returned by Repository.startVerification()
public void delete(SnapshotId snapshotId, Version version, ShardId shardId)
snapshotId
- snapshot idshardId
- shard idpublic java.lang.String toString()
toString
in class java.lang.Object
protected boolean isCompress()