Class BlobStoreTestUtil
java.lang.Object
org.elasticsearch.repositories.blobstore.BlobStoreTestUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 asassertConsistency(BlobStoreRepository)
but async so it can be used in tests that don't allow blocking.static void
assertCorruptionVisible
(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository, Map<String, Set<String>> indexToFiles) static long
createDanglingIndex
(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository, String name, Set<String> files) static org.elasticsearch.cluster.service.ClusterService
Creates a mockedClusterService
for use inBlobStoreRepository
related tests that mocks out all the necessary functionality to makeBlobStoreRepository
work.static org.elasticsearch.cluster.service.ClusterService
mockClusterService
(org.elasticsearch.cluster.metadata.RepositoryMetadata metadata) Creates a mockedClusterService
for use inBlobStoreRepository
related tests that mocks out all the necessary functionality to makeBlobStoreRepository
work.
-
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 asassertConsistency(BlobStoreRepository)
but async so it can be used in tests that don't allow blocking. -
createDanglingIndex
public static long createDanglingIndex(org.elasticsearch.repositories.blobstore.BlobStoreRepository repository, String name, Set<String> files) throws InterruptedException, ExecutionException -
assertCorruptionVisible
-
assertBlobsByPrefix
-
mockClusterService
public static org.elasticsearch.cluster.service.ClusterService mockClusterService()Creates a mockedClusterService
for use inBlobStoreRepository
related tests that mocks out all the necessary functionality to makeBlobStoreRepository
work. Initializes the cluster state asClusterState.EMPTY_STATE
.- Returns:
- Mock ClusterService
-
mockClusterService
public static org.elasticsearch.cluster.service.ClusterService mockClusterService(org.elasticsearch.cluster.metadata.RepositoryMetadata metadata) Creates a mockedClusterService
for use inBlobStoreRepository
related tests that mocks out all the necessary functionality to makeBlobStoreRepository
work. Initializes the cluster state with aRepositoriesMetadata
instance that contains the givenmetadata
.- Parameters:
metadata
- RepositoryMetadata to initialize the cluster state with- Returns:
- Mock ClusterService
-