Package com.facebook.presto.util

Examples of com.facebook.presto.util.SetThreadName


    }

    @Override
    public void cancel()
    {
        try (SetThreadName setThreadName = new SetThreadName("Query-%s", stateMachine.getQueryId())) {
            stateMachine.cancel();
            cancelOutputStage();
        }
    }
View Full Code Here


        }
    }

    private void cancelOutputStage()
    {
        try (SetThreadName setThreadName = new SetThreadName("Query-%s", stateMachine.getQueryId())) {
            SqlStageExecution stageExecution = outputStage.get();
            if (stageExecution != null) {
                stageExecution.cancel(true);
            }
        }
View Full Code Here

    @Override
    public void cancelStage(StageId stageId)
    {
        Preconditions.checkNotNull(stageId, "stageId is null");

        try (SetThreadName setThreadName = new SetThreadName("Query-%s", stateMachine.getQueryId())) {
            SqlStageExecution stageExecution = outputStage.get();
            if (stageExecution != null) {
                stageExecution.cancelStage(stageId);
            }
        }
View Full Code Here

    }

    @Override
    public void fail(Throwable cause)
    {
        try (SetThreadName setThreadName = new SetThreadName("Query-%s", stateMachine.getQueryId())) {
            // transition to failed state, only if not already finished
            stateMachine.fail(cause);
            cancelOutputStage();
        }
    }
View Full Code Here

    @Override
    public Duration waitForStateChange(QueryState currentState, Duration maxWait)
            throws InterruptedException
    {
        try (SetThreadName setThreadName = new SetThreadName("Query-%s", stateMachine.getQueryId())) {
            return stateMachine.waitForStateChange(currentState, maxWait);
        }
    }
View Full Code Here

    }

    @Override
    public QueryInfo getQueryInfo()
    {
        try (SetThreadName setThreadName = new SetThreadName("Query-%s", stateMachine.getQueryId())) {
            SqlStageExecution outputStage = this.outputStage.get();
            StageInfo stageInfo = null;
            if (outputStage != null) {
                stageInfo = outputStage.getStageInfo();
            }
View Full Code Here

        }

        @Override
        public void run()
        {
            try (SetThreadName setThreadName = new SetThreadName("Query-%s", queryExecution.getQueryInfo().getQueryId())) {
                stats.queryStarted();
                queryExecution.start();
            }
        }
View Full Code Here

        checkArgument(initialHashPartitions > 0, "initialHashPartitions must be greater than 0");
        checkArgument(maxPendingSplitsPerNode > 0, "maxPendingSplitsPerNode must be greater than 0");
        checkNotNull(executor, "executor is null");

        this.stageId = new StageId(queryId, String.valueOf(nextStageId.getAndIncrement()));
        try (SetThreadName setThreadName = new SetThreadName("Stage-%s", stageId)) {
            this.parent = parent;
            this.location = locationFactory.createStageLocation(stageId);
            this.fragment = plan.getFragment();
            this.outputReceivers = plan.getOutputReceivers();
            this.dataSource = plan.getDataSource();
View Full Code Here

    }

    @Override
    public void cancelStage(StageId stageId)
    {
        try (SetThreadName setThreadName = new SetThreadName("Stage-%s", stageId)) {
            if (stageId.equals(this.stageId)) {
                cancel(true);
            }
            else {
                for (StageExecutionNode subStage : subStages.values()) {
View Full Code Here

    @Override
    @VisibleForTesting
    public StageState getState()
    {
        try (SetThreadName setThreadName = new SetThreadName("Stage-%s", stageId)) {
            return stageState.get();
        }
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.util.SetThreadName

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.