Search in sources :

Example 1 with RepositoryAlreadyExistsException

use of io.crate.exceptions.RepositoryAlreadyExistsException in project crate by crate.

the class CreateRepositoryAnalyzer method analyze.

public CreateRepositoryAnalyzedStatement analyze(CreateRepository node, ParameterContext parameterContext) {
    String repositoryName = node.repository();
    if (repositoryService.getRepository(repositoryName) != null) {
        throw new RepositoryAlreadyExistsException(repositoryName);
    }
    Settings settings = repositoryParamValidator.convertAndValidate(node.type(), node.properties(), parameterContext);
    return new CreateRepositoryAnalyzedStatement(repositoryName, node.type(), settings);
}
Also used : RepositoryAlreadyExistsException(io.crate.exceptions.RepositoryAlreadyExistsException) Settings(org.elasticsearch.common.settings.Settings)

Aggregations

RepositoryAlreadyExistsException (io.crate.exceptions.RepositoryAlreadyExistsException)1 Settings (org.elasticsearch.common.settings.Settings)1