Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.Node


    private void assignSplits(AtomicInteger nextTaskId, Multimap<Node, Split> splitAssignment)
    {
        for (Entry<Node, Collection<Split>> taskSplits : splitAssignment.asMap().entrySet()) {
            long scheduleSplitStart = System.nanoTime();
            Node node = taskSplits.getKey();

            RemoteTask task = tasks.get(node);
            if (task == null) {
                scheduleTask(nextTaskId.getAndIncrement(), node, fragment.getPartitionedSource(), taskSplits.getValue());
View Full Code Here


        for (Map.Entry<Node, RemoteTask> entry : tasks1.entrySet()) {
            assertEquals(entry.getValue().getQueuedSplits(), 5);
        }

        // Add new node
        Node additionalNode = new PrestoNode("other4", URI.create("http://127.0.0.1:14"), NodeVersion.UNKNOWN);
        nodeManager.addNode("foo", additionalNode);

        // Schedule next query
        SqlStageExecution sqlStageExecution2 = createSqlStageExecution(nodeScheduler, 2, 20);
        Future future2 = sqlStageExecution2.start();
View Full Code Here

    private static List<HostAddress> getAddressesForNodes(Map<String, Node> nodeMap, Iterable<String> nodeIdentifiers)
    {
        ImmutableList.Builder<HostAddress> nodes = ImmutableList.builder();
        for (String id : nodeIdentifiers) {
            Node node = nodeMap.get(id);
            if (node != null) {
                nodes.add(node.getHostAndPort());
            }
        }
        return nodes.build();
    }
View Full Code Here

                        log.debug("Skipping Node %s, which is in the database but not active!", nodeIdentifier);
                        continue;
                    }

                    Iterable<Long> orphanedShards = shardManager.getOrphanedShardIds(Optional.of(nodeIdentifier));
                    Node node = activeNodes.get(nodeIdentifier);

                    for (Long shardId : orphanedShards) {
                        ListenableFutureTask<Void> task = ListenableFutureTask.create(new ShardDropJob(shardId, node), null);
                        nodeBoundedExecutor.execute(nodeIdentifier, task);
                        builder.add(task);
View Full Code Here

        for (Map.Entry<Node, RemoteTask> entry : tasks1.entrySet()) {
            assertEquals(entry.getValue().getQueuedSplits(), 5);
        }

        // Add new node
        Node additionalNode = new PrestoNode("other4", URI.create("http://127.0.0.1:14"), NodeVersion.UNKNOWN);
        nodeManager.addNode("foo", additionalNode);

        // Schedule next query
        SqlStageExecution sqlStageExecution2 = createSqlStageExecution(nodeScheduler, 2, 20);
        Future future2 = sqlStageExecution2.start();
View Full Code Here

                        log.debug("Skipping Node %s, which is in the database but not active!", nodeIdentifier);
                        continue;
                    }

                    Iterable<Long> orphanedShards = shardManager.getOrphanedShardIds(Optional.of(nodeIdentifier));
                    Node node = activeNodes.get(nodeIdentifier);

                    for (Long shardId : orphanedShards) {
                        ListenableFutureTask<Void> task = ListenableFutureTask.create(new ShardDropJob(shardId, node), null);
                        nodeBoundedExecutor.execute(nodeIdentifier, task);
                        builder.add(task);
View Full Code Here

                else {
                    candidateNodes = selectRandomNodes(minCandidates);
                }
                checkCondition(!candidateNodes.isEmpty(), NO_NODES_AVAILABLE, "No nodes available to run query");

                Node chosen = null;
                int min = Integer.MAX_VALUE;
                for (Node node : candidateNodes) {
                    RemoteTask task = taskMap.get(node);
                    int currentSplits = (task == null) ? 0 : task.getQueuedSplits();
                    int assignedSplits = currentSplits + assignment.get(node).size();
View Full Code Here

        for (Map.Entry<Node, RemoteTask> entry : tasks1.entrySet()) {
            assertEquals(entry.getValue().getPartitionedSplitCount(), 5);
        }

        // Add new node
        Node additionalNode = new PrestoNode("other4", URI.create("http://127.0.0.1:14"), NodeVersion.UNKNOWN);
        nodeManager.addNode("foo", additionalNode);

        // Schedule next query with 5 splits. Since the new node does not have any splits, all 5 splits are assigned to the new node
        SqlStageExecution sqlStageExecution2 = createSqlStageExecution(nodeScheduler, 5, 5);
        Future future2 = sqlStageExecution2.start();
View Full Code Here

    @Test
    public void testMaxSplitsPerNode()
            throws Exception
    {
        Node newNode = new PrestoNode("other4", URI.create("http://127.0.0.1:14"), NodeVersion.UNKNOWN);
        nodeManager.addNode("foo", newNode);

        ImmutableList.Builder<Split> initialSplits = ImmutableList.builder();
        for (int i = 0; i < 10; i++) {
            initialSplits.add(new Split("foo", new TestSplitRemote()));
View Full Code Here

    @Test
    public void testMaxSplitsPerNodePerTask()
            throws Exception
    {
        Node newNode = new PrestoNode("other4", URI.create("http://127.0.0.1:14"), NodeVersion.UNKNOWN);
        nodeManager.addNode("foo", newNode);

        ImmutableList.Builder<Split> initialSplits = ImmutableList.builder();
        for (int i = 0; i < 20; i++) {
            initialSplits.add(new Split("foo", new TestSplitRemote()));
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.Node

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.