Class BlobStoreTestUtil

java.lang.Object
org.elasticsearch.repositories.blobstore.BlobStoreTestUtil

public final class BlobStoreTestUtil extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    assertBlobsByPrefix(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository, org.elasticsearch.common.blobstore.BlobPath path, String prefix, Map<String,org.elasticsearch.common.blobstore.BlobMetadata> blobs)
     
    static void
    assertConsistency(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository)
    Assert that there are no unreferenced indices or unreferenced root-level metadata blobs in any repository.
    static org.elasticsearch.action.support.PlainActionFuture<AssertionError>
    assertConsistencyAsync(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository)
    Same as assertConsistency(BlobStoreRepository) but async so it can be used in tests that don't allow blocking.
    static org.elasticsearch.cluster.service.ClusterService
    Creates a mocked ClusterService for use in BlobStoreRepository related tests that mocks out all the necessary functionality to make BlobStoreRepository work.
    static org.elasticsearch.cluster.service.ClusterService
    mockClusterService(org.elasticsearch.cluster.metadata.RepositoryMetadata metadata)
    Creates a mocked ClusterService for use in BlobStoreRepository related tests that mocks out all the necessary functionality to make BlobStoreRepository work.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlobStoreTestUtil

      public BlobStoreTestUtil()
  • Method Details

    • assertConsistency

      public static void assertConsistency(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository)
      Assert that there are no unreferenced indices or unreferenced root-level metadata blobs in any repository. TODO: Expand the logic here to also check for unreferenced segment blobs and shard level metadata
      Parameters:
      repository - BlobStoreRepository to check
    • assertConsistencyAsync

      public static org.elasticsearch.action.support.PlainActionFuture<AssertionError> assertConsistencyAsync(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository)
      Same as assertConsistency(BlobStoreRepository) but async so it can be used in tests that don't allow blocking.
    • assertBlobsByPrefix

      public static void assertBlobsByPrefix(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository, org.elasticsearch.common.blobstore.BlobPath path, String prefix, Map<String,org.elasticsearch.common.blobstore.BlobMetadata> blobs)
    • mockClusterService

      public static org.elasticsearch.cluster.service.ClusterService mockClusterService()
      Creates a mocked ClusterService for use in BlobStoreRepository related tests that mocks out all the necessary functionality to make BlobStoreRepository work. Initializes the cluster state as ClusterState.EMPTY_STATE.
      Returns:
      Mock ClusterService
    • mockClusterService

      public static org.elasticsearch.cluster.service.ClusterService mockClusterService(org.elasticsearch.cluster.metadata.RepositoryMetadata metadata)
      Creates a mocked ClusterService for use in BlobStoreRepository related tests that mocks out all the necessary functionality to make BlobStoreRepository work. Initializes the cluster state with a RepositoriesMetadata instance that contains the given metadata.
      Parameters:
      metadata - RepositoryMetadata to initialize the cluster state with
      Returns:
      Mock ClusterService