Examples of SplitSource


Examples of com.facebook.presto.execution.SplitSource

                continue;
            }

            TableScanNode tableScan = (TableScanNode) sourceNode;

            SplitSource splitSource = splitManager.getPartitionSplits(tableScan.getTable(), getPartitions(tableScan));

            ImmutableSet.Builder<ScheduledSplit> scheduledSplits = ImmutableSet.builder();
            while (!splitSource.isFinished()) {
                try {
                    for (Split split : splitSource.getNextBatch(1000)) {
                        scheduledSplits.add(new ScheduledSplit(sequenceId++, split));
                    }
                }
                catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
View Full Code Here

Examples of com.facebook.presto.execution.SplitSource

    private Split getLocalQuerySplit(TableHandle tableHandle)
    {
        try {
            List<Partition> partitions = splitManager.getPartitions(tableHandle, Optional.<TupleDomain<ColumnHandle>>absent()).getPartitions();
            SplitSource splitSource = splitManager.getPartitionSplits(tableHandle, partitions);
            Split split = Iterables.getOnlyElement(splitSource.getNextBatch(1000));
            while (!splitSource.isFinished()) {
                checkState(splitSource.getNextBatch(1000).isEmpty(), "Expected only one split for a local query");
            }
            return split;
        }
        catch (InterruptedException e) {
            Thread.currentThread().interrupt();
View Full Code Here

Examples of com.facebook.presto.execution.SplitSource

    {
        @Override
        public Optional<SplitSource> visitTableScan(TableScanNode node, Void context)
        {
            // get dataSource for table
            SplitSource splitSource = splitManager.getPartitionSplits(node.getTable(), getPartitions(node));

            return Optional.of(splitSource);
        }
View Full Code Here

Examples of com.facebook.presto.execution.SplitSource

                    return node.getSource().accept(this, context);

                case SYSTEM:
                    Optional<SplitSource> nodeSplits = node.getSource().accept(this, context);
                    if (nodeSplits.isPresent()) {
                        SplitSource sampledSplitSource = new SampledSplitSource(nodeSplits.get(), node.getSampleRatio());
                        return Optional.of(sampledSplitSource);
                    }
                    // table sampling on a sub query without splits is meaningless
                    return nodeSplits;
View Full Code Here

Examples of com.facebook.presto.execution.SplitSource

                continue;
            }

            TableScanNode tableScan = (TableScanNode) sourceNode;

            SplitSource splitSource = splitManager.getPartitionSplits(tableScan.getTable(), getPartitions(tableScan));

            ImmutableSet.Builder<ScheduledSplit> scheduledSplits = ImmutableSet.builder();
            while (!splitSource.isFinished()) {
                try {
                    for (Split split : splitSource.getNextBatch(1000)) {
                        scheduledSplits.add(new ScheduledSplit(sequenceId++, split));
                    }
                }
                catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
View Full Code Here

Examples of com.facebook.presto.spi.SplitSource

            List<Partition> partitions = FluentIterable.from(getPartitions(node))
                    .filter(materializedViewPartitionPredicate)
                    .toList();

            // get dataSource for table
            SplitSource splitSource = splitManager.getPartitionSplits(node.getTable(), partitions);

            return new NodeSplits(node.getId(), splitSource);
        }
View Full Code Here

Examples of com.facebook.presto.spi.SplitSource

                    return node.getSource().accept(this, materializedViewPartitionPredicate);

                case SYSTEM: {
                    NodeSplits nodeSplits = node.getSource().accept(this, materializedViewPartitionPredicate);
                    if (nodeSplits.getDataSource().isPresent()) {
                        SplitSource sampledSplitSource = new SampledSplitSource(nodeSplits.getDataSource().get(), node.getSampleRatio());
                        return new NodeSplits(node.getId(), sampledSplitSource);
                    }
                    else {
                        // table sampling on a sub query without splits is meaningless
                        return nodeSplits;
View Full Code Here

Examples of com.facebook.presto.spi.SplitSource

            MaterializedViewWriter materializedViewWriter = new MaterializedViewWriter(node, shardManager);

            // get source splits
            NodeSplits nodeSplits = node.getSource().accept(this, materializedViewWriter.getPartitionPredicate());
            checkState(nodeSplits.getDataSource().isPresent(), "No splits present for import");
            SplitSource splitSource = nodeSplits.getDataSource().get();

            // record output
            outputReceivers.put(node.getId(), materializedViewWriter.getOutputReceiver());

            // wrap splits with table writer info
View Full Code Here

Examples of com.facebook.presto.spi.SplitSource

        ImmutableList.Builder<Split> splits = ImmutableList.builder();
        for (int i = 0; i < splitCount; i++) {
            splits.add(new DualSplit(HostAddress.fromString("127.0.0.1")));
        }
        SplitSource splitSource = new FixedSplitSource(null, splits.build());

        return new StageExecutionPlan(testFragment,
                Optional.of(splitSource),
                ImmutableList.<StageExecutionPlan>of()
        );
View Full Code Here

Examples of com.facebook.presto.spi.SplitSource

            throws InterruptedException
    {
        AtomicInteger nextTaskId = new AtomicInteger(0);
        long getSplitStart = System.nanoTime();

        SplitSource splitSource = this.dataSource.get();
        while (!splitSource.isFinished()) {
            getSplitDistribution.add(System.nanoTime() - getSplitStart);

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

            Multimap<Node, Split> nodeSplits = ArrayListMultimap.create();
            for (Split split : splitSource.getNextBatch(splitBatchSize)) {
                Node node = chooseNode(nodeSelector, split, nextTaskId);
                nodeSplits.put(node, split);
            }

            for (Entry<Node, Collection<Split>> taskSplits : nodeSplits.asMap().entrySet()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.