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

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

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

Hash.getHashType介绍

[英]This utility method converts the name of the configured hash type to a symbolic constant.
[中]此实用程序方法将配置的哈希类型的名称转换为符号常量。

代码示例

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

/**
 * Get a singleton instance of hash function of a type
 * defined in the configuration.
 * @param conf current configuration
 * @return defined hash type, or null if type is invalid
 */
public static Hash getInstance(Configuration conf) {
 int type = getHashType(conf);
 return getInstance(type);
}

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

private synchronized void initBloomFilter(Configuration conf) {
 numKeys = conf.getInt(
   IO_MAPFILE_BLOOM_SIZE_KEY, IO_MAPFILE_BLOOM_SIZE_DEFAULT);
 // vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for
 // single key, where <code> is the number of hash functions,
 // <code>n</code> is the number of keys and <code>c</code> is the desired
 // max. error rate.
 // Our desired error rate is by default 0.005, i.e. 0.5%
 float errorRate = conf.getFloat(
   IO_MAPFILE_BLOOM_ERROR_RATE_KEY, IO_MAPFILE_BLOOM_ERROR_RATE_DEFAULT);
 vectorSize = (int)Math.ceil((double)(-HASH_COUNT * numKeys) /
   Math.log(1.0 - Math.pow(errorRate, 1.0/HASH_COUNT)));
 bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
   Hash.getHashType(conf), numKeys);
}

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

/**
 * Get a singleton instance of hash function of a type
 * defined in the configuration.
 * @param conf current configuration
 * @return defined hash type, or null if type is invalid
 */
public static Hash getInstance(Configuration conf) {
 int type = getHashType(conf);
 return getInstance(type);
}

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

/**
 * Get a singleton instance of hash function of a type
 * defined in the configuration.
 * @param conf current configuration
 * @return defined hash type, or null if type is invalid
 */
public static Hash getInstance(Configuration conf) {
 int type = getHashType(conf);
 return getInstance(type);
}

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

/**
 * Get a singleton instance of hash function of a type
 * defined in the configuration.
 * @param conf current configuration
 * @return defined hash type, or null if type is invalid
 */
public static Hash getInstance(Configuration conf) {
 int type = getHashType(conf);
 return getInstance(type);
}

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

/**
 * Get a singleton instance of hash function of a type
 * defined in the configuration.
 * @param conf current configuration
 * @return defined hash type, or null if type is invalid
 */
public static Hash getInstance(Configuration conf) {
 int type = getHashType(conf);
 return getInstance(type);
}

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

/**
 * Get a singleton instance of hash function of a type
 * defined in the configuration.
 * @param conf current configuration
 * @return defined hash type, or null if type is invalid
 */
public static Hash getInstance(Configuration conf) {
 int type = getHashType(conf);
 return getInstance(type);
}

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

private synchronized void initBloomFilter(Configuration conf) {
 numKeys = conf.getInt("io.mapfile.bloom.size", 1024 * 1024);
 // vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for
 // single key, where <code> is the number of hash functions,
 // <code>n</code> is the number of keys and <code>c</code> is the desired
 // max. error rate.
 // Our desired error rate is by default 0.005, i.e. 0.5%
 float errorRate = conf.getFloat("io.mapfile.bloom.error.rate", 0.005f);
 vectorSize = (int)Math.ceil((double)(-HASH_COUNT * numKeys) /
   Math.log(1.0 - Math.pow(errorRate, 1.0/HASH_COUNT)));
 bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
   Hash.getHashType(conf), numKeys);
}

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

private synchronized void initBloomFilter(Configuration conf) {
 numKeys = conf.getInt("io.mapfile.bloom.size", 1024 * 1024);
 // vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for
 // single key, where <code> is the number of hash functions,
 // <code>n</code> is the number of keys and <code>c</code> is the desired
 // max. error rate.
 // Our desired error rate is by default 0.005, i.e. 0.5%
 float errorRate = conf.getFloat("io.mapfile.bloom.error.rate", 0.005f);
 vectorSize = (int)Math.ceil((double)(-HASH_COUNT * numKeys) /
   Math.log(1.0 - Math.pow(errorRate, 1.0/HASH_COUNT)));
 bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
   Hash.getHashType(conf), numKeys);
}

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

private synchronized void initBloomFilter(Configuration conf) {
 numKeys = conf.getInt("io.mapfile.bloom.size", 1024 * 1024);
 // vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for
 // single key, where <code> is the number of hash functions,
 // <code>n</code> is the number of keys and <code>c</code> is the desired
 // max. error rate.
 // Our desired error rate is by default 0.005, i.e. 0.5%
 float errorRate = conf.getFloat("io.mapfile.bloom.error.rate", 0.005f);
 vectorSize = (int)Math.ceil((double)(-HASH_COUNT * numKeys) /
   Math.log(1.0 - Math.pow(errorRate, 1.0/HASH_COUNT)));
 bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
   Hash.getHashType(conf), numKeys);
}

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

private synchronized void initBloomFilter(Configuration conf) {
 numKeys = conf.getInt("io.mapfile.bloom.size", 1024 * 1024);
 // vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for
 // single key, where <code> is the number of hash functions,
 // <code>n</code> is the number of keys and <code>c</code> is the desired
 // max. error rate.
 // Our desired error rate is by default 0.005, i.e. 0.5%
 float errorRate = conf.getFloat("io.mapfile.bloom.error.rate", 0.005f);
 vectorSize = (int)Math.ceil((double)(-HASH_COUNT * numKeys) /
   Math.log(1.0 - Math.pow(errorRate, 1.0/HASH_COUNT)));
 bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
   Hash.getHashType(conf), numKeys);
}

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

private synchronized void initBloomFilter(Configuration conf) {
 numKeys = conf.getInt(
   IO_MAPFILE_BLOOM_SIZE_KEY, IO_MAPFILE_BLOOM_SIZE_DEFAULT);
 // vector size should be <code>-kn / (ln(1 - c^(1/k)))</code> bits for
 // single key, where <code> is the number of hash functions,
 // <code>n</code> is the number of keys and <code>c</code> is the desired
 // max. error rate.
 // Our desired error rate is by default 0.005, i.e. 0.5%
 float errorRate = conf.getFloat(
   IO_MAPFILE_BLOOM_ERROR_RATE_KEY, IO_MAPFILE_BLOOM_ERROR_RATE_DEFAULT);
 vectorSize = (int)Math.ceil((double)(-HASH_COUNT * numKeys) /
   Math.log(1.0 - Math.pow(errorRate, 1.0/HASH_COUNT)));
 bloomFilter = new DynamicBloomFilter(vectorSize, HASH_COUNT,
   Hash.getHashType(conf), numKeys);
}

相关文章