Package com.facebook.presto.spi.block

Examples of com.facebook.presto.spi.block.RandomAccessBlock


        positionCount += page.getPositionCount();

        int pageIndex = channels[0].size();
        RandomAccessPage randomAccessPage = page.toRandomAccessPage();
        for (int i = 0; i < channels.length; i++) {
            RandomAccessBlock block = randomAccessPage.getBlock(i);
            channels[i].add(block);
            pagesMemorySize += block.getSizeInBytes();
        }

        for (int position = 0; position < page.getPositionCount(); position++) {
            long sliceAddress = encodeSyntheticAddress(pageIndex, position);
            valueAddresses.add(sliceAddress);
View Full Code Here


            int blockPosition = decodePosition(pageAddress);

            // append the row
            for (int i = 0; i < outputChannels.length; i++) {
                int outputChannel = outputChannels[i];
                RandomAccessBlock block = this.channels[outputChannel].get(blockIndex);
                block.appendTo(blockPosition, pageBuilder.getBlockBuilder(i));
            }

            position++;
        }
View Full Code Here

    public void appendTo(int channel, int position, BlockBuilder output)
    {
        long pageAddress = valueAddresses.getLong(position);

        RandomAccessBlock block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        block.appendTo(blockPosition, output);
    }
View Full Code Here

    public boolean isNull(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        RandomAccessBlock block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.isNull(blockPosition);
    }
View Full Code Here

    public boolean getBoolean(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        RandomAccessBlock block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getBoolean(blockPosition);
    }
View Full Code Here

    public long getLong(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        RandomAccessBlock block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getLong(blockPosition);
    }
View Full Code Here

    public double getDouble(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        RandomAccessBlock block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getDouble(blockPosition);
    }
View Full Code Here

    public Slice getSlice(int channel, int position)
    {
        long pageAddress = valueAddresses.getLong(position);

        RandomAccessBlock block = channels[channel].get(decodeSliceIndex(pageAddress));
        int blockPosition = decodePosition(pageAddress);
        return block.getSlice(blockPosition);
    }
View Full Code Here

        long rightPageAddress = valueAddresses.getLong(rightPosition);
        int rightBlockIndex = decodeSliceIndex(rightPageAddress);
        int rightBlockPosition = decodePosition(rightPageAddress);

        for (int channel : channels) {
            RandomAccessBlock leftBlock = this.channels[channel].get(leftBlockIndex);
            RandomAccessBlock rightBlock = this.channels[channel].get(rightBlockIndex);

            if (!leftBlock.equalTo(leftBlockPosition, rightBlock, rightBlockPosition)) {
                return false;
            }
        }
View Full Code Here

        for (int i = 0; i < channels.length; i++) {
            int channel = channels[i];
            BlockCursor cursor = cursors[i];

            RandomAccessBlock block = this.channels[channel].get(blockIndex);

            if (!block.equalTo(blockPosition, cursor)) {
                return false;
            }
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.spi.block.RandomAccessBlock

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.