Package com.facebook.presto.spi

Examples of com.facebook.presto.spi.Page


                        "Master sequence id moved backwards: oldMasterSequenceId=%s, newMasterSequenceId=%s",
                        oldMasterSequenceId,
                        newMasterSequenceId);

                for (int i = 0; i < pagesToRemove; i++) {
                    Page page = masterBuffer.removeFirst();
                    bufferedBytes -= page.getSizeInBytes();
                }

                // refill buffer from queued pages
                while (!queuedPages.isEmpty() && bufferedBytes < maxBufferedBytes) {
                    QueuedPage queuedPage = queuedPages.remove();
View Full Code Here


            ImmutableList.Builder<RowIterable> pages = ImmutableList.builder();
            // wait up to max wait for data to arrive; then try to return at least DESIRED_RESULT_BYTES
            int bytes = 0;
            while (bytes < DESIRED_RESULT_BYTES) {
                Page page = exchangeClient.getNextPage(maxWait);
                if (page == null) {
                    break;
                }
                bytes += page.getSizeInBytes();
                pages.add(new RowIterable(session.toConnectorSession(), types, page));

                // only wait on first call
                maxWait = new Duration(0, TimeUnit.MILLISECONDS);
            }
View Full Code Here

            Block[] blocks = new Block[blockEncodings.length];
            for (int i = 0; i < blocks.length; i++) {
                blocks[i] = blockEncodings[i].readBlock(sliceInput);
            }

            @SuppressWarnings("UnnecessaryLocalVariable")
            Page page = new Page(positions, blocks);
            return page;
        }
View Full Code Here

    public static MaterializedResult materializeSourceDataStream(ConnectorSession session, ConnectorPageSource pageSource, List<Type> types)
    {
        MaterializedResult.Builder builder = resultBuilder(session, types);
        while (!pageSource.isFinished()) {
            Page outputPage = pageSource.getNextPage();
            if (outputPage == null) {
                break;
            }
            builder.page(outputPage);
        }
View Full Code Here

    }

    @Override
    public Page getOutput()
    {
        Page page = exchangeClient.pollPage();
        if (page != null) {
            operatorContext.recordGeneratedInput(page.getSizeInBytes(), page.getPositionCount());
        }
        return page;
    }
View Full Code Here

        if (pageBuilder.isEmpty()) {
            state = State.FINISHED;
            return null;
        }

        Page page = pageBuilder.build();
        return page;
    }
View Full Code Here

    /**
     * Return the next page from pageBuffer that has a non-zero position count, or null if none available
     */
    private static Page extractNonEmptyPage(PageBuffer pageBuffer)
    {
        Page page = pageBuffer.poll();
        while (page != null && page.getPositionCount() == 0) {
            page = pageBuffer.poll();
        }
        return page;
    }
View Full Code Here

            }
        }
        if (pageBuilder.isEmpty()) {
            return null;
        }
        Page page = pageBuilder.build();
        memoryManager.freeMemory(-sizeDelta);
        return page;
    }
View Full Code Here

    }

    @Override
    public Page getOutput()
    {
        Page page = pageSource.getNextPage();
        if (page == null) {
            return null;
        }

        // update operator stats
        long endCompletedBytes = pageSource.getCompletedBytes();
        long endReadTimeNanos = pageSource.getReadTimeNanos();
        operatorContext.recordGeneratedInput(endCompletedBytes - completedBytes, page.getPositionCount(), endReadTimeNanos - readTimeNanos);
        completedBytes = endCompletedBytes;
        readTimeNanos = endReadTimeNanos;

        return page;
    }
View Full Code Here

        return nextPosition;
    }

    private boolean loadNextPage()
    {
        Page nextPage = extractNonEmptyPage(pageBuffer);
        while (nextPage == null) {
            if (driver.isFinished()) {
                return false;
            }
            driver.process();
View Full Code Here

TOP

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

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.