Package com.facebook.presto.operator

Examples of com.facebook.presto.operator.Page


            valuesBlock = createLongsBlock(values);
            weightsBlock = createLongsBlock(weights);
            percentilesBlock = new RunLengthEncodedBlock(createTuple(percentile), values.length);
        }

        return new Page(valuesBlock, weightsBlock, percentilesBlock);
    }
View Full Code Here


            valuesBlock = createDoublesBlock(values);
            weightsBlock = createLongsBlock(weights);
            percentilesBlock = new RunLengthEncodedBlock(createTuple(percentile), values.length);
        }

        return new Page(valuesBlock, weightsBlock, percentilesBlock);
    }
View Full Code Here

        AggregationFunctionDefinition definition = aggregation(function, inputs);

        Aggregator aggregator = createAggregator(definition, Step.PARTIAL);
        aggregator.addValue(input);

        return new Page(aggregator.getResult());
    }
View Full Code Here

        @Override
        public Page getOutput()
        {
            // only return a page if the page buffer isFull or we are finishing and the page buffer has data
            if (pageBuilder.isFull() || (finishing && !pageBuilder.isEmpty())) {
                Page page = pageBuilder.build();
                pageBuilder.reset();
                return page;
            }
            return null;
        }
View Full Code Here

    private static final OutputBuffers CLOSED_OUTPUT_BUFFERS = INITIAL_EMPTY_OUTPUT_BUFFERS.withNoMoreBufferIds();

    private static Page createPage(int i)
    {
        return new Page(BlockAssertions.createLongsBlock(i));
    }
View Full Code Here

    private void assertBufferResultEquals(BufferResult actual, BufferResult expected)
    {
        assertEquals(actual.getPages().size(), expected.getPages().size());
        assertEquals(actual.getToken(), expected.getToken());
        for (int i = 0; i < actual.getPages().size(); i++) {
            Page actualPage = actual.getPages().get(i);
            Page expectedPage = expected.getPages().get(i);
            assertEquals(actualPage.getChannelCount(), expectedPage.getChannelCount());
            for (int channel = 0; channel < actualPage.getChannelCount(); channel++) {
                assertBlockEquals(actualPage.getBlock(channel), expectedPage.getBlock(channel));
            }
        }
        assertEquals(actual.isBufferClosed(), expected.isBufferClosed());
    }
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.getDataSize().toBytes();
                pages.add(new RowIterable(session, types, page));

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

    }

    private void importData(AlignmentOperator source, ColumnFileHandle fileHandle)
    {
        while (!source.isFinished()) {
            Page page = source.getOutput();
            if (page != null) {
                fileHandle.append(page);
            }
            checkState(source.isBlocked().isDone(), "Alignment operator is blocked");
        }
View Full Code Here

            ColumnFileHandle columnFileHandle = ColumnFileHandle.builder(0)
                    .addColumn(columnHandle, cachedFile, encoding)
                    .build();

            while (!source.isFinished()) {
                Page page = source.getOutput();
                if (page != null) {
                    columnFileHandle.append(page);
                }
            }
            columnFileHandle.commit();
View Full Code Here

            int positions = sliceInput.readInt();
            Block[] blocks = new Block[blockEncodings.length];
            for (int i = 0; i < blocks.length; i++) {
                blocks[i] = blockEncodings[i].readBlock(sliceInput);
            }
            Page page = new Page(positions, blocks);
            return page;
        }
View Full Code Here

TOP

Related Classes of com.facebook.presto.operator.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.