Search in sources :

Example 1 with BlockEncoding

use of com.facebook.presto.spi.block.BlockEncoding in project presto by prestodb.

the class AbstractTestBlock method copyBlock.

private static Block copyBlock(Block block) {
    DynamicSliceOutput sliceOutput = new DynamicSliceOutput(1024);
    BlockEncoding blockEncoding = block.getEncoding();
    blockEncoding.writeBlock(sliceOutput, block);
    return blockEncoding.readBlock(sliceOutput.slice().getInput());
}
Also used : DynamicSliceOutput(io.airlift.slice.DynamicSliceOutput) BlockEncoding(com.facebook.presto.spi.block.BlockEncoding)

Example 2 with BlockEncoding

use of com.facebook.presto.spi.block.BlockEncoding in project presto by prestodb.

the class BlockSerdeUtil method writeBlock.

public static void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput output, Block block) {
    BlockEncoding encoding = block.getEncoding();
    blockEncodingSerde.writeBlockEncoding(output, encoding);
    encoding.writeBlock(output, block);
}
Also used : BlockEncoding(com.facebook.presto.spi.block.BlockEncoding)

Example 3 with BlockEncoding

use of com.facebook.presto.spi.block.BlockEncoding in project presto by prestodb.

the class BlockSerdeUtil method writeBlock.

// This class is only used in LiteralInterpreter for magic literal. Most likely, you shouldn't use it from anywhere else.
public static void writeBlock(SliceOutput output, Block block) {
    BlockEncoding encoding = block.getEncoding();
    BlockEncodingManager.writeBlockEncodingInternal(output, encoding);
    encoding.writeBlock(output, block);
}
Also used : BlockEncoding(com.facebook.presto.spi.block.BlockEncoding)

Aggregations

BlockEncoding (com.facebook.presto.spi.block.BlockEncoding)3 DynamicSliceOutput (io.airlift.slice.DynamicSliceOutput)1