Package com.facebook.presto.operator

Examples of com.facebook.presto.operator.TaskContext


    @BeforeMethod
    public void setUp()
    {
        executor = newCachedThreadPool(daemonThreadsNamed("test"));
        ConnectorSession session = new ConnectorSession("user", "source", "catalog", "schema", UTC_KEY, Locale.ENGLISH, "address", "agent");
        taskContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session);
    }
View Full Code Here


        return result;
    }

    private static DriverContext createDriverContext(ConnectorSession session)
    {
        return new TaskContext(new TaskId("query", "stage", "task"), EXECUTOR, session)
                .addPipelineContext(true, true)
                .addDriverContext();
    }
View Full Code Here

    @Override
    public MaterializedResult execute(ConnectorSession session, @Language("SQL") String sql)
    {
        MaterializedOutputFactory outputFactory = new MaterializedOutputFactory();

        TaskContext taskContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session);
        List<Driver> drivers = createDrivers(session, sql, outputFactory, taskContext);

        boolean done = false;
        while (!done) {
            boolean processed = false;
View Full Code Here

        }
        this.missingKeysTypes = missingKeysTypes.build();
        this.missingKeysChannels = missingKeysChannels.build();

        // create a bogus operator context with unlimited memory for the pages index
        this.bogusOperatorContext = new TaskContext(driverContext.getTaskId(), driverContext.getExecutor(), driverContext.getSession(), new DataSize(Long.MAX_VALUE, Unit.BYTE))
                .addPipelineContext(true, true)
                .addDriverContext()
                .addOperatorContext(0, "operator");

        this.outputPagesIndex = new PagesIndex(outputTypes, expectedPositions, bogusOperatorContext);
View Full Code Here

            // if we haven't started yet, return an empty IoStats
            if (taskExecution == null) {
                return new SqlTaskIoStats();
            }
            // get IoStats from the current task execution
            TaskContext taskContext = taskExecution.getTaskContext();
            return new SqlTaskIoStats(taskContext.getInputDataSize(), taskContext.getInputPositions(), taskContext.getOutputDataSize(), taskContext.getOutputPositions());
        }
View Full Code Here

        this.cpuTimerEnabled = checkNotNull(cpuTimerEnabled, "cpuTimerEnabled is null");
    }

    public SqlTaskExecution create(ConnectorSession session, TaskStateMachine taskStateMachine, SharedBuffer sharedBuffer, PlanFragment fragment, List<TaskSource> sources)
    {
        TaskContext taskContext = new TaskContext(
                taskStateMachine,
                taskNotificationExecutor,
                session,
                checkNotNull(maxTaskMemoryUsage, "maxTaskMemoryUsage is null"),
                checkNotNull(operatorPreAllocatedMemory, "operatorPreAllocatedMemory is null"),
View Full Code Here

    }

    private synchronized void initializeIndexSnapshotLoaderIfNecessary()
    {
        if (indexSnapshotLoader == null) {
            TaskContext taskContext = taskContextReference.get();
            checkState(taskContext != null, "Task context must be set before index can be built");
            PipelineContext pipelineContext = taskContext.addPipelineContext(false, false);
            indexSnapshotLoader = new IndexSnapshotLoader(
                    driverFactory,
                    pipelineContext,
                    sourcePlanNodeId,
                    pagesIndexOutput,
View Full Code Here

                {
                    return new BufferInfo(outputId, false, 0, 0);
                }
            }));

            TaskStats taskStats = new TaskContext(taskId, executor, session).getTaskStats();

            taskInfo = new StateMachine<>("task " + taskId, executor, new TaskInfo(
                    taskId,
                    TaskInfo.MIN_VERSION,
                    TaskState.PLANNED,
View Full Code Here

                        }
                    }
                }
            });

            this.taskContext = new TaskContext(taskStateMachine,
                    notificationExecutor,
                    session,
                    checkNotNull(maxTaskMemoryUsage, "maxTaskMemoryUsage is null"),
                    checkNotNull(operatorPreAllocatedMemory, "operatorPreAllocatedMemory is null"),
                    cpuTimerEnabled);
View Full Code Here

                {
                    return new BufferInfo(outputId, false, 0, 0);
                }
            }));

            TaskStats taskStats = new TaskContext(taskId, executor, session).getTaskStats();

            taskInfo = new StateMachine<>("task " + taskId, executor, new TaskInfo(
                    taskId,
                    TaskInfo.MIN_VERSION,
                    TaskState.PLANNED,
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.TaskContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.