public abstract class BlobStoreRepository extends AbstractLifecycleComponent<Repository> implements Repository, BlobStoreIndexShardRepository.RateLimiterListener
This repository works with any BlobStore implementation. The blobStore should be initialized in the derived
class before doStart() is called.
BlobStoreRepository maintains the following structure in the blob store
STORE_ROOT
|- index - list of all snapshot name as JSON array
|- snapshot-20131010 - JSON serialized Snapshot for snapshot "20131010"
|- meta-20131010.dat - JSON serialized MetaData for snapshot "20131010" (includes only global metadata)
|- snapshot-20131011 - JSON serialized Snapshot for snapshot "20131011"
|- meta-20131011.dat - JSON serialized MetaData for snapshot "20131011"
.....
|- indices/ - data for all indices
|- foo/ - data for index "foo"
| |- meta-20131010.dat - JSON Serialized IndexMetaData for index "foo"
| |- 0/ - data for shard "0" of index "foo"
| | |- __1 \
| | |- __2 |
| | |- __3 |- files from different segments see snapshot-* for their mappings to real segment files
| | |- __4 |
| | |- __5 /
| | .....
| | |- snap-20131010.dat - JSON serialized BlobStoreIndexShardSnapshot for snapshot "20131010"
| | |- snap-20131011.dat - JSON serialized BlobStoreIndexShardSnapshot for snapshot "20131011"
| | |- list-123 - JSON serialized BlobStoreIndexShardSnapshot for snapshot "20131011"
| |
| |- 1/ - data for shard "1" of index "foo"
| | |- __1
| | .....
| |
| |-2/
| ......
|
|- bar/ - data for index bar
......
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected String |
repositoryName |
lifecycledeprecationLogger, logger, settings| 修飾子 | コンストラクタと説明 |
|---|---|
protected |
BlobStoreRepository(String repositoryName,
RepositorySettings repositorySettings,
IndexShardRepository indexShardRepository)
Constructs new BlobStoreRepository
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected abstract BlobPath |
basePath()
Returns base path of the repository
|
protected abstract BlobStore |
blobStore()
Returns initialized and ready to use BlobStore
This method is first called in the
doStart() method. |
protected ByteSizeValue |
chunkSize()
Returns data file chunk size.
|
void |
deleteSnapshot(SnapshotId snapshotId)
Deletes snapshot
|
protected void |
doClose() |
protected void |
doStart() |
protected void |
doStop() |
void |
endVerification(String seed)
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
This method is called on master after all shards are snapshotted.
|
void |
initializeSnapshot(SnapshotId snapshotId,
List<String> indices,
MetaData metaData)
Starts snapshotting process
|
protected boolean |
isCompress()
Returns true if metadata and snapshot files should be compressed
|
static boolean |
legacyMetaData(Version version)
In v2.0.0 we changed the matadata file format
|
void |
onRestorePause(long nanos) |
void |
onSnapshotPause(long nanos) |
boolean |
readOnly()
Returns true if the repository supports only read operations
|
Snapshot |
readSnapshot(SnapshotId snapshotId)
Reads snapshot description from repository.
|
protected List<SnapshotId> |
readSnapshotList()
Reads snapshot index file
This file can be used by read-only repositories that are unable to list files in the 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.
|
static String |
testBlobPrefix(String seed) |
protected void |
writeSnapshotList(List<SnapshotId> snapshots)
Writes snapshot index file
This file can be used by read-only repositories that are unable to list files in the repository
|
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stoplogDeprecatedSetting, logRemovedSetting, nodeNameclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddLifecycleListener, lifecycleState, removeLifecycleListener, start, stopcloseprotected final String repositoryName
protected BlobStoreRepository(String repositoryName, RepositorySettings repositorySettings, IndexShardRepository indexShardRepository)
repositoryName - repository namerepositorySettings - repository settingsindexShardRepository - an instance of IndexShardRepositoryprotected void doStart()
doStart クラス内 AbstractLifecycleComponent<Repository>protected void doStop()
doStop クラス内 AbstractLifecycleComponent<Repository>protected void doClose()
doClose クラス内 AbstractLifecycleComponent<Repository>protected abstract BlobStore blobStore()
This method is first called in the doStart() method.
protected abstract BlobPath basePath()
protected boolean isCompress()
protected ByteSizeValue chunkSize()
This method should return null if no chunking is needed.
public void initializeSnapshot(SnapshotId snapshotId, List<String> indices, MetaData metaData)
initializeSnapshot インタフェース内 RepositorysnapshotId - snapshot idindices - list of indices to be snapshottedmetaData - cluster metadatapublic void deleteSnapshot(SnapshotId snapshotId)
deleteSnapshot インタフェース内 RepositorysnapshotId - snapshot idpublic Snapshot 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.
finalizeSnapshot インタフェース内 RepositorysnapshotId - snapshot idfailure - global failure reason or nulltotalShards - total number of shardsshardFailures - list of shard failurespublic List<SnapshotId> snapshots()
snapshots インタフェース内 Repositorypublic MetaData 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.
readSnapshotMetaData インタフェース内 Repositorysnapshot - snapshotindices - list of indicesIOExceptionpublic Snapshot readSnapshot(SnapshotId snapshotId)
readSnapshot インタフェース内 RepositorysnapshotId - snapshot IDpublic static boolean legacyMetaData(Version version)
protected void writeSnapshotList(List<SnapshotId> snapshots) throws IOException
This file can be used by read-only repositories that are unable to list files in the repository
snapshots - list of snapshot idsIOException - I/O errorsprotected List<SnapshotId> readSnapshotList() throws IOException
This file can be used by read-only repositories that are unable to list files in the repository
IOException - I/O errorspublic void onRestorePause(long nanos)
public void onSnapshotPause(long nanos)
public long snapshotThrottleTimeInNanos()
RepositorysnapshotThrottleTimeInNanos インタフェース内 Repositorypublic long restoreThrottleTimeInNanos()
RepositoryrestoreThrottleTimeInNanos インタフェース内 Repositorypublic String startVerification()
RepositoryIf the verification token is not null, it's passed to all data nodes for verification. If it's null - no additional verification is required
startVerification インタフェース内 Repositorypublic void endVerification(String seed)
RepositoryThis method should perform all necessary cleanup of the temporary files created in the repository
endVerification インタフェース内 Repositoryseed - verification request generated by Repository.startVerification() commandpublic boolean readOnly()
RepositoryreadOnly インタフェース内 RepositoryCopyright © 2009–2016. All rights reserved.