Package com.facebook.presto.util

Examples of com.facebook.presto.util.SetThreadName


        checkNotNull(httpClient, "httpClient is null");
        checkNotNull(executor, "executor is null");
        checkNotNull(taskInfoCodec, "taskInfoCodec is null");
        checkNotNull(taskUpdateRequestCodec, "taskUpdateRequestCodec is null");

        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            this.taskId = taskId;
            this.session = session;
            this.nodeId = nodeId;
            this.planFragment = planFragment;
            this.outputBuffers.set(outputBuffers);
View Full Code Here


    }

    @Override
    public void start()
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            // to start we just need to trigger an update
            scheduleUpdate();
        }
    }
View Full Code Here

    }

    @Override
    public synchronized void addSplits(PlanNodeId sourceId, Iterable<Split> splits)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            checkNotNull(sourceId, "sourceId is null");
            checkNotNull(splits, "splits is null");
            checkState(!noMoreSplits.contains(sourceId), "noMoreSplits has already been set for %s", sourceId);

            // only add pending split if not done
View Full Code Here

    }

    @Override
    public synchronized void noMoreSplits(PlanNodeId sourceId)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            if (noMoreSplits.add(sourceId)) {
                needsUpdate.set(true);
                scheduleUpdate();
            }
        }
View Full Code Here

    }

    @Override
    public synchronized void setOutputBuffers(OutputBuffers newOutputBuffers)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            if (getTaskInfo().getState().isDone()) {
                return;
            }

            if (newOutputBuffers.getVersion() > outputBuffers.get().getVersion()) {
View Full Code Here

    }

    @Override
    public synchronized int getQueuedSplits()
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            int pendingSplitCount = 0;
            pendingSplitCount = pendingSplits.get(planFragment.getPartitionedSource()).size();
            return pendingSplitCount + taskInfo.get().getStats().getQueuedDrivers();
        }
    }
View Full Code Here

    }

    @Override
    public void addStateChangeListener(StateChangeListener<TaskInfo> stateChangeListener)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            taskInfo.addStateChangeListener(stateChangeListener);
        }
    }
View Full Code Here

    @Override
    public Duration waitForTaskToFinish(Duration maxWait)
            throws InterruptedException
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            while (true) {
                TaskInfo currentState = taskInfo.get();
                if (maxWait.toMillis() <= 1 || currentState.getState().isDone()) {
                    return maxWait;
                }
View Full Code Here

    }

    @Override
    public synchronized void cancel()
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            // clear pending splits to free memory
            pendingSplits.clear();

            // cancel pending request
            if (currentRequest != null) {
View Full Code Here

        }
    }

    private synchronized void requestSucceeded(TaskInfo newValue, List<TaskSource> sources)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            updateTaskInfo(newValue);
            lastSuccessfulRequest.set(System.nanoTime());
            errorCount.set(0);
            errorsSinceLastSuccess.clear();
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.