Class BlobStoreTestUtil
java.lang.Object
org.elasticsearch.repositories.blobstore.BlobStoreTestUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertBlobsByPrefix(BlobStoreRepository repository, BlobPath path, String prefix, Map<String, BlobMetadata> blobs) static voidassertConsistency(BlobStoreRepository repository) Assert that there are no unreferenced indices or unreferenced root-level metadata blobs in any repository.static PlainActionFuture<AssertionError> assertConsistencyAsync(BlobStoreRepository repository) Same asassertConsistency(BlobStoreRepository)but async so it can be used in tests that don't allow blocking.static ClusterServiceCreates a mockedClusterServicefor use inBlobStoreRepositoryrelated tests that mocks out all the necessary functionality to makeBlobStoreRepositorywork.static ClusterServicemockClusterService(RepositoryMetadata metadata) Creates a mockedClusterServicefor use inBlobStoreRepositoryrelated tests that mocks out all the necessary functionality to makeBlobStoreRepositorywork.static OperationPurposestatic OperationPurpose
-
Constructor Details
-
BlobStoreTestUtil
public BlobStoreTestUtil()
-
-
Method Details
-
assertConsistency
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 PlainActionFuture<AssertionError> assertConsistencyAsync(BlobStoreRepository repository) Same asassertConsistency(BlobStoreRepository)but async so it can be used in tests that don't allow blocking. -
assertBlobsByPrefix
public static void assertBlobsByPrefix(BlobStoreRepository repository, BlobPath path, String prefix, Map<String, BlobMetadata> blobs) -
mockClusterService
Creates a mockedClusterServicefor use inBlobStoreRepositoryrelated tests that mocks out all the necessary functionality to makeBlobStoreRepositorywork. Initializes the cluster state asClusterState.EMPTY_STATE.- Returns:
- Mock ClusterService
-
mockClusterService
Creates a mockedClusterServicefor use inBlobStoreRepositoryrelated tests that mocks out all the necessary functionality to makeBlobStoreRepositorywork. Initializes the cluster state with aRepositoriesMetadatainstance that contains the givenmetadata.- Parameters:
metadata- RepositoryMetadata to initialize the cluster state with- Returns:
- Mock ClusterService
-
randomPurpose
-
randomNonDataPurpose
-