use of io.crate.execution.engine.indexing.ShardDMLExecutor in project crate by crate.
the class ProjectionToProjectorVisitor method visitDeleteProjection.
@Override
public Projector visitDeleteProjection(DeleteProjection projection, Context context) {
checkShardLevel("Delete projection can only be executed on a shard");
TimeValue reqTimeout = ShardingUpsertExecutor.BULK_REQUEST_TIMEOUT_SETTING.get(settings);
ShardDMLExecutor<?, ?, ?, ?> shardDMLExecutor = new ShardDMLExecutor<>(context.jobId, ShardDMLExecutor.DEFAULT_BULK_SIZE, threadPool.scheduler(), threadPool.executor(ThreadPool.Names.SEARCH), resolveUidCollectExpression(context.txnCtx, projection.uidSymbol()), clusterService, nodeJobsCounter, () -> new ShardDeleteRequest(shardId, context.jobId).timeout(reqTimeout), ShardDeleteRequest.Item::new, transportActionProvider.transportShardDeleteAction()::execute, ShardDMLExecutor.ROW_COUNT_COLLECTOR);
return new DMLProjector(shardDMLExecutor);
}
Aggregations