Search in sources :

Example 1 with IndexCreationException

use of org.elasticsearch.indices.IndexCreationException in project crate by crate.

the class MetadataCreateIndexService method validateIndexSettings.

public void validateIndexSettings(String indexName, final Settings settings, final ClusterState clusterState, final boolean forbidPrivateIndexSettings) throws IndexCreationException {
    List<String> validationErrors = getIndexSettingsValidationErrors(settings, forbidPrivateIndexSettings);
    if (validationErrors.isEmpty() == false) {
        ValidationException validationException = new ValidationException();
        validationException.addValidationErrors(validationErrors);
        throw new IndexCreationException(indexName, validationException);
    }
}
Also used : ValidationException(org.elasticsearch.common.ValidationException) IndexCreationException(org.elasticsearch.indices.IndexCreationException)

Example 2 with IndexCreationException

use of org.elasticsearch.indices.IndexCreationException in project elasticsearch by elastic.

the class MetaDataCreateIndexService method validateIndexSettings.

public void validateIndexSettings(String indexName, Settings settings) throws IndexCreationException {
    List<String> validationErrors = getIndexSettingsValidationErrors(settings);
    if (validationErrors.isEmpty() == false) {
        ValidationException validationException = new ValidationException();
        validationException.addValidationErrors(validationErrors);
        throw new IndexCreationException(indexName, validationException);
    }
}
Also used : ValidationException(org.elasticsearch.common.ValidationException) IndexCreationException(org.elasticsearch.indices.IndexCreationException)

Aggregations

ValidationException (org.elasticsearch.common.ValidationException)2 IndexCreationException (org.elasticsearch.indices.IndexCreationException)2