use of org.opensearch.repositories.fs.FsRepository in project OpenSearch by opensearch-project.
the class BlobStoreRepositoryTests method testFsRepositoryCompressDeprecated.
public void testFsRepositoryCompressDeprecated() {
final Path location = OpenSearchIntegTestCase.randomRepoPath(node().settings());
final Settings settings = Settings.builder().put(node().settings()).put("location", location).build();
final RepositoryMetadata metadata = new RepositoryMetadata("test-repo", REPO_TYPE, settings);
Settings useCompressSettings = Settings.builder().put(node().getEnvironment().settings()).put(FsRepository.REPOSITORIES_COMPRESS_SETTING.getKey(), true).build();
Environment useCompressEnvironment = new Environment(useCompressSettings, node().getEnvironment().configFile());
new FsRepository(metadata, useCompressEnvironment, null, BlobStoreTestUtil.mockClusterService(), null);
assertWarnings("[repositories.fs.compress] setting was deprecated in OpenSearch and will be removed in a future release!" + " See the breaking changes documentation for the next major version.");
}
use of org.opensearch.repositories.fs.FsRepository in project OpenSearch by opensearch-project.
the class BlobStoreRepositoryRestoreTests method createRepository.
/**
* Create a {@link Repository} with a random name *
*/
private Repository createRepository() {
Settings settings = Settings.builder().put("location", randomAlphaOfLength(10)).build();
RepositoryMetadata repositoryMetadata = new RepositoryMetadata(randomAlphaOfLength(10), FsRepository.TYPE, settings);
final ClusterService clusterService = BlobStoreTestUtil.mockClusterService(repositoryMetadata);
final FsRepository repository = new FsRepository(repositoryMetadata, createEnvironment(), xContentRegistry(), clusterService, new RecoverySettings(Settings.EMPTY, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS))) {
@Override
protected void assertSnapshotOrGenericThread() {
// eliminate thread name check as we create repo manually
}
};
clusterService.addStateApplier(event -> repository.updateState(event.state()));
// Apply state once to initialize repo properly like RepositoriesService would
repository.updateState(clusterService.state());
repository.start();
return repository;
}
Aggregations