Class MockRepository

All Implemented Interfaces:
Closeable, AutoCloseable, LifecycleComponent, org.elasticsearch.core.Releasable, Repository

public class MockRepository extends FsRepository
  • Field Details

  • Constructor Details

  • Method Details

    • getFailureCount

      public long getFailureCount()
    • getMetadata

      public RepositoryMetadata getMetadata()
      Specified by:
      getMetadata in interface Repository
      Overrides:
      getMetadata in class BlobStoreRepository
    • canUpdateInPlace

      public boolean canUpdateInPlace(Settings updatedSettings, Set<String> ignoredSettings)
      Specified by:
      canUpdateInPlace in interface Repository
      Overrides:
      canUpdateInPlace in class BlobStoreRepository
    • doStop

      protected void doStop()
      Overrides:
      doStop in class BlobStoreRepository
    • createBlobStore

      protected BlobStore createBlobStore() throws Exception
      Overrides:
      createBlobStore in class FsRepository
      Throws:
      Exception
    • unblock

      public void unblock()
    • blockOnDataFiles

      public void blockOnDataFiles()
    • blockAndFailOnDataFiles

      public void blockAndFailOnDataFiles()
    • setBlockOnAnyFiles

      public void setBlockOnAnyFiles()
    • setBlockAndFailOnWriteSnapFiles

      public void setBlockAndFailOnWriteSnapFiles()
    • setBlockOnShardLevelSnapFiles

      public void setBlockOnShardLevelSnapFiles(String indexId)
    • 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 of SnapshotInfo in case the repo is already blocked on another file. This allows testing very specific timing issues where a read of SnapshotInfo is much slower than another concurrent repository operation. See blockExecution() 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)