io.airlift.slice.Slice.hashCode()方法的使用及代码示例

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

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

Slice.hashCode介绍

[英]Returns the hash code of this slice. The hash code is cached once calculated and any future changes to the slice will not effect the hash code.
[中]返回此切片的哈希代码。哈希代码在计算后会被缓存,将来对切片的任何更改都不会影响哈希代码。

代码示例

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

@Override
  public int hashCode()
  {
    return value.hashCode();
  }
}

代码示例来源:origin: confluentinc/ksql

@Override
 public int hashCode() {
  return value.hashCode();
 }
}

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

@ScalarOperator(HASH_CODE)
@SqlType(BIGINT)
public static long hashCode(@SqlType(JSON) Slice value)
{
  return value.hashCode();
}

代码示例来源:origin: stanford-futuredata/macrobase

@Override
  public int hashCode() {
    return value.hashCode();
  }
}

代码示例来源:origin: io.prestosql/presto-parser

@Override
  public int hashCode()
  {
    return value.hashCode();
  }
}

代码示例来源:origin: com.facebook.presto/presto-parser

@Override
  public int hashCode()
  {
    return value.hashCode();
  }
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-parser

@Override
  public int hashCode()
  {
    return value.hashCode();
  }
}

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

@Override
  public int hashCode()
  {
    return value.hashCode();
  }
}

代码示例来源:origin: airlift/slice

/**
 * Returns the hash code of this slice.  The hash code is cached once calculated
 * and any future changes to the slice will not effect the hash code.
 */
@SuppressWarnings("NonFinalFieldReferencedInHashCode")
@Override
public int hashCode()
{
  if (hash != 0) {
    return hash;
  }
  hash = hashCode(0, size);
  return hash;
}

代码示例来源:origin: io.airlift/slice

/**
 * Returns the hash code of this slice.  The hash code is cached once calculated
 * and any future changes to the slice will not effect the hash code.
 */
@SuppressWarnings("NonFinalFieldReferencedInHashCode")
@Override
public int hashCode()
{
  if (hash != 0) {
    return hash;
  }
  hash = hashCode(0, size);
  return hash;
}

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

@ScalarOperator(HASH_CODE)
@SqlType(BIGINT)
public static long hashCode(@SqlType(JSON) Slice value)
{
  return value.hashCode();
}

代码示例来源:origin: io.prestosql/presto-main

@ScalarOperator(HASH_CODE)
@SqlType(BIGINT)
public static long hashCode(@SqlType(JSON) Slice value)
{
  return value.hashCode();
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@ScalarOperator(HASH_CODE)
@SqlType(BIGINT)
public static long hashCode(@SqlType(JSON) Slice value)
{
  return value.hashCode();
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@ScalarOperator(HASH_CODE)
  @SqlType(StandardTypes.BIGINT)
  public static long hashCode(@SqlType(StandardTypes.VARBINARY) Slice value)
  {
    return value.hashCode();
  }
}

代码示例来源:origin: airlift/slice

private static void assertSlicesEquals(Slice slice, Slice other)
{
  int size = slice.length();
  assertEquals(slice, other);
  assertTrue(slice.equals(0, size, other, 0, size));
  assertEquals(slice.hashCode(), other.hashCode());
  assertEquals(slice.hashCode(), other.hashCode(0, size));
  assertEquals(slice.compareTo(other), 0);
  assertEquals(slice.compareTo(0, size, other, 0, size), 0);
  for (int i = 0; i < slice.length(); i++) {
    assertTrue(slice.equals(i, size - i, other, i, size - i));
    assertEquals(slice.hashCode(i, size - i), other.hashCode(i, size - i));
    assertEquals(slice.compareTo(i, size - i, other, i, size - i), 0);
  }
  for (int i = 0; i < slice.length(); i++) {
    assertTrue(slice.equals(0, size - i, other, 0, size - i));
    assertEquals(slice.hashCode(0, size - i), other.hashCode(0, size - i));
    assertEquals(slice.compareTo(0, size - i, other, 0, size - i), 0);
  }
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

@LiteralParameters("x")
  @ScalarOperator(HASH_CODE)
  @SqlType(StandardTypes.BIGINT)
  public static long hashCode(@SqlType("varchar(x)") Slice value)
  {
    return value.hashCode();
  }
}

代码示例来源:origin: io.airlift/slice

private static void assertSlicesEquals(Slice slice, Slice other)
{
  int size = slice.length();
  assertEquals(slice, other);
  assertTrue(slice.equals(0, size, other, 0, size));
  assertEquals(slice.hashCode(), other.hashCode());
  assertEquals(slice.hashCode(), other.hashCode(0, size));
  assertEquals(slice.compareTo(other), 0);
  assertEquals(slice.compareTo(0, size, other, 0, size), 0);
  for (int i = 0; i < slice.length(); i++) {
    assertTrue(slice.equals(i, size - i, other, i, size - i));
    assertEquals(slice.hashCode(i, size - i), other.hashCode(i, size - i));
    assertEquals(slice.compareTo(i, size - i, other, i, size - i), 0);
  }
  for (int i = 0; i < slice.length(); i++) {
    assertTrue(slice.equals(0, size - i, other, 0, size - i));
    assertEquals(slice.hashCode(0, size - i), other.hashCode(0, size - i));
    assertEquals(slice.compareTo(0, size - i, other, 0, size - i), 0);
  }
}

代码示例来源:origin: airlift/slice

@Benchmark
public long hash(BenchmarkData data, ByteCounter counter)
{
  counter.add(data.getSlice().length());
  return data.getSlice().hashCode(0, data.getSlice().length());
}

代码示例来源:origin: io.airlift/slice

@Benchmark
public long hash(BenchmarkData data, ByteCounter counter)
{
  counter.add(data.getSlice().length());
  return data.getSlice().hashCode(0, data.getSlice().length());
}

代码示例来源:origin: uk.co.nichesolutions.presto/presto-main

assertEquals(block.hash(position, offset, 3), expectedSliceValue.hashCode(offset, 3));
assertTrue(block.bytesEqual(position, offset, expectedSliceValue, offset, 3));

相关文章