Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.Split


            // add a split
            hiveSplitSource.addToQueue(new TestSplit(33));

            // wait for thread to get the split
            Split split = splits.get(200, TimeUnit.MILLISECONDS);
            assertSame(split.getInfo(), 33);
        }
        finally {
            // make sure the thread exits
            getterThread.interrupt();
        }
View Full Code Here


        for (Entry<ColumnHandle, Comparable<?>> entry : informationSchemaPartition.getFilters().entrySet()) {
            InformationSchemaColumnHandle informationSchemaColumnHandle = (InformationSchemaColumnHandle) entry.getKey();
            filters.put(informationSchemaColumnHandle.getColumnName(), entry.getValue());
        }

        Split split = new InformationSchemaSplit(informationSchemaPartition.table, filters.build(), localAddress);

        return ImmutableList.of(split);
    }
View Full Code Here

        @Override
        protected Split computeNext()
        {
            if (sourceIterator.hasNext()) {
                Split sourceSplit = sourceIterator.next();

                NativeSplit writingSplit = new NativeSplit(UUID.randomUUID(), ImmutableList.<HostAddress>of());

                String partition = "unpartitioned";
                boolean lastSplit = false;
                List<? extends PartitionKey> partitionKeys = ImmutableList.of();

                if (sourceSplit instanceof PartitionedSplit) {
                    PartitionedSplit partitionedSplit = (PartitionedSplit) sourceSplit;
                    partition = partitionedSplit.getPartitionId();
                    lastSplit = partitionedSplit.isLastSplit();
                    partitionKeys = partitionedSplit.getPartitionKeys();
                }

                addPartitionShard(partition, lastSplit, partitionKeys, writingSplit.getShardUuid());
                CollocatedSplit collocatedSplit = new CollocatedSplit(
                        ImmutableMap.of(
                                planNodeId, sourceSplit,
                                writerNode.getId(), writingSplit),
                        sourceSplit.getAddresses(),
                        sourceSplit.isRemotelyAccessible());

                shardsInFlight.incrementAndGet();

                return collocatedSplit;
            }
View Full Code Here

            }

            for (Map.Entry<UUID, Collection<String>> entry : shardNodes.build().asMap().entrySet()) {
                List<HostAddress> addresses = getAddressesForNodes(nodesById, entry.getValue());
                checkState(addresses.size() > 0, "no host for shard %s found", entry.getKey());
                Split split = new NativeSplit(entry.getKey(), addresses);
                splits.add(split);
            }
        }

        log.debug("Split retrieval for %d partitions (%d splits): %dms", partitions.size(), splits.size(), splitTimer.elapsed(TimeUnit.MILLISECONDS));
View Full Code Here

        }

        Partition partition = Iterables.getOnlyElement(partitions);
        checkArgument(partition instanceof DualPartition, "Partition must be a dual partition");

        Split split = new DualSplit(nodeManager.getCurrentNode().getHostAndPort());

        return ImmutableList.of(split);
    }
View Full Code Here

            }
            return splits.build();
        }

        HostAddress address = nodeManager.getCurrentNode().getHostAndPort();
        Split split = new SystemSplit(systemPartition.tableHandle, filters.build(), address);
        return ImmutableList.of(split);
    }
View Full Code Here

        TableHandle tableHandle = metadata.getTableHandle(new QualifiedTableName("default", "default", DualMetadata.NAME)).get();
        ColumnHandle columnHandle = metadata.getColumnHandle(tableHandle, DualMetadata.COLUMN_NAME).get();
        Symbol symbol = new Symbol(DualMetadata.COLUMN_NAME);

        // table scan with splitCount splits
        Split split = new DualSplit(HostAddress.fromString("127.0.0.1"));
        PlanNodeId tableScanNodeId = new PlanNodeId(planId);
        PlanFragment testFragment = new PlanFragment(
                new PlanFragmentId(planId),
                new TableScanNode(
                        tableScanNodeId,
View Full Code Here

        }
        final List<ColumnHandle> columnHandles = columnHandlesBuilder.build();
        final List<TupleInfo> columnTypes = columnTypesBuilder.build();

        // get the split for this table
        final Split split = getLocalQuerySplit(tableHandle);

        return new OperatorFactory()
        {
            @Override
            public List<TupleInfo> getTupleInfos()
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();
View Full Code Here

        TableHandle tableHandle = metadata.getTableHandle(new QualifiedTableName("default", "default", DualMetadata.NAME)).get();
        ColumnHandle columnHandle = metadata.getColumnHandle(tableHandle, DualMetadata.COLUMN_NAME).get();
        Symbol symbol = new Symbol(DualMetadata.COLUMN_NAME);

        // table scan with 3 splits
        Split split = new DualSplit(HostAddress.fromString("127.0.0.1"));
        PlanNodeId tableScanNodeId = new PlanNodeId(planId);
        PlanFragment testFragment = new PlanFragment(
                new PlanFragmentId(planId),
                new TableScanNode(
                        tableScanNodeId,
View Full Code Here

TOP

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

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.