Class MockRepository

java.lang.Object
org.opensearch.common.lifecycle.AbstractLifecycleComponent
org.opensearch.repositories.blobstore.BlobStoreRepository
org.opensearch.repositories.fs.FsRepository
org.opensearch.snapshots.mockstore.MockRepository
All Implemented Interfaces:
Closeable, AutoCloseable, org.opensearch.common.lease.Releasable, org.opensearch.common.lifecycle.LifecycleComponent, org.opensearch.repositories.Repository

public class MockRepository extends org.opensearch.repositories.fs.FsRepository
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     
    static class 
     

    Nested classes/interfaces inherited from interface org.opensearch.repositories.Repository

    org.opensearch.repositories.Repository.Factory
  • Field Summary

    Fields inherited from class org.opensearch.repositories.fs.FsRepository

    BASE_PATH_SETTING, basePath, CHUNK_SIZE_SETTING, chunkSize, environment, LOCATION_SETTING, REPOSITORIES_CHUNK_SIZE_SETTING, REPOSITORIES_COMPRESS_SETTING, REPOSITORIES_LOCATION_SETTING, TYPE

    Fields inherited from class org.opensearch.repositories.blobstore.BlobStoreRepository

    ALLOW_CONCURRENT_MODIFICATION, BUFFER_SIZE_SETTING, bufferSize, CACHE_DEFAULT_THRESHOLD, CACHE_MAX_THRESHOLD, CACHE_MIN_THRESHOLD, CACHE_REPOSITORY_DATA, clusterService, COMPRESS_SETTING, COMPRESSION_TYPE_SETTING, GLOBAL_METADATA_FORMAT, INDEX_FILE_PREFIX, INDEX_LATEST_BLOB, INDEX_METADATA_FORMAT, INDEX_SHARD_SNAPSHOT_FORMAT, INDEX_SHARD_SNAPSHOTS_FORMAT, INDICES_DIR, MAX_REMOTE_DOWNLOAD_BYTES_PER_SEC, MAX_REMOTE_DOWNLOAD_BYTES_PER_SEC_SETTING, MAX_REMOTE_LOW_PRIORITY_DOWNLOAD_BYTES_PER_SEC, MAX_REMOTE_LOW_PRIORITY_DOWNLOAD_BYTES_PER_SEC_SETTING, MAX_REMOTE_LOW_PRIORITY_UPLOAD_BYTES_PER_SEC, MAX_REMOTE_LOW_PRIORITY_UPLOAD_BYTES_PER_SEC_SETTING, MAX_REMOTE_UPLOAD_BYTES_PER_SEC, MAX_REMOTE_UPLOAD_BYTES_PER_SEC_SETTING, MAX_RESTORE_BYTES_PER_SEC, MAX_SNAPSHOT_BYTES_PER_SEC, MAX_SNAPSHOT_SHARD_BLOB_DELETE_BATCH_SIZE, metadata, METADATA_NAME_FORMAT, METADATA_PREFIX, PREFIX_MODE_VERIFICATION_SETTING, READONLY_SETTING, REMOTE_STORE_INDEX_SHALLOW_COPY, REMOTE_STORE_SHARD_SHALLOW_COPY_SNAPSHOT_FORMAT, repositoryDataCacheThreshold, RESTORE_BYTES_PER_SEC_SETTING, SHALLOW_SNAPSHOT_NAME_FORMAT, SHALLOW_SNAPSHOT_PREFIX, SHALLOW_SNAPSHOT_V2, SHARD_PATH_TYPE, SNAPSHOT_BYTES_PER_SEC_SETTING, SNAPSHOT_FORMAT, SNAPSHOT_NAME_FORMAT, SNAPSHOT_PREFIX, SNAPSHOT_REPOSITORY_DATA_CACHE_THRESHOLD, SNAPSHOT_REPOSITORY_DATA_CACHE_THRESHOLD_DEFAULT_PERCENTAGE, SNAPSHOT_REPOSITORY_DATA_CACHET_THRESHOLD_SETTING_NAME, SNAPSHOT_SHARD_PATH_PREFIX_SETTING, SNAPSHOT_SHARD_PATHS_FORMAT, SUPPORT_URL_REPO, supportURLRepo, SYSTEM_REPOSITORY_SETTING, threadPool, VIRTUAL_DATA_BLOB_PREFIX

    Fields inherited from class org.opensearch.common.lifecycle.AbstractLifecycleComponent

    lifecycle
  • Constructor Summary

    Constructors
    Constructor
    Description
    MockRepository(org.opensearch.cluster.metadata.RepositoryMetadata metadata, org.opensearch.env.Environment environment, org.opensearch.core.xcontent.NamedXContentRegistry namedXContentRegistry, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.indices.recovery.RecoverySettings recoverySettings)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    blockOnDataFiles(boolean blocked)
     
    void
    blockOnSegmentFiles(boolean blocked)
     
    protected org.opensearch.common.blobstore.BlobStore
     
    protected void
     
    long
     
    org.opensearch.cluster.metadata.RepositoryMetadata
     
    void
     
    void
     
    void
    setBlockOnAnyFiles(boolean blocked)
     
    void
     
    void
     
    void
    setBlockOnSegmentFiles(boolean blocked)
     
    void
     
    void
     
    void
    setFailOnIndexLatest(boolean failOnIndexLatest)
     
    void
    setFailReadsAfterUnblock(boolean failReadsAfterUnblock)
     
    void
    setRandomControlIOExceptionRate(double randomControlIOExceptionRate)
     
    void
    setThrowExceptionWhileDelete(boolean throwError)
     
    void
     

    Methods inherited from class org.opensearch.repositories.fs.FsRepository

    basePath, chunkSize, getRestrictedSystemRepositorySettings, readMetadata, validateLocation

    Methods inherited from class org.opensearch.repositories.blobstore.BlobStoreRepository

    assertSnapshotOrGenericThread, blobContainer, blobStore, calculateDefaultSnapshotRepositoryDataCacheThreshold, calculateMaxSnapshotRepositoryDataCacheThreshold, calculateMaxWithinIntLimit, cleanup, cloneRemoteStoreIndexShardSnapshot, cloneShardSnapshot, deleteSnapshots, deleteSnapshotsAndReleaseLockFiles, deleteSnapshotsInternal, deleteSnapshotsWithPinnedTimestamp, doClose, doStart, endVerification, executeConsistentStateUpdate, finalizeSnapshot, finalizeSnapshot, getBlobStore, getCompressor, getLowPriorityRemoteDownloadThrottleTimeInNanos, getLowPriorityRemoteUploadThrottleTimeInNanos, getNamedXContentRegistry, getRemoteDownloadThrottleTimeInNanos, getRemoteStoreShallowCopyShardMetadata, getRemoteUploadThrottleTimeInNanos, getRepositoryData, getRestoreThrottleTimeInNanos, getShardSnapshotStatus, getShardSnapshotStatus, getSnapshotGlobalMetadata, getSnapshotIndexMetaData, getSnapshotInfo, getSnapshotShardPathBlobContainer, getSnapshotThrottleTimeInNanos, isCompress, isReadOnly, isReloadableSettings, isSystemRepository, loadShardSnapshot, loadShardSnapshot, maybeRateLimitLowPriorityDownloadTransfers, maybeRateLimitLowPriorityRemoteUploadTransfers, maybeRateLimitRemoteDownloadTransfers, maybeRateLimitRemoteUploadTransfers, maybeRateLimitRestores, maybeRateLimitSnapshots, releaseRemoteStoreLockAndCleanup, reload, remoteDirectoryCleanupAsync, remoteDownloadRateLimiter, remoteUploadLowPriorityRateLimiter, remoteUploadRateLimiter, restoreRateLimiter, restoreShard, rootBlobContainer, shardContainer, snapshotRateLimiter, snapshotRemoteStoreIndexShard, snapshotRemoteStoreIndexShard, snapshotShard, snapshotShardPathBlobContainer, startVerification, stats, threadPool, toString, updateState, verify, writeIndexGen

    Methods inherited from class org.opensearch.common.lifecycle.AbstractLifecycleComponent

    addLifecycleListener, close, lifecycleState, removeLifecycleListener, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.opensearch.common.lifecycle.LifecycleComponent

    addLifecycleListener, lifecycleState, removeLifecycleListener, start, stop

    Methods inherited from interface org.opensearch.common.lease.Releasable

    close

    Methods inherited from interface org.opensearch.repositories.Repository

    adaptUserMetadata, isReloadable, validateMetadata
  • Constructor Details

    • MockRepository

      public MockRepository(org.opensearch.cluster.metadata.RepositoryMetadata metadata, org.opensearch.env.Environment environment, org.opensearch.core.xcontent.NamedXContentRegistry namedXContentRegistry, org.opensearch.cluster.service.ClusterService clusterService, org.opensearch.indices.recovery.RecoverySettings recoverySettings)
  • Method Details

    • getFailureCount

      public long getFailureCount()
    • getMetadata

      public org.opensearch.cluster.metadata.RepositoryMetadata getMetadata()
      Specified by:
      getMetadata in interface org.opensearch.repositories.Repository
      Overrides:
      getMetadata in class org.opensearch.repositories.blobstore.BlobStoreRepository
    • doStop

      protected void doStop()
      Overrides:
      doStop in class org.opensearch.repositories.blobstore.BlobStoreRepository
    • createBlobStore

      protected org.opensearch.common.blobstore.BlobStore createBlobStore() throws Exception
      Overrides:
      createBlobStore in class org.opensearch.repositories.fs.FsRepository
      Throws:
      Exception
    • unblock

      public void unblock()
    • setRandomControlIOExceptionRate

      public void setRandomControlIOExceptionRate(double randomControlIOExceptionRate)
    • blockOnDataFiles

      public void blockOnDataFiles(boolean blocked)
    • setBlockOnAnyFiles

      public void setBlockOnAnyFiles(boolean blocked)
    • blockOnSegmentFiles

      public void blockOnSegmentFiles(boolean blocked)
    • setBlockOnSegmentFiles

      public void setBlockOnSegmentFiles(boolean blocked)
    • setBlockAndFailOnWriteSnapFiles

      public void setBlockAndFailOnWriteSnapFiles(boolean blocked)
    • setBlockAndFailOnWriteIndexFile

      public void setBlockAndFailOnWriteIndexFile()
    • setBlockOnWriteIndexFile

      public void setBlockOnWriteIndexFile()
    • setBlockOnDeleteIndexFile

      public void setBlockOnDeleteIndexFile()
    • setBlockOnWriteShardLevelMeta

      public void setBlockOnWriteShardLevelMeta()
    • setBlockOnReadIndexMeta

      public void setBlockOnReadIndexMeta()
    • setFailReadsAfterUnblock

      public void setFailReadsAfterUnblock(boolean failReadsAfterUnblock)
    • setThrowExceptionWhileDelete

      public void setThrowExceptionWhileDelete(boolean throwError)
    • blocked

      public boolean blocked()
    • setFailOnIndexLatest

      public void setFailOnIndexLatest(boolean failOnIndexLatest)