use of io.crate.planner.DependencyCarrier in project crate by crate.
the class CreateTablePlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) {
BoundCreateTable boundCreateTable = bind(createTable, plannerContext.transactionContext(), dependencies.nodeContext(), params, subQueryResults, numberOfShards, schemas, dependencies.fulltextAnalyzerResolver());
if (boundCreateTable.noOp()) {
consumer.accept(InMemoryBatchIterator.empty(SENTINEL), null);
return;
}
tableCreator.create(boundCreateTable).whenComplete(new OneRowActionListener<>(consumer, rCount -> new Row1(rCount == null ? -1 : rCount)));
}
use of io.crate.planner.DependencyCarrier in project crate by crate.
the class AlterTableOpenClosePlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) {
Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate(plannerContext.transactionContext(), plannerContext.nodeContext(), x, params, subQueryResults);
DocTableInfo tableInfo = analyzedAlterTable.tableInfo();
Table<Object> table = analyzedAlterTable.table().map(eval);
PartitionName partitionName = null;
if (tableInfo.isPartitioned()) {
partitionName = PartitionPropertiesAnalyzer.createPartitionName(table.partitionProperties(), tableInfo);
}
dependencies.alterTableOperation().executeAlterTableOpenClose(tableInfo, analyzedAlterTable.isOpenTable(), partitionName).whenComplete(new OneRowActionListener<>(consumer, rCount -> new Row1(rCount == null ? -1 : rCount)));
}
use of io.crate.planner.DependencyCarrier in project crate by crate.
the class AlterBlobTablePlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) {
Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate(plannerContext.transactionContext(), plannerContext.nodeContext(), x, params, subQueryResults);
TableInfo tableInfo = analyzedAlterTable.tableInfo();
AlterTable<Object> alterTable = analyzedAlterTable.alterTable().map(eval);
TableParameter tableParameter = getTableParameter(alterTable, TableParameters.ALTER_BLOB_TABLE_PARAMETERS);
maybeRaiseBlockedException(tableInfo, tableParameter.settings());
BoundAlterTable stmt = new BoundAlterTable(tableInfo, null, tableParameter, true, false);
dependencies.alterTableOperation().executeAlterTable(stmt).whenComplete(new OneRowActionListener<>(consumer, rCount -> new Row1(rCount == null ? -1 : rCount)));
}
use of io.crate.planner.DependencyCarrier in project crate by crate.
the class AlterUserPlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) throws Exception {
SecureHash newPassword = UserActions.generateSecureHash(alterUser.properties(), params, plannerContext.transactionContext(), plannerContext.nodeContext());
userManager.alterUser(alterUser.userName(), newPassword).whenComplete(new OneRowActionListener<>(consumer, rCount -> new Row1(rCount == null ? -1 : rCount)));
}
use of io.crate.planner.DependencyCarrier in project crate by crate.
the class CreateUserPlan method executeOrFail.
@Override
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row params, SubQueryResults subQueryResults) throws Exception {
SecureHash newPassword = UserActions.generateSecureHash(createUser.properties(), params, plannerContext.transactionContext(), plannerContext.nodeContext());
userManager.createUser(createUser.userName(), newPassword).whenComplete(new OneRowActionListener<>(consumer, rCount -> new Row1(rCount == null ? -1 : rCount)));
}
Aggregations