org.apache.hadoop.util.hash.Hash.parseHashType()方法的使用及代码示例

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

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

Hash.parseHashType介绍

[英]This utility method converts String representation of hash function name to a symbolic constant. Currently two function types are supported, "jenkins" and "murmur".
[中]此实用程序方法将哈希函数名的字符串表示形式转换为符号常量。目前支持两种功能类型:“詹金斯”和“杂音”。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * This utility method converts the name of the configured
 * hash type to a symbolic constant.
 * @param conf configuration
 * @return one of the predefined constants
 */
public static int getHashType(Configuration conf) {
 String name = conf.get(HADOOP_UTIL_HASH_TYPE_KEY,
   HADOOP_UTIL_HASH_TYPE_DEFAULT);
 return parseHashType(name);
}

代码示例来源:origin: apache/accumulo

.ceil(-HASH_COUNT * numKeys / Math.log(1.0 - Math.pow(errorRate, 1.0 / HASH_COUNT)));
bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
  Hash.parseHashType(acuconf.get(Property.TABLE_BLOOM_HASHTYPE)), numKeys);

代码示例来源:origin: io.hops/hadoop-common

/**
 * This utility method converts the name of the configured
 * hash type to a symbolic constant.
 * @param conf configuration
 * @return one of the predefined constants
 */
public static int getHashType(Configuration conf) {
 String name = conf.get(HADOOP_UTIL_HASH_TYPE_KEY,
   HADOOP_UTIL_HASH_TYPE_DEFAULT);
 return parseHashType(name);
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * This utility method converts the name of the configured
 * hash type to a symbolic constant.
 * @param conf configuration
 * @return one of the predefined constants
 */
public static int getHashType(Configuration conf) {
 String name = conf.get("hadoop.util.hash.type", "murmur");
 return parseHashType(name);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-common

/**
 * This utility method converts the name of the configured
 * hash type to a symbolic constant.
 * @param conf configuration
 * @return one of the predefined constants
 */
public static int getHashType(Configuration conf) {
 String name = conf.get("hadoop.util.hash.type", "murmur");
 return parseHashType(name);
}

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

/**
 * This utility method converts the name of the configured
 * hash type to a symbolic constant.
 * @param conf configuration
 * @return one of the predefined constants
 */
public static int getHashType(Configuration conf) {
 String name = conf.get("hadoop.util.hash.type", "murmur");
 return parseHashType(name);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * This utility method converts the name of the configured
 * hash type to a symbolic constant.
 * @param conf configuration
 * @return one of the predefined constants
 */
public static int getHashType(Configuration conf) {
 String name = conf.get("hadoop.util.hash.type", "murmur");
 return parseHashType(name);
}

代码示例来源:origin: paulhoule/infovore

@Override
protected void setup(Context context) throws IOException, InterruptedException {
  super.setup(context);
  Configuration c=context.getConfiguration();
  int vectorSize=c.getInt(VECTOR_SIZE,0);
  int nbHash=c.getInt(NB_HASH,0);
  String hashType=c.get(HASH_TYPE, "murmur");
  f=new BloomFilter(vectorSize,nbHash, Hash.parseHashType(hashType));
}

代码示例来源:origin: org.apache.accumulo/accumulo-core

.ceil(-HASH_COUNT * numKeys / Math.log(1.0 - Math.pow(errorRate, 1.0 / HASH_COUNT)));
bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
  Hash.parseHashType(acuconf.get(Property.TABLE_BLOOM_HASHTYPE)), numKeys);

代码示例来源:origin: org.apache.pig/pig

int vectorSizeBytes =  conf.getInt(PigConfiguration.PIG_BLOOMJOIN_VECTORSIZE_BYTES, POBuildBloomRearrangeTez.DEFAULT_BLOOM_VECTOR_SIZE_BYTES);
int numBloomFilters = POBuildBloomRearrangeTez.getNumBloomFilters(conf);
int hashType = Hash.parseHashType(conf.get(PigConfiguration.PIG_BLOOMJOIN_HASH_TYPE, POBuildBloomRearrangeTez.DEFAULT_BLOOM_HASH_TYPE));

代码示例来源:origin: ch.cern.hadoop/hadoop-common

int iterations = 30;
assertTrue("testHash jenkins error !!!",
  Hash.JENKINS_HASH == Hash.parseHashType("jenkins"));
assertTrue("testHash murmur error !!!",
  Hash.MURMUR_HASH == Hash.parseHashType("murmur"));
assertTrue("testHash undefined",
  Hash.INVALID_HASH == Hash.parseHashType("undefined"));

代码示例来源:origin: com.github.jiayuhan-it/hadoop-common

int iterations = 30;
assertTrue("testHash jenkins error !!!",
  Hash.JENKINS_HASH == Hash.parseHashType("jenkins"));
assertTrue("testHash murmur error !!!",
  Hash.MURMUR_HASH == Hash.parseHashType("murmur"));
assertTrue("testHash undefined",
  Hash.INVALID_HASH == Hash.parseHashType("undefined"));

相关文章

微信公众号

最新文章

更多