Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.SplitSource


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


        List<Partition> partitions = partitionResult.getPartitions();
        TupleDomain columnUnionedTupleDomain = TupleDomain.columnWiseUnion(partitions.get(0).getTupleDomain(), partitions.get(1).getTupleDomain());
        assertEquals(columnUnionedTupleDomain, TupleDomain.withColumnDomains(ImmutableMap.of(dsColumnHandle, Domain.create(SortedRangeSet.of(Range.equal("1"), Range.equal("2")), false))));

        SplitSource splitSource = nativeSplitManager.getPartitionSplits(tableHandle, partitions);
        int splitCount = 0;
        while (!splitSource.isFinished()) {
            splitCount += splitSource.getNextBatch(1000).size();
        }
        assertEquals(splitCount, 4);
    }
View Full Code Here

        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

                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

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

        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
        PartitionResult partitionResult = dualSplitManager.getPartitions(tableHandle, TupleDomain.all());

        SplitSource splitSource = dualSplitManager.getPartitionSplits(tableHandle, partitionResult.getPartitions());
        split = Iterables.getOnlyElement(splitSource.getNextBatch(1));
        assertTrue(splitSource.isFinished());

        planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
                metadata,
                new DataStreamManager(new DualDataStreamProvider()),
View Full Code Here

        List<Partition> partitions = partitionResult.getPartitions();
        TupleDomain columnUnionedTupleDomain = partitions.get(0).getTupleDomain().columnWiseUnion(partitions.get(1).getTupleDomain());
        assertEquals(columnUnionedTupleDomain, TupleDomain.withColumnDomains(ImmutableMap.of(dsColumnHandle, Domain.create(SortedRangeSet.of(Range.equal("1"), Range.equal("2")), false))));

        SplitSource splitSource = nativeSplitManager.getPartitionSplits(tableHandle, partitions);
        int splitCount = 0;
        while (!splitSource.isFinished()) {
            splitCount += splitSource.getNextBatch(1000).size();
        }
        assertEquals(splitCount, 4);
    }
View Full Code Here

        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
        PartitionResult partitionResult = dualSplitManager.getPartitions(tableHandle, TupleDomain.all());

        SplitSource splitSource = dualSplitManager.getPartitionSplits(tableHandle, partitionResult.getPartitions());
        split = Iterables.getOnlyElement(splitSource.getNextBatch(1));
        assertTrue(splitSource.isFinished());

        LocalExecutionPlanner planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
                metadata,
                new DataStreamManager(new DualDataStreamProvider()),
View Full Code Here

        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
        PartitionResult partitionResult = dualSplitManager.getPartitions(tableHandle, TupleDomain.all());

        SplitSource splitSource = dualSplitManager.getPartitionSplits(tableHandle, partitionResult.getPartitions());
        split = Iterables.getOnlyElement(splitSource.getNextBatch(1));
        assertTrue(splitSource.isFinished());

        planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
                metadata,
                new DataStreamManager(new DualDataStreamProvider()),
View Full Code Here

        metadata.addInternalSchemaMetadata(MetadataManager.INTERNAL_CONNECTOR_ID, dualMetadata);

        DualSplitManager dualSplitManager = new DualSplitManager(new InMemoryNodeManager());
        PartitionResult partitionResult = dualSplitManager.getPartitions(tableHandle, TupleDomain.all());

        SplitSource splitSource = dualSplitManager.getPartitionSplits(tableHandle, partitionResult.getPartitions());
        split = Iterables.getOnlyElement(splitSource.getNextBatch(1));
        assertTrue(splitSource.isFinished());

        LocalExecutionPlanner planner = new LocalExecutionPlanner(
                new NodeInfo("test"),
                metadata,
                new DataStreamManager(new DualDataStreamProvider()),
View Full Code Here

TOP

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

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.