io.airlift.stats.cardinality.HyperLogLog.addHash()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(102)

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

HyperLogLog.addHash介绍

[英]Adds a value that has already been hashed to the set of values tracked by this HyperLogLog instance.
[中]将已散列的值添加到此HyperLogLog实例跟踪的值集。

代码示例

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") double value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") Slice value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") long value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

public void add(Slice value)
{
  addHash(Murmur3Hash128.hash64(value));
}

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

public void add(long value)
{
  addHash(Murmur3Hash128.hash64(value));
}

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

public void add(long value)
{
  addHash(Murmur3Hash128.hash64(value));
}

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

public void add(Slice value)
{
  addHash(Murmur3Hash128.hash64(value));
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") Slice value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") double value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") Slice value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") double value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") long value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

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

@InputFunction
@TypeParameter("T")
public static void input(
    @OperatorDependency(operator = XX_HASH_64, returnType = StandardTypes.BIGINT, argumentTypes = {"T"}) MethodHandle methodHandle,
    @AggregationState HyperLogLogState state,
    @SqlType("T") long value,
    @SqlType(StandardTypes.DOUBLE) double maxStandardError)
{
  HyperLogLog hll = getOrCreateHyperLogLog(state, maxStandardError);
  state.addMemoryUsage(-hll.estimatedInMemorySize());
  long hash;
  try {
    hash = (long) methodHandle.invokeExact(value);
  }
  catch (Throwable t) {
    throw internalError(t);
  }
  hll.addHash(hash);
  state.addMemoryUsage(hll.estimatedInMemorySize());
}

相关文章