Search in sources :

Example 16 with DriverFactory

use of com.facebook.presto.operator.DriverFactory in project presto by prestodb.

the class PrestoSparkTaskExecution method createTaskHandle.

// this is a separate method to ensure that the `this` reference is not leaked during construction
private static TaskHandle createTaskHandle(TaskStateMachine taskStateMachine, TaskContext taskContext, LocalExecutionPlan localExecutionPlan, TaskExecutor taskExecutor) {
    TaskHandle taskHandle = taskExecutor.addTask(taskStateMachine.getTaskId(), () -> 0, getInitialSplitsPerNode(taskContext.getSession()), getSplitConcurrencyAdjustmentInterval(taskContext.getSession()), getMaxDriversPerTask(taskContext.getSession()));
    taskStateMachine.addStateChangeListener(state -> {
        if (state.isDone()) {
            taskExecutor.removeTask(taskHandle);
            for (DriverFactory factory : localExecutionPlan.getDriverFactories()) {
                factory.noMoreDrivers();
            }
        }
    });
    return taskHandle;
}
Also used : DriverFactory(com.facebook.presto.operator.DriverFactory) TaskHandle(com.facebook.presto.execution.executor.TaskHandle)

Aggregations

DriverFactory (com.facebook.presto.operator.DriverFactory)16 Driver (com.facebook.presto.operator.Driver)7 OperatorFactory (com.facebook.presto.operator.OperatorFactory)7 HashBuilderOperatorFactory (com.facebook.presto.operator.HashBuilderOperator.HashBuilderOperatorFactory)6 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)6 PagesIndex (com.facebook.presto.operator.PagesIndex)5 Type (com.facebook.presto.common.type.Type)4 PagesSerdeFactory (com.facebook.presto.execution.buffer.PagesSerdeFactory)4 DriverContext (com.facebook.presto.operator.DriverContext)4 ValuesOperatorFactory (com.facebook.presto.operator.ValuesOperator.ValuesOperatorFactory)4 NullOutputOperatorFactory (com.facebook.presto.testing.NullOutputOperator.NullOutputOperatorFactory)4 Page (com.facebook.presto.common.Page)3 AggregationOperatorFactory (com.facebook.presto.operator.AggregationOperator.AggregationOperatorFactory)3 DeleteOperatorFactory (com.facebook.presto.operator.DeleteOperator.DeleteOperatorFactory)3 DistinctLimitOperatorFactory (com.facebook.presto.operator.DistinctLimitOperator.DistinctLimitOperatorFactory)3 ExplainAnalyzeOperatorFactory (com.facebook.presto.operator.ExplainAnalyzeOperator.ExplainAnalyzeOperatorFactory)3 HashAggregationOperatorFactory (com.facebook.presto.operator.HashAggregationOperator.HashAggregationOperatorFactory)3 HashSemiJoinOperatorFactory (com.facebook.presto.operator.HashSemiJoinOperator.HashSemiJoinOperatorFactory)3 JoinOperatorFactory (com.facebook.presto.operator.JoinOperatorFactory)3 LimitOperatorFactory (com.facebook.presto.operator.LimitOperator.LimitOperatorFactory)3