Search in sources :

Example 1 with TypeSettings

use of io.crate.analyze.repositories.TypeSettings in project crate by crate.

the class S3RepositoryPluginAnalyzerTest method prepare.

@Before
public void prepare() {
    RepositoriesMetadata repositoriesMetadata = new RepositoriesMetadata(Collections.singletonList(new RepositoryMetadata("my_repo", "fs", Settings.builder().put("location", "/tmp/my_repo").build())));
    ClusterState clusterState = ClusterState.builder(new ClusterName("testing")).metadata(Metadata.builder().putCustom(RepositoriesMetadata.TYPE, repositoriesMetadata)).build();
    ClusterServiceUtils.setState(clusterService, clusterState);
    e = SQLExecutor.builder(clusterService).build();
    plannerContext = e.getPlannerContext(clusterService.state());
    repositoryParamValidator = new RepositoryParamValidator(Map.of("s3", new TypeSettings(List.of(), S3Repository.optionalSettings())));
}
Also used : RepositoryParamValidator(io.crate.analyze.repositories.RepositoryParamValidator) RepositoriesMetadata(org.elasticsearch.cluster.metadata.RepositoriesMetadata) ClusterState(org.elasticsearch.cluster.ClusterState) RepositoryMetadata(org.elasticsearch.cluster.metadata.RepositoryMetadata) ClusterName(org.elasticsearch.cluster.ClusterName) TypeSettings(io.crate.analyze.repositories.TypeSettings) Before(org.junit.Before)

Example 2 with TypeSettings

use of io.crate.analyze.repositories.TypeSettings in project crate by crate.

the class AzureRepositoryAnalyzerTest method prepare.

@Before
public void prepare() {
    RepositoriesMetadata repositoriesMetadata = new RepositoriesMetadata(Collections.singletonList(new RepositoryMetadata("my_repo", "fs", Settings.builder().put("location", "/tmp/my_repo").build())));
    ClusterState clusterState = ClusterState.builder(new ClusterName("testing")).metadata(Metadata.builder().putCustom(RepositoriesMetadata.TYPE, repositoriesMetadata)).build();
    ClusterServiceUtils.setState(clusterService, clusterState);
    e = SQLExecutor.builder(clusterService).build();
    plannerContext = e.getPlannerContext(clusterService.state());
    repositoryParamValidator = new RepositoryParamValidator(Map.of("azure", new TypeSettings(AzureRepository.mandatorySettings(), AzureRepository.optionalSettings())));
}
Also used : RepositoryParamValidator(io.crate.analyze.repositories.RepositoryParamValidator) RepositoriesMetadata(org.elasticsearch.cluster.metadata.RepositoriesMetadata) ClusterState(org.elasticsearch.cluster.ClusterState) RepositoryMetadata(org.elasticsearch.cluster.metadata.RepositoryMetadata) ClusterName(org.elasticsearch.cluster.ClusterName) TypeSettings(io.crate.analyze.repositories.TypeSettings) Before(org.junit.Before)

Example 3 with TypeSettings

use of io.crate.analyze.repositories.TypeSettings in project crate by crate.

the class CreateDropRepositoryAnalyzerTest method prepare.

@Before
public void prepare() {
    RepositoriesMetadata repositoriesMetadata = new RepositoriesMetadata(Collections.singletonList(new RepositoryMetadata("my_repo", "fs", Settings.builder().put("location", "/tmp/my_repo").build())));
    ClusterState clusterState = ClusterState.builder(new ClusterName("testing")).metadata(Metadata.builder().putCustom(RepositoriesMetadata.TYPE, repositoriesMetadata)).build();
    ClusterServiceUtils.setState(clusterService, clusterState);
    e = SQLExecutor.builder(clusterService).build();
    plannerContext = e.getPlannerContext(clusterService.state());
    repositoryParamValidator = new RepositoryParamValidator(Map.of("fs", new TypeSettings(FsRepository.mandatorySettings(), FsRepository.optionalSettings())));
}
Also used : RepositoryParamValidator(io.crate.analyze.repositories.RepositoryParamValidator) RepositoriesMetadata(org.elasticsearch.cluster.metadata.RepositoriesMetadata) ClusterState(org.elasticsearch.cluster.ClusterState) RepositoryMetadata(org.elasticsearch.cluster.metadata.RepositoryMetadata) ClusterName(org.elasticsearch.cluster.ClusterName) TypeSettings(io.crate.analyze.repositories.TypeSettings) Before(org.junit.Before)

Aggregations

RepositoryParamValidator (io.crate.analyze.repositories.RepositoryParamValidator)3 TypeSettings (io.crate.analyze.repositories.TypeSettings)3 ClusterName (org.elasticsearch.cluster.ClusterName)3 ClusterState (org.elasticsearch.cluster.ClusterState)3 RepositoriesMetadata (org.elasticsearch.cluster.metadata.RepositoriesMetadata)3 RepositoryMetadata (org.elasticsearch.cluster.metadata.RepositoryMetadata)3 Before (org.junit.Before)3