本文整理了Java中com.facebook.presto.spi.block.Block.hash()
方法的一些代码示例,展示了Block.hash()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.hash()
方法的具体详情如下:
包路径:com.facebook.presto.spi.block.Block
类名称:Block
方法名:hash
[英]Calculates the hash code the byte sequences at offset in the value at position. This method must be implemented if @{code getSlice} is implemented.
[中]计算位置处的值中偏移量处的字节序列的哈希代码。如果实现了@{code getSlice},则必须实现此方法。
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
return block.hash(position, offset, length);
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
assureLoaded();
return block.hash(position, offset, length);
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
return dictionary.hash(getId(position), offset, length);
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
checkReadablePosition(position);
return value.hash(0, offset, length);
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, getFixedSize());
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
position = getAbsolutePosition(position);
if (position % 2 == 0) {
return getRawKeyBlock().hash(position / 2, offset, length);
}
else {
return getRawValueBlock().hash(position / 2, offset, length);
}
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
checkFieldIndex(position);
return getRawFieldBlock(position).hash(rowIndex, offset, length);
}
代码示例来源:origin: prestodb/presto
@Override
public long hash(int position, int offset, int length)
{
checkReadablePosition(position);
return getBlock().hash(position + start, offset, length);
}
代码示例来源:origin: prestodb/presto
@SuppressWarnings("unused")
public static long blockVarcharHashCode(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
}
代码示例来源:origin: prestodb/presto
/**
* Get slot position of element at {@code position} of {@code block}
*/
private long getHashPositionOfElement(Block block, int position)
{
checkArgument(!block.isNull(position), "position is null");
int length = block.getSliceLength(position);
long hashPosition = getMaskedHash(block.hash(position, 0, length));
while (true) {
int blockPosition = blockPositionByHash.get(hashPosition);
if (blockPosition == EMPTY_SLOT) {
// Doesn't have this element
return hashPosition;
}
else if (elementBlock.getSliceLength(blockPosition) == length && block.equals(position, 0, elementBlock, blockPosition, 0, length)) {
// Already has this element
return hashPosition;
}
hashPosition = getMaskedHash(hashPosition + 1);
}
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-main
@Override
public int hash(int position, int offset, int length)
{
return block.hash(position, offset, length);
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public long hash(Block block, int position)
{
return block.hash(position, 0, block.getSliceLength(position));
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public long hash(int position, int offset, int length)
{
assureLoaded();
return block.hash(position, offset, length);
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public long hash(int position, int offset, int length)
{
checkFieldIndex(position);
return getRawFieldBlock(position).hash(rowIndex, offset, length);
}
代码示例来源:origin: com.facebook.presto/presto-spi
@Override
public long hash(int position, int offset, int length)
{
checkReadablePosition(position);
return getBlock().hash(position + start, offset, length);
}
内容来源于网络,如有侵权,请联系作者删除!