Package com.facebook.presto.block.snappy

Examples of com.facebook.presto.block.snappy.SnappyBlock


        return encoding;
    }

    private void flushBlock()
    {
        SnappyBlock snappyBlock = new SnappyBlock(blockBuilder.build());
        encoding.writeBlock(sliceOutput, snappyBlock);
        blockBuilder = snappyBlock.getType().createBlockBuilder(new BlockBuilderStatus());
    }
View Full Code Here


        return encoding;
    }

    private void flushBlock()
    {
        SnappyBlock snappyBlock = new SnappyBlock(blockBuilder);
        encoding.writeBlock(sliceOutput, snappyBlock);
        blockBuilder = snappyBlock.getType().createBlockBuilder(new BlockBuilderStatus());
    }
View Full Code Here

        return encoding;
    }

    private void flushBlock()
    {
        SnappyBlock snappyBlock = new SnappyBlock(blockBuilder.build());
        encoding.writeBlock(sliceOutput, snappyBlock);
        blockBuilder = type.createBlockBuilder(new BlockBuilderStatus());
    }
View Full Code Here

    }

    @Override
    public void writeBlock(SliceOutput sliceOutput, Block block)
    {
        SnappyBlock snappyBlock = (SnappyBlock) block;
        Preconditions.checkArgument(block.getTupleInfo().equals(tupleInfo), "Invalid tuple info");

        Slice slice = snappyBlock.getCompressedSlice();
        sliceOutput
                .appendInt(slice.length())
                .appendInt(snappyBlock.getPositionCount())
                .writeBytes(slice);
    }
View Full Code Here

    {
        int blockSize = sliceInput.readInt();
        int tupleCount = sliceInput.readInt();

        Slice block = sliceInput.readSlice(blockSize);
        return new SnappyBlock(tupleCount, tupleInfo, block);
    }
View Full Code Here

    {
        if (buffer.size() > 0) {
            Slice slice = buffer.slice();
            byte[] compressedBytes = new byte[Snappy.maxCompressedLength(slice.length())];
            int actualLength = Snappy.compress(slice.getBytes(), 0, slice.length(), compressedBytes, 0);
            SnappyBlock block = new SnappyBlock(tupleCount, encoding.getTupleInfo(), Slices.wrappedBuffer(Arrays.copyOf(compressedBytes, actualLength)));
            encoding.writeBlock(sliceOutput, block);
            buffer.reset();
            tupleCount = 0;
        }
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.block.snappy.SnappyBlock

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.