Package com.facebook.presto

Examples of com.facebook.presto.ScheduledSplit


                    Predicates.<Partition>alwaysTrue(),
                    tableScan.getAssignments());

            ImmutableSet.Builder<ScheduledSplit> scheduledSplits = ImmutableSet.builder();
            for (Split split : dataSource.getSplits()) {
                scheduledSplits.add(new ScheduledSplit(sequenceId++, split));
            }

            sources.add(new TaskSource(tableScan.getId(), scheduledSplits.build(), true));
        }
View Full Code Here


            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();
                    throw Throwables.propagate(e);
View Full Code Here

            this.taskUpdateRequestCodec = taskUpdateRequestCodec;
            this.maxConsecutiveErrorCount = maxConsecutiveErrorCount;
            this.minErrorDuration = minErrorDuration;

            for (Entry<PlanNodeId, Split> entry : checkNotNull(initialSplits, "initialSplits is null").entries()) {
                ScheduledSplit scheduledSplit = new ScheduledSplit(nextSplitId.getAndIncrement(), entry.getValue());
                pendingSplits.put(entry.getKey(), scheduledSplit);
            }

            List<BufferInfo> bufferStates = ImmutableList.copyOf(transform(outputBuffers.getBuffers().keySet(), new Function<TaskId, BufferInfo>()
            {
View Full Code Here

            checkState(!noMoreSplits.contains(sourceId), "noMoreSplits has already been set for %s", sourceId);

            // only add pending split if not done
            if (!getTaskInfo().getState().isDone()) {
                for (Split split : splits) {
                    pendingSplits.put(sourceId, new ScheduledSplit(nextSplitId.getAndIncrement(), split));
                }
                needsUpdate.set(true);
            }

            scheduleUpdate();
View Full Code Here

        Driver driver = driverFactory.createDriver(pipelineContext.addDriverContext());

        Page indedKeyTuple = new Page(sliceBlocks(updateRequest.getBlocks(), 0, 1));
        PageRecordSet pageRecordSet = new PageRecordSet(indexTypes, indedKeyTuple);
        PlanNodeId planNodeId = Iterables.getOnlyElement(driverFactory.getSourceIds());
        driver.updateSource(new TaskSource(planNodeId, ImmutableSet.of(new ScheduledSplit(0, new Split("index", new IndexSplit(pageRecordSet)))), true));

        return new StreamingIndexedData(outputTypes, indexTypes, indedKeyTuple, pageBuffer, driver);
    }
View Full Code Here

            UnloadedIndexKeyRecordSet unloadedKeysRecordSet = new UnloadedIndexKeyRecordSet(indexSnapshotReference.get(), indexTypes, requests);

            // Drive index lookup to produce the output (landing in indexSnapshotBuilder)
            Driver driver = driverFactory.createDriver(pipelineContext.addDriverContext());
            PlanNodeId sourcePlanNodeId = Iterables.getOnlyElement(driverFactory.getSourceIds());
            driver.updateSource(new TaskSource(sourcePlanNodeId, ImmutableSet.of(new ScheduledSplit(0, new Split("index", new IndexSplit(unloadedKeysRecordSet)))), true));
            while (!driver.isFinished()) {
                ListenableFuture<?> process = driver.process();
                checkState(process.isDone(), "Driver should never block");
            }
View Full Code Here

            this.tupleInfos = planFragment.getTupleInfos();
            this.maxConsecutiveErrorCount = maxConsecutiveErrorCount;
            this.minErrorDuration = minErrorDuration;

            for (Entry<PlanNodeId, Split> entry : checkNotNull(initialSplits, "initialSplits is null").entries()) {
                ScheduledSplit scheduledSplit = new ScheduledSplit(nextSplitId.getAndIncrement(), entry.getValue());
                pendingSplits.put(entry.getKey(), scheduledSplit);
            }

            List<BufferInfo> bufferStates = ImmutableList.copyOf(transform(outputBuffers.getBuffers().keySet(), new Function<String, BufferInfo>()
            {
View Full Code Here

            checkState(!noMoreSplits.contains(sourceId), "noMoreSplits has already been set for %s", sourceId);

            // only add pending split if not done
            if (!getTaskInfo().getState().isDone()) {
                for (Split split : splits) {
                    pendingSplits.put(sourceId, new ScheduledSplit(nextSplitId.getAndIncrement(), split));
                }
                needsUpdate.set(true);
            }

            scheduleUpdate();
View Full Code Here

            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();
                    throw Throwables.propagate(e);
View Full Code Here

        assertFalse(driver.isFinished());
        // todo TableScanOperator should be blocked until split is set
        assertTrue(driver.processFor(new Duration(1, TimeUnit.MILLISECONDS)).isDone());
        assertFalse(driver.isFinished());

        driver.updateSource(new TaskSource(sourceId, ImmutableSet.of(new ScheduledSplit(0, new MockSplit())), true));

        assertFalse(driver.isFinished());
        assertTrue(driver.processFor(new Duration(1, TimeUnit.SECONDS)).isDone());
        assertTrue(driver.isFinished());
View Full Code Here

TOP

Related Classes of com.facebook.presto.ScheduledSplit

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.