Package com.facebook.presto.metadata

Examples of com.facebook.presto.metadata.Node


        dataDir = Files.createTempDir();
        ShardManager shardManager = new DatabaseShardManager(dbi);
        InMemoryNodeManager nodeManager = new InMemoryNodeManager();

        String nodeName = UUID.randomUUID().toString();
        nodeManager.addNode("native", new Node(nodeName, new URI("http://127.0.0.1/"), NodeVersion.UNKNOWN));

        MetadataManager metadataManager = new MetadataManager();
        metadataManager.addConnectorMetadata("local", "local", new NativeMetadata("native", dbi));

        tableHandle = metadataManager.createTable("local", new TableMetadata("local", TEST_TABLE));
View Full Code Here


            metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, new DualMetadata());

            StageExecutionPlan joinPlan = createJoinPlan("A", metadata);

            InMemoryNodeManager nodeManager = new InMemoryNodeManager();
            nodeManager.addNode("foo", new Node("other", URI.create("http://127.0.0.1:11"), NodeVersion.UNKNOWN));

            OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                    .withBuffer("out", new UnpartitionedPagePartitionFunction())
                    .withNoMoreBufferIds();
View Full Code Here

            List<Node> nodes = selectNodes(nodeMap.get().get(), split, minCandidates);

            Preconditions.checkState(!nodes.isEmpty(), "No nodes available to run query");

            // select the node with the smallest number of assignments
            Node chosen = Ordering.from(nodeComparator).min(nodes);
            return chosen;
        }
View Full Code Here

                    long getSplitStart = System.nanoTime();
                    for (Split split : dataSource.get().getSplits()) {
                        getSplitDistribution.add(System.nanoTime() - getSplitStart);

                        long scheduleSplitStart = System.nanoTime();
                        Node chosen = chooseNode(nodeSelector, split, nextTaskId);

                        // if query has been canceled, exit cleanly; query will never run regardless
                        if (getState().isDone()) {
                            break;
                        }
View Full Code Here

            if (getState().isDone()) {
                return null;
            }

            // for each split, pick the node with the smallest number of assignments
            Node chosen = nodeSelector.selectNode(split);

            // if the chosen node doesn't have too many tasks already, return
            RemoteTask task = tasks.get(chosen);
            if (task == null || task.getQueuedSplits() < maxPendingSplitsPerNode) {
                return chosen;
View Full Code Here

        dataDir = Files.createTempDir();
        ShardManager shardManager = new DatabaseShardManager(dbi);
        InMemoryNodeManager nodeManager = new InMemoryNodeManager();

        String nodeName = UUID.randomUUID().toString();
        nodeManager.addNode("native", new Node(nodeName, new URI("http://127.0.0.1/"), NodeVersion.UNKNOWN));

        MetadataManager metadataManager = new MetadataManager();
        metadataManager.addConnectorMetadata("local", "local", new NativeMetadata("native", dbi, shardManager));

        tableHandle = metadataManager.createTable("local", new TableMetadata("local", TEST_TABLE));
View Full Code Here

            metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, new DualMetadata());

            StageExecutionPlan joinPlan = createJoinPlan("A", metadata);

            InMemoryNodeManager nodeManager = new InMemoryNodeManager();
            nodeManager.addNode("foo", new Node("other", URI.create("http://127.0.0.1:11"), NodeVersion.UNKNOWN));

            OutputBuffers outputBuffers = INITIAL_EMPTY_OUTPUT_BUFFERS
                    .withBuffer("out", new UnpartitionedPagePartitionFunction())
                    .withNoMoreBufferIds();
View Full Code Here

        else if (fragment.getOutputPartitioning() == OutputPartitioning.HASH) {
            checkArgument(noMoreParentNodes, "Hash partitioned output requires all parent nodes be added in a single call");

            ImmutableMap.Builder<String, PagePartitionFunction> buffers = ImmutableMap.builder();
            for (int nodeIndex = 0; nodeIndex < parentNodes.size(); nodeIndex++) {
                Node node = parentNodes.get(nodeIndex);
                // todo allow partition channel to be any channel
                buffers.put(node.getNodeIdentifier(), new HashPagePartitionFunction(nodeIndex, parentNodes.size(), 0));
            }

            newOutputBuffers = startingOutputBuffers
                    .withBuffers(buffers.build())
                    .withNoMoreBufferIds();
View Full Code Here

    private void scheduleFixedNodeCount(int nodeCount)
    {
        // create tasks on "nodeCount" random nodes
        List<Node> nodes = nodeSelector.selectRandomNodes(nodeCount);
        for (int taskId = 0; taskId < nodes.size(); taskId++) {
            Node node = nodes.get(taskId);
            scheduleTask(taskId, node);
        }

        // tell sub stages about all nodes and that there will not be more nodes)
        for (StageExecutionNode subStage : subStages.values()) {
View Full Code Here

        long getSplitStart = System.nanoTime();
        for (Split split : dataSource.get().getSplits()) {
            getSplitDistribution.add(System.nanoTime() - getSplitStart);

            long scheduleSplitStart = System.nanoTime();
            Node chosen = chooseNode(nodeSelector, split, nextTaskId);

            // if query has been canceled, exit cleanly; query will never run regardless
            if (getState().isDone()) {
                break;
            }
View Full Code Here

TOP

Related Classes of com.facebook.presto.metadata.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.