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

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

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

Hash.getInstance介绍

[英]Get a singleton instance of hash function of a given type.
[中]获取给定类型的哈希函数的单例实例。

代码示例

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

public BloomFilterChunk(int hashType, BloomType bloomType) {
 this.hashType = hashType;
 this.hash = Hash.getInstance(hashType);
 this.bloomType = bloomType;
}

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

/**
 * 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: apache/hbase

/**
 * Loads bloom filter meta data from file input.
 * @param meta stored bloom meta data
 * @throws IllegalArgumentException meta data is invalid
 */
public BloomFilterChunk(DataInput meta)
  throws IOException, IllegalArgumentException {
 this.byteSize = meta.readInt();
 this.hashCount = meta.readInt();
 this.hashType = meta.readInt();
 this.keyCount = meta.readInt();
 this.maxKeys = this.keyCount;
 this.hash = Hash.getInstance(this.hashType);
 if (hash == null) {
  throw new IllegalArgumentException("Invalid hash type: " + hashType);
 }
 sanityCheck();
}

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

hash = Hash.getInstance(hashType);
if (hash == null) {
 throw new IllegalArgumentException("Invalid hash type: " + hashType);

代码示例来源:origin: co.cask.hbase/hbase

/** Private constructor used by other constructors. */
private ByteBloomFilter(int hashType) {
 this.hashType = hashType;
 this.hash = Hash.getInstance(hashType);
}

代码示例来源:origin: harbby/presto-connectors

/** Private constructor used by other constructors. */
private ByteBloomFilter(int hashType) {
 this.hashType = hashType;
 this.hash = Hash.getInstance(hashType);
}

代码示例来源:origin: org.apache.hbase/hbase-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.aliyun.hbase/alihbase-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: co.cask.hbase/hbase

/**
 * 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: harbby/presto-connectors

/**
 * 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: co.cask.hbase/hbase

/**
 * Loads bloom filter meta data from file input.
 * @param meta stored bloom meta data
 * @throws IllegalArgumentException meta data is invalid
 */
public ByteBloomFilter(DataInput meta)
  throws IOException, IllegalArgumentException {
 this.byteSize = meta.readInt();
 this.hashCount = meta.readInt();
 this.hashType = meta.readInt();
 this.keyCount = meta.readInt();
 this.maxKeys = this.keyCount;
 this.hash = Hash.getInstance(this.hashType);
 if (hash == null) {
  throw new IllegalArgumentException("Invalid hash type: " + hashType);
 }
 sanityCheck();
}

代码示例来源:origin: harbby/presto-connectors

/**
 * Loads bloom filter meta data from file input.
 * @param meta stored bloom meta data
 * @throws IllegalArgumentException meta data is invalid
 */
public ByteBloomFilter(DataInput meta)
  throws IOException, IllegalArgumentException {
 this.byteSize = meta.readInt();
 this.hashCount = meta.readInt();
 this.hashType = meta.readInt();
 this.keyCount = meta.readInt();
 this.maxKeys = this.keyCount;
 this.hash = Hash.getInstance(this.hashType);
 if (hash == null) {
  throw new IllegalArgumentException("Invalid hash type: " + hashType);
 }
 sanityCheck();
}

代码示例来源:origin: co.cask.hbase/hbase

/**
 * De-serialization for compound Bloom filter metadata. Must be consistent
 * with what {@link CompoundBloomFilterWriter} does.
 *
 * @param meta serialized Bloom filter metadata without any magic blocks
 * @throws IOException
 */
public CompoundBloomFilter(DataInput meta, HFile.Reader reader)
  throws IOException {
 this.reader = reader;
 totalByteSize = meta.readLong();
 hashCount = meta.readInt();
 hashType = meta.readInt();
 totalKeyCount = meta.readLong();
 totalMaxKeys = meta.readLong();
 numChunks = meta.readInt();
 comparator = FixedFileTrailer.createComparator(
   Bytes.toString(Bytes.readByteArray(meta)));
 hash = Hash.getInstance(hashType);
 if (hash == null) {
  throw new IllegalArgumentException("Invalid hash type: " + hashType);
 }
 index = new HFileBlockIndex.BlockIndexReader(comparator, 1);
 index.readRootIndex(meta, numChunks);
}

代码示例来源:origin: harbby/presto-connectors

/**
 * De-serialization for compound Bloom filter metadata. Must be consistent
 * with what {@link CompoundBloomFilterWriter} does.
 *
 * @param meta serialized Bloom filter metadata without any magic blocks
 * @throws IOException
 */
public CompoundBloomFilter(DataInput meta, HFile.Reader reader)
  throws IOException {
 this.reader = reader;
 totalByteSize = meta.readLong();
 hashCount = meta.readInt();
 hashType = meta.readInt();
 totalKeyCount = meta.readLong();
 totalMaxKeys = meta.readLong();
 numChunks = meta.readInt();
 comparator = FixedFileTrailer.createComparator(
   Bytes.toString(Bytes.readByteArray(meta)));
 hash = Hash.getInstance(hashType);
 if (hash == null) {
  throw new IllegalArgumentException("Invalid hash type: " + hashType);
 }
 index = new HFileBlockIndex.BlockIndexReader(comparator, 1);
 index.readRootIndex(meta, numChunks);
}

相关文章