当前位置: 首页>>代码示例>>Java>>正文


Java BloomFilterFactory.isBloomEnabled方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.util.BloomFilterFactory.isBloomEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java BloomFilterFactory.isBloomEnabled方法的具体用法?Java BloomFilterFactory.isBloomEnabled怎么用?Java BloomFilterFactory.isBloomEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.util.BloomFilterFactory的用法示例。


在下文中一共展示了BloomFilterFactory.isBloomEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createWriter

import org.apache.hadoop.hbase.util.BloomFilterFactory; //导入方法依赖的package包/类
/**
 * Create a store file writer. Client is responsible for closing file when done.
 * If metadata, add BEFORE closing using appendMetadata()
 * @param fs
 * @param dir Path to family directory.  Makes the directory if doesn't exist.
 * Creates a file with a unique name in this directory.
 * @param blocksize
 * @param algorithm Pass null to get default.
 * @param c Pass null to get default.
 * @param conf HBase system configuration. used with bloom filters
 * @param cacheConf Cache configuration and reference.
 * @param bloomType column family setting for bloom filters
 * @param maxKeyCount estimated maximum number of keys we expect to add
 * @return HFile.Writer
 * @throws IOException
 */
public static StoreFile.Writer createWriter(final FileSystem fs,
                                            final Path dir,
                                            final int blocksize,
                                            final Compression.Algorithm algorithm,
                                            final KeyValue.KVComparator c,
                                            final Configuration conf,
                                            final CacheConfig cacheConf,
                                            BloomType bloomType,
                                            long maxKeyCount)
    throws IOException {

  if (!fs.exists(dir)) {
    fs.mkdirs(dir);
  }
  Path path = getUniqueFile(fs, dir);
  if (!BloomFilterFactory.isBloomEnabled(conf)) {
    bloomType = BloomType.NONE;
  }

  return new Writer(fs, path, blocksize,
      algorithm == null? HFile.DEFAULT_COMPRESSION_ALGORITHM: algorithm,
      conf, cacheConf, c == null ? KeyValue.COMPARATOR: c, bloomType,
      maxKeyCount);
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:41,代码来源:StoreFile.java

示例2: StoreFile

import org.apache.hadoop.hbase.util.BloomFilterFactory; //导入方法依赖的package包/类
/**
 * Constructor, loads a reader and it's indices, etc. May allocate a
 * substantial amount of ram depending on the underlying files (10-20MB?).
 *
 * @param fs  The current file system to use.
 * @param p  The path of the file.
 * @param blockcache  <code>true</code> if the block cache is enabled.
 * @param conf  The current configuration.
 * @param cacheConf  The cache configuration and block cache reference.
 * @param cfBloomType The bloom type to use for this store file as specified
 *          by column family configuration. This may or may not be the same
 *          as the Bloom filter type actually present in the HFile, because
 *          column family configuration might change. If this is
 *          {@link BloomType#NONE}, the existing Bloom filter is ignored.
 * @throws IOException When opening the reader fails.
 */
StoreFile(final FileSystem fs,
          final Path p,
          final Configuration conf,
          final CacheConfig cacheConf,
          final BloomType cfBloomType)
    throws IOException {
  this.fs = fs;
  this.path = p;
  this.cacheConf = cacheConf;
  if (isReference(p)) {
    this.reference = Reference.read(fs, p);
    this.referencePath = getReferredToFile(this.path);
  }

  if (BloomFilterFactory.isBloomEnabled(conf)) {
    this.cfBloomType = cfBloomType;
  } else {
    LOG.info("Ignoring bloom filter check for file " + path + ": " +
        "cfBloomType=" + cfBloomType + " (disabled in config)");
    this.cfBloomType = BloomType.NONE;
  }

  // cache the modification time stamp of this store file
  FileStatus[] stats = FSUtils.listStatus(fs, p, null);
  if (stats != null && stats.length == 1) {
    this.modificationTimeStamp = stats[0].getModificationTime();
  } else {
    this.modificationTimeStamp = 0;
  }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:47,代码来源:StoreFile.java


注:本文中的org.apache.hadoop.hbase.util.BloomFilterFactory.isBloomEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。