Search in sources :

Example 1 with DMLProjector

use of io.crate.execution.engine.indexing.DMLProjector 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);
}
Also used : ShardDeleteRequest(io.crate.execution.dml.delete.ShardDeleteRequest) ShardDMLExecutor(io.crate.execution.engine.indexing.ShardDMLExecutor) DMLProjector(io.crate.execution.engine.indexing.DMLProjector) TimeValue(io.crate.common.unit.TimeValue)

Aggregations

TimeValue (io.crate.common.unit.TimeValue)1 ShardDeleteRequest (io.crate.execution.dml.delete.ShardDeleteRequest)1 DMLProjector (io.crate.execution.engine.indexing.DMLProjector)1 ShardDMLExecutor (io.crate.execution.engine.indexing.ShardDMLExecutor)1