Search in sources :

Example 6 with InternalNode

use of com.facebook.presto.metadata.InternalNode in project presto by prestodb.

the class NodeScheduler method selectExactNodes.

public static List<InternalNode> selectExactNodes(NodeMap nodeMap, List<HostAddress> hosts, boolean includeCoordinator) {
    Set<InternalNode> chosen = new LinkedHashSet<>();
    Set<String> coordinatorIds = nodeMap.getCoordinatorNodeIds();
    for (HostAddress host : hosts) {
        nodeMap.getAllNodesByHostAndPort().get(host).stream().filter(node -> includeCoordinator || !coordinatorIds.contains(node.getNodeIdentifier())).forEach(chosen::add);
        InetAddress address;
        try {
            address = host.toInetAddress();
        } catch (UnknownHostException e) {
            // skip hosts that don't resolve
            continue;
        }
        // consider a split with a host without a port as being accessible by all nodes in that host
        if (!host.hasPort()) {
            nodeMap.getAllNodesByHost().get(address).stream().filter(node -> includeCoordinator || !coordinatorIds.contains(node.getNodeIdentifier())).forEach(chosen::add);
        }
    }
    // if the chosen set is empty and the host is the coordinator, force pick the coordinator
    if (chosen.isEmpty() && !includeCoordinator) {
        for (HostAddress host : hosts) {
            // In the code below, before calling `chosen::add`, it could have been checked that
            // `coordinatorIds.contains(node.getNodeIdentifier())`. But checking the condition isn't necessary
            // because every node satisfies it. Otherwise, `chosen` wouldn't have been empty.
            nodeMap.getAllNodesByHostAndPort().get(host).stream().forEach(chosen::add);
            InetAddress address;
            try {
                address = host.toInetAddress();
            } catch (UnknownHostException e) {
                // skip hosts that don't resolve
                continue;
            }
            // consider a split with a host without a port as being accessible by all nodes in that host
            if (!host.hasPort()) {
                nodeMap.getAllNodesByHost().get(address).stream().forEach(chosen::add);
            }
        }
    }
    return ImmutableList.copyOf(chosen);
}
Also used : LinkedHashSet(java.util.LinkedHashSet) NodeTaskMap(com.facebook.presto.execution.NodeTaskMap) CounterStat(com.facebook.airlift.stats.CounterStat) MoreFutures.whenAnyCompleteCancelOthers(com.facebook.airlift.concurrent.MoreFutures.whenAnyCompleteCancelOthers) Suppliers.memoizeWithExpiration(com.google.common.base.Suppliers.memoizeWithExpiration) NodeSelectionStats(com.facebook.presto.execution.scheduler.nodeSelection.NodeSelectionStats) SystemSessionProperties.getResourceAwareSchedulingStrategy(com.facebook.presto.SystemSessionProperties.getResourceAwareSchedulingStrategy) Duration(io.airlift.units.Duration) ACTIVE(com.facebook.presto.spi.NodeState.ACTIVE) InetAddress(java.net.InetAddress) PreDestroy(javax.annotation.PreDestroy) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) InternalNodeManager(com.facebook.presto.metadata.InternalNodeManager) HashMultimap(com.google.common.collect.HashMultimap) SimpleTtlNodeSelector(com.facebook.presto.execution.scheduler.nodeSelection.SimpleTtlNodeSelector) SplitContext(com.facebook.presto.spi.SplitContext) Map(java.util.Map) ImmutableSetMultimap(com.google.common.collect.ImmutableSetMultimap) SystemSessionProperties.getMaxUnacknowledgedSplitsPerTask(com.facebook.presto.SystemSessionProperties.getMaxUnacknowledgedSplitsPerTask) ImmutableMap(com.google.common.collect.ImmutableMap) SimpleNodeSelector(com.facebook.presto.execution.scheduler.nodeSelection.SimpleNodeSelector) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) NetworkTopologyType(com.facebook.presto.execution.scheduler.NodeSchedulerConfig.NetworkTopologyType) HostAddress(com.facebook.presto.spi.HostAddress) Set(java.util.Set) NodeSelector(com.facebook.presto.execution.scheduler.nodeSelection.NodeSelector) Math.ceil(java.lang.Math.ceil) Math.min(java.lang.Math.min) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Objects(java.util.Objects) List(java.util.List) TTL(com.facebook.presto.execution.scheduler.NodeSchedulerConfig.ResourceAwareSchedulingStrategy.TTL) NodeTtlFetcherManager(com.facebook.presto.ttl.nodettlfetchermanagers.NodeTtlFetcherManager) ConnectorId(com.facebook.presto.spi.ConnectorId) ResourceAwareSchedulingStrategy(com.facebook.presto.execution.scheduler.NodeSchedulerConfig.ResourceAwareSchedulingStrategy) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) SimpleTtlNodeSelectorConfig(com.facebook.presto.execution.scheduler.nodeSelection.SimpleTtlNodeSelectorConfig) Supplier(com.google.common.base.Supplier) HashMap(java.util.HashMap) QueryManager(com.facebook.presto.execution.QueryManager) Multimap(com.google.common.collect.Multimap) Inject(javax.inject.Inject) HashSet(java.util.HashSet) ImmutableList(com.google.common.collect.ImmutableList) Objects.requireNonNull(java.util.Objects.requireNonNull) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) LinkedHashSet(java.util.LinkedHashSet) Futures.immediateFuture(com.google.common.util.concurrent.Futures.immediateFuture) ALIVE(com.facebook.presto.metadata.InternalNode.NodeStatus.ALIVE) Session(com.facebook.presto.Session) UnknownHostException(java.net.UnknownHostException) InternalNode(com.facebook.presto.metadata.InternalNode) RemoteTask(com.facebook.presto.execution.RemoteTask) TopologyAwareNodeSelector(com.facebook.presto.execution.scheduler.nodeSelection.TopologyAwareNodeSelector) Math.addExact(java.lang.Math.addExact) Split(com.facebook.presto.metadata.Split) SplitWeight(com.facebook.presto.spi.SplitWeight) SECONDS(java.util.concurrent.TimeUnit.SECONDS) UnknownHostException(java.net.UnknownHostException) InternalNode(com.facebook.presto.metadata.InternalNode) HostAddress(com.facebook.presto.spi.HostAddress) InetAddress(java.net.InetAddress)

Example 7 with InternalNode

use of com.facebook.presto.metadata.InternalNode in project presto by prestodb.

the class NodeScheduler method selectDistributionNodes.

public static SplitPlacementResult selectDistributionNodes(NodeMap nodeMap, NodeTaskMap nodeTaskMap, long maxSplitsWeightPerNode, long maxPendingSplitsWeightPerTask, int maxUnacknowledgedSplitsPerTask, Set<Split> splits, List<RemoteTask> existingTasks, BucketNodeMap bucketNodeMap, NodeSelectionStats nodeSelectionStats) {
    Multimap<InternalNode, Split> assignments = HashMultimap.create();
    NodeAssignmentStats assignmentStats = new NodeAssignmentStats(nodeTaskMap, nodeMap, existingTasks);
    Set<InternalNode> blockedNodes = new HashSet<>();
    for (Split split : splits) {
        // node placement is forced by the bucket to node map
        InternalNode node = bucketNodeMap.getAssignedNode(split).get();
        boolean isCacheable = bucketNodeMap.isSplitCacheable(split);
        SplitWeight splitWeight = split.getSplitWeight();
        // if node is full, don't schedule now, which will push back on the scheduling of splits
        if (canAssignSplitToDistributionNode(assignmentStats, node, maxSplitsWeightPerNode, maxPendingSplitsWeightPerTask, maxUnacknowledgedSplitsPerTask, splitWeight)) {
            if (isCacheable) {
                split = new Split(split.getConnectorId(), split.getTransactionHandle(), split.getConnectorSplit(), split.getLifespan(), new SplitContext(true));
                nodeSelectionStats.incrementBucketedPreferredNodeSelectedCount();
            } else {
                nodeSelectionStats.incrementBucketedNonPreferredNodeSelectedCount();
            }
            assignments.put(node, split);
            assignmentStats.addAssignedSplit(node, splitWeight);
        } else {
            blockedNodes.add(node);
        }
    }
    ListenableFuture<?> blocked = toWhenHasSplitQueueSpaceFuture(blockedNodes, existingTasks, calculateLowWatermark(maxPendingSplitsWeightPerTask));
    return new SplitPlacementResult(blocked, ImmutableMultimap.copyOf(assignments));
}
Also used : SplitWeight(com.facebook.presto.spi.SplitWeight) SplitContext(com.facebook.presto.spi.SplitContext) InternalNode(com.facebook.presto.metadata.InternalNode) Split(com.facebook.presto.metadata.Split) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet)

Example 8 with InternalNode

use of com.facebook.presto.metadata.InternalNode in project presto by prestodb.

the class SimpleNodeSelector method computeAssignments.

@Override
public SplitPlacementResult computeAssignments(Set<Split> splits, List<RemoteTask> existingTasks) {
    Multimap<InternalNode, Split> assignment = HashMultimap.create();
    NodeMap nodeMap = this.nodeMap.get().get();
    NodeAssignmentStats assignmentStats = new NodeAssignmentStats(nodeTaskMap, nodeMap, existingTasks);
    List<InternalNode> eligibleNodes = getEligibleNodes(maxTasksPerStage, nodeMap, existingTasks);
    NodeSelection randomNodeSelection = new RandomNodeSelection(eligibleNodes, minCandidates);
    Set<InternalNode> blockedExactNodes = new HashSet<>();
    boolean splitWaitingForAnyNode = false;
    NodeProvider nodeProvider = nodeMap.getActiveNodeProvider(nodeSelectionHashStrategy);
    OptionalInt preferredNodeCount = OptionalInt.empty();
    for (Split split : splits) {
        List<InternalNode> candidateNodes;
        switch(split.getNodeSelectionStrategy()) {
            case HARD_AFFINITY:
                candidateNodes = selectExactNodes(nodeMap, split.getPreferredNodes(nodeProvider), includeCoordinator);
                preferredNodeCount = OptionalInt.of(candidateNodes.size());
                break;
            case SOFT_AFFINITY:
                // Using all nodes for soft affinity scheduling with modular hashing because otherwise temporarily down nodes would trigger too much rehashing
                if (nodeSelectionHashStrategy == MODULAR_HASHING) {
                    nodeProvider = new ModularHashingNodeProvider(nodeMap.getAllNodes());
                }
                candidateNodes = selectExactNodes(nodeMap, split.getPreferredNodes(nodeProvider), includeCoordinator);
                preferredNodeCount = OptionalInt.of(candidateNodes.size());
                candidateNodes = ImmutableList.<InternalNode>builder().addAll(candidateNodes).addAll(randomNodeSelection.pickNodes(split)).build();
                break;
            case NO_PREFERENCE:
                candidateNodes = randomNodeSelection.pickNodes(split);
                break;
            default:
                throw new PrestoException(NODE_SELECTION_NOT_SUPPORTED, format("Unsupported node selection strategy %s", split.getNodeSelectionStrategy()));
        }
        if (candidateNodes.isEmpty()) {
            log.debug("No nodes available to schedule %s. Available nodes %s", split, nodeMap.getActiveNodes());
            throw new PrestoException(NO_NODES_AVAILABLE, "No nodes available to run query");
        }
        SplitWeight splitWeight = split.getSplitWeight();
        Optional<InternalNodeInfo> chosenNodeInfo = chooseLeastBusyNode(splitWeight, candidateNodes, assignmentStats::getTotalSplitsWeight, preferredNodeCount, maxSplitsWeightPerNode, assignmentStats);
        if (!chosenNodeInfo.isPresent()) {
            chosenNodeInfo = chooseLeastBusyNode(splitWeight, candidateNodes, assignmentStats::getQueuedSplitsWeightForStage, preferredNodeCount, maxPendingSplitsWeightPerTask, assignmentStats);
        }
        if (chosenNodeInfo.isPresent()) {
            split = new Split(split.getConnectorId(), split.getTransactionHandle(), split.getConnectorSplit(), split.getLifespan(), new SplitContext(chosenNodeInfo.get().isCacheable()));
            InternalNode chosenNode = chosenNodeInfo.get().getInternalNode();
            assignment.put(chosenNode, split);
            assignmentStats.addAssignedSplit(chosenNode, splitWeight);
        } else {
            if (split.getNodeSelectionStrategy() != HARD_AFFINITY) {
                splitWaitingForAnyNode = true;
            } else // Exact node set won't matter, if a split is waiting for any node
            if (!splitWaitingForAnyNode) {
                blockedExactNodes.addAll(candidateNodes);
            }
        }
    }
    ListenableFuture<?> blocked;
    if (splitWaitingForAnyNode) {
        blocked = toWhenHasSplitQueueSpaceFuture(existingTasks, calculateLowWatermark(maxPendingSplitsWeightPerTask));
    } else {
        blocked = toWhenHasSplitQueueSpaceFuture(blockedExactNodes, existingTasks, calculateLowWatermark(maxPendingSplitsWeightPerTask));
    }
    return new SplitPlacementResult(blocked, assignment);
}
Also used : NodeAssignmentStats(com.facebook.presto.execution.scheduler.NodeAssignmentStats) InternalNodeInfo(com.facebook.presto.execution.scheduler.InternalNodeInfo) PrestoException(com.facebook.presto.spi.PrestoException) NodeProvider(com.facebook.presto.spi.NodeProvider) ModularHashingNodeProvider(com.facebook.presto.execution.scheduler.ModularHashingNodeProvider) OptionalInt(java.util.OptionalInt) ModularHashingNodeProvider(com.facebook.presto.execution.scheduler.ModularHashingNodeProvider) SplitWeight(com.facebook.presto.spi.SplitWeight) SplitContext(com.facebook.presto.spi.SplitContext) BucketNodeMap(com.facebook.presto.execution.scheduler.BucketNodeMap) NodeMap(com.facebook.presto.execution.scheduler.NodeMap) InternalNode(com.facebook.presto.metadata.InternalNode) Split(com.facebook.presto.metadata.Split) SplitPlacementResult(com.facebook.presto.execution.scheduler.SplitPlacementResult) Sets.newHashSet(com.google.common.collect.Sets.newHashSet) HashSet(java.util.HashSet)

Example 9 with InternalNode

use of com.facebook.presto.metadata.InternalNode in project presto by prestodb.

the class SimpleTtlNodeSelector method getEligibleNodes.

private List<InternalNode> getEligibleNodes(int limit, NodeMap nodeMap, List<RemoteTask> existingTasks) {
    Map<InternalNode, NodeTtl> nodeTtlInfo = nodeTtlFetcherManager.getAllTtls();
    Map<InternalNode, Optional<ConfidenceBasedTtlInfo>> ttlInfo = nodeTtlInfo.entrySet().stream().collect(toImmutableMap(Map.Entry::getKey, e -> e.getValue().getTtlInfo().stream().min(Comparator.comparing(ConfidenceBasedTtlInfo::getExpiryInstant))));
    Duration estimatedExecutionTimeRemaining = getEstimatedExecutionTimeRemaining();
    // Of the nodes on which already have existing tasks, pick only those whose TTL is enough
    List<InternalNode> existingEligibleNodes = existingTasks.stream().map(remoteTask -> nodeMap.getActiveNodesByNodeId().get(remoteTask.getNodeId())).filter(Objects::nonNull).filter(ttlInfo::containsKey).filter(node -> ttlInfo.get(node).isPresent()).filter(node -> isTtlEnough(ttlInfo.get(node).get(), estimatedExecutionTimeRemaining)).collect(toList());
    int alreadySelectedNodeCount = existingEligibleNodes.size();
    List<InternalNode> activeNodes = nodeMap.getActiveNodes();
    List<InternalNode> newEligibleNodes = filterNodesByTtl(activeNodes, ImmutableSet.copyOf(existingEligibleNodes), ttlInfo, estimatedExecutionTimeRemaining);
    if (alreadySelectedNodeCount < limit && newEligibleNodes.size() > 0) {
        List<InternalNode> moreNodes = selectNodes(limit - alreadySelectedNodeCount, new ResettableRandomizedIterator<>(newEligibleNodes));
        existingEligibleNodes.addAll(moreNodes);
    }
    verify(existingEligibleNodes.stream().allMatch(Objects::nonNull), "existingNodes list must not contain any nulls");
    return existingEligibleNodes;
}
Also used : NodeTaskMap(com.facebook.presto.execution.NodeTaskMap) NodeScheduler.selectNodes(com.facebook.presto.execution.scheduler.NodeScheduler.selectNodes) Duration(io.airlift.units.Duration) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) SplitContext(com.facebook.presto.spi.SplitContext) BucketNodeMap(com.facebook.presto.execution.scheduler.BucketNodeMap) Map(java.util.Map) ConfidenceBasedTtlInfo(com.facebook.presto.spi.ttl.ConfidenceBasedTtlInfo) NODE_SELECTION_NOT_SUPPORTED(com.facebook.presto.spi.StandardErrorCode.NODE_SELECTION_NOT_SUPPORTED) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Set(java.util.Set) NO_NODES_AVAILABLE(com.facebook.presto.spi.StandardErrorCode.NO_NODES_AVAILABLE) Instant(java.time.Instant) String.format(java.lang.String.format) Objects(java.util.Objects) List(java.util.List) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) NodeTtlFetcherManager(com.facebook.presto.ttl.nodettlfetchermanagers.NodeTtlFetcherManager) ResettableRandomizedIterator(com.facebook.presto.execution.scheduler.ResettableRandomizedIterator) NodeTtl(com.facebook.presto.spi.ttl.NodeTtl) Optional(java.util.Optional) NodeScheduler.calculateLowWatermark(com.facebook.presto.execution.scheduler.NodeScheduler.calculateLowWatermark) Logger(com.facebook.airlift.log.Logger) SplitPlacementResult(com.facebook.presto.execution.scheduler.SplitPlacementResult) ListenableFuture(com.google.common.util.concurrent.ListenableFuture) InternalNodeInfo(com.facebook.presto.execution.scheduler.InternalNodeInfo) Supplier(com.google.common.base.Supplier) NodeMap(com.facebook.presto.execution.scheduler.NodeMap) QueryManager(com.facebook.presto.execution.QueryManager) PrestoException(com.facebook.presto.spi.PrestoException) OptionalInt(java.util.OptionalInt) AtomicReference(java.util.concurrent.atomic.AtomicReference) NodeScheduler.toWhenHasSplitQueueSpaceFuture(com.facebook.presto.execution.scheduler.NodeScheduler.toWhenHasSplitQueueSpaceFuture) Verify.verify(com.google.common.base.Verify.verify) Objects.requireNonNull(java.util.Objects.requireNonNull) Suppliers(com.google.common.base.Suppliers) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) SECONDS(java.time.temporal.ChronoUnit.SECONDS) Futures.immediateFuture(com.google.common.util.concurrent.Futures.immediateFuture) Session(com.facebook.presto.Session) NodeSelectionStrategy(com.facebook.presto.spi.schedule.NodeSelectionStrategy) NodeAssignmentStats(com.facebook.presto.execution.scheduler.NodeAssignmentStats) InternalNode(com.facebook.presto.metadata.InternalNode) TimeUnit(java.util.concurrent.TimeUnit) Collectors.toList(java.util.stream.Collectors.toList) RemoteTask(com.facebook.presto.execution.RemoteTask) Split(com.facebook.presto.metadata.Split) VisibleForTesting(com.google.common.annotations.VisibleForTesting) SplitWeight(com.facebook.presto.spi.SplitWeight) Comparator(java.util.Comparator) Optional(java.util.Optional) Objects(java.util.Objects) NodeTtl(com.facebook.presto.spi.ttl.NodeTtl) Duration(io.airlift.units.Duration) InternalNode(com.facebook.presto.metadata.InternalNode) NodeTaskMap(com.facebook.presto.execution.NodeTaskMap) BucketNodeMap(com.facebook.presto.execution.scheduler.BucketNodeMap) Map(java.util.Map) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) NodeMap(com.facebook.presto.execution.scheduler.NodeMap)

Example 10 with InternalNode

use of com.facebook.presto.metadata.InternalNode in project presto by prestodb.

the class SqlStageExecution method scheduleTask.

private synchronized RemoteTask scheduleTask(InternalNode node, TaskId taskId, Multimap<PlanNodeId, Split> sourceSplits) {
    checkArgument(!allTasks.contains(taskId), "A task with id %s already exists", taskId);
    ImmutableMultimap.Builder<PlanNodeId, Split> initialSplits = ImmutableMultimap.builder();
    initialSplits.putAll(sourceSplits);
    sourceTasks.forEach((planNodeId, task) -> {
        TaskStatus status = task.getTaskStatus();
        if (status.getState() != TaskState.FINISHED) {
            initialSplits.put(planNodeId, createRemoteSplitFor(taskId, task.getRemoteTaskLocation(), task.getTaskId()));
        }
    });
    OutputBuffers outputBuffers = this.outputBuffers.get();
    checkState(outputBuffers != null, "Initial output buffers must be set before a task can be scheduled");
    RemoteTask task = remoteTaskFactory.createRemoteTask(session, taskId, node, planFragment, initialSplits.build(), outputBuffers, nodeTaskMap.createTaskStatsTracker(node, taskId), summarizeTaskInfo, tableWriteInfo);
    completeSources.forEach(task::noMoreSplits);
    allTasks.add(taskId);
    tasks.computeIfAbsent(node, key -> newConcurrentHashSet()).add(task);
    nodeTaskMap.addTask(node, task);
    task.addStateChangeListener(new StageTaskListener(taskId));
    task.addFinalTaskInfoListener(this::updateFinalTaskInfo);
    if (!stateMachine.getState().isDone()) {
        task.start();
    } else {
        // stage finished while we were scheduling this task
        task.abort();
    }
    return task;
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) RemoteSourceNode(com.facebook.presto.sql.planner.plan.RemoteSourceNode) GENERIC_INTERNAL_ERROR(com.facebook.presto.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR) Duration(io.airlift.units.Duration) TableWriteInfo(com.facebook.presto.execution.scheduler.TableWriteInfo) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) PlanFragment(com.facebook.presto.sql.planner.PlanFragment) HashMultimap(com.google.common.collect.HashMultimap) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) URI(java.net.URI) ImmutableSet(com.google.common.collect.ImmutableSet) REMOTE_TASK_MISMATCH(com.facebook.presto.spi.StandardErrorCode.REMOTE_TASK_MISMATCH) SplitSchedulerStats(com.facebook.presto.execution.scheduler.SplitSchedulerStats) ImmutableMap(com.google.common.collect.ImmutableMap) Collection(java.util.Collection) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) Set(java.util.Set) ThreadSafe(javax.annotation.concurrent.ThreadSafe) PAGE_TRANSPORT_TIMEOUT(com.facebook.presto.spi.StandardErrorCode.PAGE_TRANSPORT_TIMEOUT) GuardedBy(javax.annotation.concurrent.GuardedBy) Sets(com.google.common.collect.Sets) String.format(java.lang.String.format) Preconditions.checkState(com.google.common.base.Preconditions.checkState) DataSize(io.airlift.units.DataSize) List(java.util.List) TOO_MANY_REQUESTS_FAILED(com.facebook.presto.spi.StandardErrorCode.TOO_MANY_REQUESTS_FAILED) Entry(java.util.Map.Entry) Optional(java.util.Optional) PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) OutputBuffers(com.facebook.presto.execution.buffer.OutputBuffers) ErrorCode(com.facebook.presto.spi.ErrorCode) NANOSECONDS(java.util.concurrent.TimeUnit.NANOSECONDS) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SystemSessionProperties.getMaxFailedTaskPercentage(com.facebook.presto.SystemSessionProperties.getMaxFailedTaskPercentage) PrestoException(com.facebook.presto.spi.PrestoException) Multimap(com.google.common.collect.Multimap) AtomicReference(java.util.concurrent.atomic.AtomicReference) REMOTE_HOST_GONE(com.facebook.presto.spi.StandardErrorCode.REMOTE_HOST_GONE) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Objects.requireNonNull(java.util.Objects.requireNonNull) RemoteSplit(com.facebook.presto.split.RemoteSplit) PlanFragmentId(com.facebook.presto.sql.planner.plan.PlanFragmentId) GENERIC_RECOVERY_ERROR(com.facebook.presto.spi.StandardErrorCode.GENERIC_RECOVERY_ERROR) RemoteTransactionHandle(com.facebook.presto.metadata.RemoteTransactionHandle) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) ExecutorService(java.util.concurrent.ExecutorService) PAGE_TRANSPORT_ERROR(com.facebook.presto.spi.StandardErrorCode.PAGE_TRANSPORT_ERROR) Executor(java.util.concurrent.Executor) Session(com.facebook.presto.Session) Sets.newConcurrentHashSet(com.google.common.collect.Sets.newConcurrentHashSet) Iterables.getOnlyElement(com.google.common.collect.Iterables.getOnlyElement) InternalNode(com.facebook.presto.metadata.InternalNode) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) StateChangeListener(com.facebook.presto.execution.StateMachine.StateChangeListener) REMOTE_TASK_ERROR(com.facebook.presto.spi.StandardErrorCode.REMOTE_TASK_ERROR) FailureDetector(com.facebook.presto.failureDetector.FailureDetector) REMOTE_CONNECTOR_ID(com.facebook.presto.operator.ExchangeOperator.REMOTE_CONNECTOR_ID) Split(com.facebook.presto.metadata.Split) GONE(com.facebook.presto.failureDetector.FailureDetector.State.GONE) BYTE(io.airlift.units.DataSize.Unit.BYTE) OutputBuffers(com.facebook.presto.execution.buffer.OutputBuffers) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) RemoteSplit(com.facebook.presto.split.RemoteSplit) Split(com.facebook.presto.metadata.Split)

Aggregations

InternalNode (com.facebook.presto.metadata.InternalNode)74 Split (com.facebook.presto.metadata.Split)34 Test (org.testng.annotations.Test)34 ConnectorSplit (com.facebook.presto.spi.ConnectorSplit)25 HashSet (java.util.HashSet)24 ImmutableList (com.google.common.collect.ImmutableList)17 InMemoryNodeManager (com.facebook.presto.metadata.InMemoryNodeManager)14 SplitPlacementResult (com.facebook.presto.execution.scheduler.SplitPlacementResult)13 NodeSelectionStats (com.facebook.presto.execution.scheduler.nodeSelection.NodeSelectionStats)12 NodeSelector (com.facebook.presto.execution.scheduler.nodeSelection.NodeSelector)12 ImmutableSet (com.google.common.collect.ImmutableSet)12 SimpleTtlNodeSelectorConfig (com.facebook.presto.execution.scheduler.nodeSelection.SimpleTtlNodeSelectorConfig)11 ConnectorId (com.facebook.presto.spi.ConnectorId)11 TestingTransactionHandle (com.facebook.presto.testing.TestingTransactionHandle)11 Duration (io.airlift.units.Duration)11 URI (java.net.URI)11 Map (java.util.Map)11 RemoteTask (com.facebook.presto.execution.RemoteTask)10 NodeScheduler (com.facebook.presto.execution.scheduler.NodeScheduler)10 NodeSchedulerConfig (com.facebook.presto.execution.scheduler.NodeSchedulerConfig)9