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 = node.getNodeIdentifier();
            this.planFragment = planFragment;
            this.outputReceivers = ImmutableMap.copyOf(outputReceivers);
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 addSplit(Split split)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            checkNotNull(split, "split is null");
            checkState(!noMoreSplits, "noMoreSplits has already been set");
            checkState(planFragment.isPartitioned(), "Plan is not partitioned");

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

    }

    @Override
    public synchronized void noMoreSplits()
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            Preconditions.checkState(!noMoreSplits, "noMoreSplits has already been set");
            noMoreSplits = true;
            needsUpdate.set(true);

            scheduleUpdate();
View Full Code Here

    }

    @Override
    public synchronized void addExchangeLocations(Multimap<PlanNodeId, URI> additionalLocations, boolean noMore)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            if (getTaskInfo().getState().isDone()) {
                return;
            }

            if (noMoreExchangeLocations == noMore && exchangeLocations.entries().containsAll(additionalLocations.entries())) {
View Full Code Here

    }

    @Override
    public synchronized void addOutputBuffers(Set<String> outputBuffers, boolean noMore)
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            if (getTaskInfo().getState().isDone()) {
                return;
            }

            if (noMoreOutputIds == noMore && this.outputIds.containsAll(outputBuffers)) {
View Full Code Here

    }

    @Override
    public synchronized int getQueuedSplits()
    {
        try (SetThreadName setThreadName = new SetThreadName("HttpRemoteTask-%s", taskId)) {
            int pendingSplitCount = 0;
            if (planFragment.isPartitioned()) {
                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

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.