use of io.crate.execution.dml.ShardRequestExecutor in project crate by crate.
the class UpdateById method createExecutor.
private ShardRequestExecutor<ShardUpsertRequest> createExecutor(DependencyCarrier dependencies, PlannerContext plannerContext) {
ClusterService clusterService = dependencies.clusterService();
CoordinatorTxnCtx txnCtx = plannerContext.transactionContext();
ShardUpsertRequest.Builder requestBuilder = new ShardUpsertRequest.Builder(txnCtx.sessionSettings(), ShardingUpsertExecutor.BULK_REQUEST_TIMEOUT_SETTING.get(clusterService.state().metadata().settings()), ShardUpsertRequest.DuplicateKeyAction.UPDATE_OR_FAIL, true, assignments.targetNames(), // missing assignments are for INSERT .. ON DUPLICATE KEY UPDATE
null, returnValues, plannerContext.jobId(), false);
UpdateRequests updateRequests = new UpdateRequests(requestBuilder, table, assignments);
return new ShardRequestExecutor<>(clusterService, txnCtx, dependencies.nodeContext(), table, updateRequests, dependencies.transportActionProvider().transportShardUpsertAction()::execute, docKeys);
}
use of io.crate.execution.dml.ShardRequestExecutor in project crate by crate.
the class DeleteById method createExecutor.
private ShardRequestExecutor<ShardDeleteRequest> createExecutor(DependencyCarrier dependencies, PlannerContext plannerContext) {
ClusterService clusterService = dependencies.clusterService();
TimeValue requestTimeout = ShardingUpsertExecutor.BULK_REQUEST_TIMEOUT_SETTING.get(clusterService.state().metadata().settings());
return new ShardRequestExecutor<>(clusterService, plannerContext.transactionContext(), dependencies.nodeContext(), table, new DeleteRequests(plannerContext.jobId(), requestTimeout), dependencies.transportActionProvider().transportShardDeleteAction()::execute, docKeys);
}
Aggregations