com.facebook.presto.spi.block.Block.getSliceLength()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中com.facebook.presto.spi.block.Block.getSliceLength()方法的一些代码示例,展示了Block.getSliceLength()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getSliceLength()方法的具体详情如下:
包路径:com.facebook.presto.spi.block.Block
类名称:Block
方法名:getSliceLength

Block.getSliceLength介绍

[英]Gets the length of the value at the position. This method must be implemented if @{code getSlice} is implemented.
[中]获取该位置处的值的长度。如果实现了@{code getSlice},则必须实现此方法。

代码示例

代码示例来源:origin: prestodb/presto

@Override
public int getSliceLength(int position)
{
  return block.getSliceLength(position);
}

代码示例来源:origin: prestodb/presto

@Override
public boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
{
  int leftLength = leftBlock.getSliceLength(leftPosition);
  int rightLength = rightBlock.getSliceLength(rightPosition);
  if (leftLength != rightLength) {
    return false;
  }
  return leftBlock.equals(leftPosition, 0, rightBlock, rightPosition, 0, leftLength);
}

代码示例来源:origin: prestodb/presto

@Override
public boolean equalTo(Block leftBlock, int leftPosition, Block rightBlock, int rightPosition)
{
  int leftLength = leftBlock.getSliceLength(leftPosition);
  int rightLength = rightBlock.getSliceLength(rightPosition);
  if (leftLength != rightLength) {
    return false;
  }
  return leftBlock.equals(leftPosition, 0, rightBlock, rightPosition, 0, leftLength);
}

代码示例来源:origin: prestodb/presto

@Override
public Slice getSlice(Block block, int position)
{
  return block.getSlice(position, 0, block.getSliceLength(position));
}

代码示例来源:origin: prestodb/presto

@Override
public Slice getSlice(Block block, int position)
{
  return block.getSlice(position, 0, block.getSliceLength(position));
}

代码示例来源:origin: prestodb/presto

@Override
public Slice getSlice(Block block, int position)
{
  return block.getSlice(position, 0, block.getSliceLength(position));
}

代码示例来源:origin: prestodb/presto

@Override
public Slice getSlice(Block block, int position)
{
  return block.getSlice(position, 0, block.getSliceLength(position));
}

代码示例来源:origin: prestodb/presto

private static int totalSliceBytes(Block block)
{
  int totalBytes = 0;
  int positions = block.getPositionCount();
  for (int position = 0; position < positions; position++) {
    totalBytes += block.getSliceLength(position);
  }
  return totalBytes;
}

代码示例来源:origin: prestodb/presto

@Override
public Slice getSlice(Block block, int position)
{
  return block.getSlice(position, 0, block.getSliceLength(position));
}

代码示例来源:origin: prestodb/presto

@Override
  public void deserialize(Block block, int index, SetDigestState state)
  {
    state.setDigest(SetDigest.newInstance(block.getSlice(index, 0, block.getSliceLength(index))));
  }
}

代码示例来源:origin: prestodb/presto

@Override
public Object getObjectValue(ConnectorSession session, Block block, int position)
{
  if (block.isNull(position)) {
    return null;
  }
  return block.getSlice(position, 0, block.getSliceLength(position)).toStringUtf8();
}

代码示例来源:origin: prestodb/presto

@Override
public Object getObjectValue(ConnectorSession session, Block block, int position)
{
  if (block.isNull(position)) {
    return null;
  }
  return block.getSlice(position, 0, block.getSliceLength(position)).toStringUtf8();
}

代码示例来源:origin: prestodb/presto

@SuppressWarnings("unused")
  public static long blockVarcharHashCode(Block block, int position)
  {
    return block.hash(position, 0, block.getSliceLength(position));
  }
}

代码示例来源:origin: prestodb/presto

@Override
  public Object getObjectValue(ConnectorSession session, Block block, int position)
  {
    if (block.isNull(position)) {
      return null;
    }

    return new SqlVarbinary(block.getSlice(position, 0, block.getSliceLength(position)).getBytes());
  }
}

代码示例来源:origin: prestodb/presto

@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
  if (block.isNull(position)) {
    blockBuilder.appendNull();
  }
  else {
    block.writeBytesTo(position, 0, block.getSliceLength(position), blockBuilder);
    blockBuilder.closeEntry();
  }
}

代码示例来源:origin: prestodb/presto

@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
  if (block.isNull(position)) {
    blockBuilder.appendNull();
  }
  else {
    block.writeBytesTo(position, 0, block.getSliceLength(position), blockBuilder);
    blockBuilder.closeEntry();
  }
}

代码示例来源:origin: prestodb/presto

@Override
public Object getObjectValue(ConnectorSession session, Block block, int position)
{
  if (block.isNull(position)) {
    return null;
  }
  return new SqlVarbinary(block.getSlice(position, 0, block.getSliceLength(position)).getBytes());
}

代码示例来源:origin: prestodb/presto

@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
  if (block.isNull(position)) {
    blockBuilder.appendNull();
  }
  else {
    block.writeBytesTo(position, 0, block.getSliceLength(position), blockBuilder);
    blockBuilder.closeEntry();
  }
}

代码示例来源:origin: prestodb/presto

@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
  if (block.isNull(position)) {
    blockBuilder.appendNull();
  }
  else {
    block.writeBytesTo(position, 0, block.getSliceLength(position), blockBuilder);
    blockBuilder.closeEntry();
  }
}

代码示例来源:origin: prestodb/presto

@Override
public void appendTo(Block block, int position, BlockBuilder blockBuilder)
{
  if (block.isNull(position)) {
    blockBuilder.appendNull();
  }
  else {
    block.writeBytesTo(position, 0, block.getSliceLength(position), blockBuilder);
    blockBuilder.closeEntry();
  }
}

相关文章