Class MockRepository
java.lang.Object
org.elasticsearch.common.component.AbstractLifecycleComponent
org.elasticsearch.repositories.blobstore.BlobStoreRepository
org.elasticsearch.repositories.fs.FsRepository
org.elasticsearch.snapshots.mockstore.MockRepository
- All Implemented Interfaces:
Closeable,AutoCloseable,LifecycleComponent,org.elasticsearch.core.Releasable,Repository
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic classNested classes/interfaces inherited from interface org.elasticsearch.repositories.Repository
Repository.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSetting name for a setting that can be updated dynamically to testcanUpdateInPlace(Settings, Set).Fields inherited from class org.elasticsearch.repositories.fs.FsRepository
CHUNK_SIZE_SETTING, COMPRESS_SETTING, LOCATION_SETTING, REPOSITORIES_CHUNK_SIZE_SETTING, REPOSITORIES_COMPRESS_SETTING, REPOSITORIES_LOCATION_SETTING, TYPEFields inherited from class org.elasticsearch.repositories.blobstore.BlobStoreRepository
ALLOW_CONCURRENT_MODIFICATION, bigArrays, BUFFER_SIZE_SETTING, bufferSize, CACHE_REPOSITORY_DATA, GLOBAL_METADATA_FORMAT, INDEX_FILE_PREFIX, INDEX_LATEST_BLOB, INDEX_METADATA_FORMAT, INDEX_SHARD_SNAPSHOT_FORMAT, INDEX_SHARD_SNAPSHOTS_FORMAT, MAX_RESTORE_BYTES_PER_SEC, MAX_SNAPSHOT_BYTES_PER_SEC, MAX_SNAPSHOTS_SETTING, metadata, METADATA_NAME_FORMAT, METADATA_PREFIX, READONLY_SETTING_KEY, SNAPSHOT_FORMAT, SNAPSHOT_NAME_FORMAT, SNAPSHOT_PREFIX, SUPPORT_URL_REPO, supportURLRepo, threadPool, UPLOADED_DATA_BLOB_PREFIX, URL_REPOSITORY_TYPE, USE_FOR_PEER_RECOVERY_SETTINGFields inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
lifecycle -
Constructor Summary
ConstructorsConstructorDescriptionMockRepository(RepositoryMetadata metadata, Environment environment, org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry, ClusterService clusterService, BigArrays bigArrays, RecoverySettings recoverySettings) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanblocked()voidbooleancanUpdateInPlace(Settings updatedSettings, Set<String> ignoredSettings) protected BlobStoreprotected voiddoStop()longvoidvoidvoidvoidvoidvoidvoidEnable blocking a single read ofSnapshotInfoin case the repo is already blocked on another file.voidvoidvoidsetBlockOnShardLevelSnapFiles(String indexId) voidvoidvoidsetFailOnIndexLatest(boolean failOnIndexLatest) voidsetFailReadsAfterUnblock(boolean failReadsAfterUnblock) voidunblock()Methods inherited from class org.elasticsearch.repositories.fs.FsRepository
basePath, chunkSize, hasAtomicOverwritesMethods inherited from class org.elasticsearch.repositories.blobstore.BlobStoreRepository
assertSnapshotOrGenericThread, awaitIdle, blobContainer, blobStore, cleanup, cloneShardSnapshot, deleteSnapshots, doClose, doStart, endVerification, executeConsistentStateUpdate, finalizeSnapshot, getBlobStore, getBlobStoreIndexShardSnapshots, getReadBufferSizeInBytes, getRepositoryData, getRestoreThrottleTimeInNanos, getShardSnapshotStatus, getSnapshotGlobalMetadata, getSnapshotIndexMetaData, getSnapshotInfo, getSnapshotThrottleTimeInNanos, initializeSnapshot, isCompress, isReadOnly, loadShardSnapshot, maybeRateLimitRestores, maybeRateLimitRestores, maybeRateLimitSnapshots, maybeRateLimitSnapshots, restoreShard, shardContainer, snapshotShard, startVerification, stats, supportURLRepo, threadPool, toString, updateState, verify, writeIndexGenMethods inherited from class org.elasticsearch.common.component.AbstractLifecycleComponent
addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.component.LifecycleComponent
addLifecycleListener, lifecycleState, removeLifecycleListener, start, stopMethods inherited from interface org.elasticsearch.core.Releasable
closeMethods inherited from interface org.elasticsearch.repositories.Repository
adaptUserMetadata, getSnapshotInfo
-
Field Details
-
DUMMY_UPDATABLE_SETTING_NAME
Setting name for a setting that can be updated dynamically to testcanUpdateInPlace(Settings, Set).- See Also:
-
-
Constructor Details
-
MockRepository
public MockRepository(RepositoryMetadata metadata, Environment environment, org.elasticsearch.xcontent.NamedXContentRegistry namedXContentRegistry, ClusterService clusterService, BigArrays bigArrays, RecoverySettings recoverySettings)
-
-
Method Details
-
getFailureCount
public long getFailureCount() -
getMetadata
- Specified by:
getMetadatain interfaceRepository- Overrides:
getMetadatain classBlobStoreRepository
-
canUpdateInPlace
- Specified by:
canUpdateInPlacein interfaceRepository- Overrides:
canUpdateInPlacein classBlobStoreRepository
-
doStop
protected void doStop()- Overrides:
doStopin classBlobStoreRepository
-
createBlobStore
- Overrides:
createBlobStorein classFsRepository- Throws:
Exception
-
unblock
public void unblock() -
blockOnDataFiles
public void blockOnDataFiles() -
blockAndFailOnDataFiles
public void blockAndFailOnDataFiles() -
setBlockOnAnyFiles
public void setBlockOnAnyFiles() -
setBlockAndFailOnWriteSnapFiles
public void setBlockAndFailOnWriteSnapFiles() -
setBlockOnShardLevelSnapFiles
-
setBlockAndFailOnWriteIndexFile
public void setBlockAndFailOnWriteIndexFile() -
setBlockOnWriteIndexFile
public void setBlockOnWriteIndexFile() -
setBlockOnDeleteIndexFile
public void setBlockOnDeleteIndexFile() -
setBlockOnWriteShardLevelMeta
public void setBlockOnWriteShardLevelMeta() -
setBlockAndFailOnWriteShardLevelMeta
public void setBlockAndFailOnWriteShardLevelMeta() -
setBlockOnReadIndexMeta
public void setBlockOnReadIndexMeta() -
setFailReadsAfterUnblock
public void setFailReadsAfterUnblock(boolean failReadsAfterUnblock) -
setBlockAndFailOnReadSnapFiles
public void setBlockAndFailOnReadSnapFiles() -
setBlockAndFailOnReadIndexFiles
public void setBlockAndFailOnReadIndexFiles() -
setBlockOnceOnReadSnapshotInfoIfAlreadyBlocked
public void setBlockOnceOnReadSnapshotInfoIfAlreadyBlocked()Enable blocking a single read ofSnapshotInfoin case the repo is already blocked on another file. This allows testing very specific timing issues where a read ofSnapshotInfois much slower than another concurrent repository operation. SeeblockExecution()for the exact mechanics of why we need a secondary block defined here. TODO: clean this up to not require a second block set -
blocked
public boolean blocked() -
setFailOnIndexLatest
public void setFailOnIndexLatest(boolean failOnIndexLatest)
-