use of io.crate.analyze.AnalyzedCreateRepository in project crate by crate.
the class CreateRepositoryPlan method createRequest.
@VisibleForTesting
public static PutRepositoryRequest createRequest(AnalyzedCreateRepository createRepository, CoordinatorTxnCtx txnCtx, NodeContext nodeCtx, Row parameters, SubQueryResults subQueryResults, RepositoryParamValidator repositoryParamValidator) {
Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate(txnCtx, nodeCtx, x, parameters, subQueryResults);
var genericProperties = createRepository.properties().map(eval);
var settings = genericPropertiesToSettings(genericProperties, // supported settings for the repository type
repositoryParamValidator.settingsForType(createRepository.type()).all());
repositoryParamValidator.validate(createRepository.type(), createRepository.properties(), settings);
PutRepositoryRequest request = new PutRepositoryRequest(createRepository.name());
request.type(createRepository.type());
request.settings(settings);
return request;
}
Aggregations