Package com.facebook.presto.spi.block

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


    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


        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

        int blockIndex = decodeSliceIndex(pageAddress);
        int blockPosition = decodePosition(pageAddress);

        int result = 0;
        for (int channel : channels) {
            RandomAccessBlock block = this.channels[channel].get(blockIndex);
            result = 31 * result + block.hash(blockPosition);
        }
        return result;
    }
View Full Code Here

            }

            BlockCursor cursor = block.cursor();
            while (cursor.advanceNextPosition()) {
                // update run length stats
                RandomAccessBlock randomAccessBlock = cursor.getSingleValueBlock();
                if (lastValue == null) {
                    lastValue = randomAccessBlock;
                }
                else if (!randomAccessBlock.equalTo(0, lastValue, 0)) {
                    runsCount++;
                    lastValue = randomAccessBlock;
                }

                // update dictionary stats
View Full Code Here

    }

    @Override
    public Block readBlock(SliceInput sliceInput)
    {
        RandomAccessBlock idBlock = (RandomAccessBlock) idBlockEncoding.readBlock(sliceInput);
        return new DictionaryEncodedBlock(dictionary, idBlock);
    }
View Full Code Here

        @Override
        public DictionaryBlockEncoding readEncoding(TypeManager manager, BlockEncodingSerde serde, SliceInput input)
        {
            // read the dictionary
            BlockEncoding dictionaryEncoding = serde.readBlockEncoding(input);
            RandomAccessBlock dictionary = dictionaryEncoding.readBlock(input).toRandomAccessBlock();

            // read the id block encoding
            BlockEncoding idBlockEncoding = serde.readBlockEncoding(input);
            return new DictionaryBlockEncoding(dictionary, idBlockEncoding);
        }
View Full Code Here

    {
        // read the run length
        int positionCount = sliceInput.readInt();

        // read the value
        RandomAccessBlock value = getValueBlockEncoding().readBlock(sliceInput).toRandomAccessBlock();

        return new RunLengthEncodedBlock(value, positionCount);
    }
View Full Code Here

            // output the group id for this row
            blockBuilder.appendLong(groupId);
        }

        RandomAccessBlock block = blockBuilder.build();
        return new GroupByIdBlock(nextGroupId, block);
    }
View Full Code Here

        extends AbstractTestBlockCursor
{
    @Override
    protected RunLengthEncodedBlockCursor createTestCursor()
    {
        RandomAccessBlock value = VARCHAR.createBlockBuilder(new BlockBuilderStatus())
                .appendSlice(Slices.utf8Slice("cherry"))
                .build()
                .toRandomAccessBlock();

        return new RunLengthEncodedBlock(value, 11).cursor();
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.