本文整理了Java中io.prestosql.spi.block.Block.getEncodingName()
方法的一些代码示例,展示了Block.getEncodingName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getEncodingName()
方法的具体详情如下:
包路径:io.prestosql.spi.block.Block
类名称:Block
方法名:getEncodingName
[英]Get the encoding for this block.
[中]获取此块的编码。
代码示例来源:origin: io.prestosql/presto-main
@Override
public void writeBlock(SliceOutput output, Block block)
{
while (true) {
// get the encoding name
String encodingName = block.getEncodingName();
// look up the BlockEncoding
BlockEncoding blockEncoding = blockEncodings.get(encodingName);
// see if a replacement block should be written instead
Optional<Block> replacementBlock = blockEncoding.replacementBlockForWrite(block);
if (replacementBlock.isPresent()) {
block = replacementBlock.get();
continue;
}
// write the name to the output
writeLengthPrefixedString(output, encodingName);
// write the block to the output
blockEncoding.writeBlock(this, output, block);
break;
}
}
代码示例来源:origin: prestosql/presto
@Override
public void writeBlock(SliceOutput output, Block block)
{
while (true) {
// get the encoding name
String encodingName = block.getEncodingName();
// look up the BlockEncoding
BlockEncoding blockEncoding = blockEncodings.get(encodingName);
// see if a replacement block should be written instead
Optional<Block> replacementBlock = blockEncoding.replacementBlockForWrite(block);
if (replacementBlock.isPresent()) {
block = replacementBlock.get();
continue;
}
// write the name to the output
writeLengthPrefixedString(output, encodingName);
// write the block to the output
blockEncoding.writeBlock(this, output, block);
break;
}
}
代码示例来源:origin: prestosql/presto
@Test
public void testBuildingFromShortArrayBlockBuilder()
{
ShortArrayBlockBuilder blockBuilder = new ShortArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testBuildingFromLongArrayBlockBuilder()
{
LongArrayBlockBuilder blockBuilder = new LongArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: prestosql/presto
@Test
public void testBuildingFromIntArrayBlockBuilder()
{
IntArrayBlockBuilder blockBuilder = new IntArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testBuildingFromIntArrayBlockBuilder()
{
IntArrayBlockBuilder blockBuilder = new IntArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testBuildingFromShortArrayBlockBuilder()
{
ShortArrayBlockBuilder blockBuilder = new ShortArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: io.prestosql/presto-main
@Test
public void testBuildingFromByteArrayBlockBuilder()
{
ByteArrayBlockBuilder blockBuilder = new ByteArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: prestosql/presto
@Test
public void testBuildingFromLongArrayBlockBuilder()
{
LongArrayBlockBuilder blockBuilder = new LongArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: prestosql/presto
@Test
public void testBuildingFromByteArrayBlockBuilder()
{
ByteArrayBlockBuilder blockBuilder = new ByteArrayBlockBuilder(null, 100);
populateNullValues(blockBuilder, 100);
assertEquals(blockBuilder.build().getEncodingName(), RunLengthBlockEncoding.NAME);
}
代码示例来源:origin: prestosql/presto
@Override
public void writeBlock(SliceOutput output, Block block)
{
while (true) {
// get the encoding name
String encodingName = block.getEncodingName();
// look up the encoding factory
BlockEncoding blockEncoding = blockEncodings.get(encodingName);
// see if a replacement block should be written instead
Optional<Block> replacementBlock = blockEncoding.replacementBlockForWrite(block);
if (replacementBlock.isPresent()) {
block = replacementBlock.get();
continue;
}
// write the name to the output
writeLengthPrefixedString(output, encodingName);
// write the block to the output
blockEncoding.writeBlock(this, output, block);
break;
}
}
代码示例来源:origin: io.prestosql/presto-spi
@Override
public void writeBlock(SliceOutput output, Block block)
{
while (true) {
// get the encoding name
String encodingName = block.getEncodingName();
// look up the encoding factory
BlockEncoding blockEncoding = blockEncodings.get(encodingName);
// see if a replacement block should be written instead
Optional<Block> replacementBlock = blockEncoding.replacementBlockForWrite(block);
if (replacementBlock.isPresent()) {
block = replacementBlock.get();
continue;
}
// write the name to the output
writeLengthPrefixedString(output, encodingName);
// write the block to the output
blockEncoding.writeBlock(this, output, block);
break;
}
}
内容来源于网络,如有侵权,请联系作者删除!