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


Java BloomFilterFactory.createFromMeta方法代码示例

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


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

示例1: BloomFilterImpl

import org.apache.hadoop.hbase.util.BloomFilterFactory; //导入方法依赖的package包/类
public BloomFilterImpl() throws IOException {
  DataInput bin = reader.getGeneralBloomFilterMetadata();
  // instantiate bloom filter if meta present in hfile
  if (bin != null) {
    hfileBloom = BloomFilterFactory.createFromMeta(bin, reader);
    if (reader.getComparator() instanceof DelegatingSerializedComparator) {
      loadComparators((DelegatingSerializedComparator) hfileBloom.getComparator());
    }
  } else {
    hfileBloom = null;
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:13,代码来源:HFileSortedOplog.java

示例2: printMeta

import org.apache.hadoop.hbase.util.BloomFilterFactory; //导入方法依赖的package包/类
private void printMeta(HFile.Reader reader, Map<byte[], byte[]> fileInfo)
    throws IOException {
  System.out.println("Block index size as per heapsize: "
      + reader.indexSize());
  System.out.println(asSeparateLines(reader.toString()));
  System.out.println("Trailer:\n    "
      + asSeparateLines(reader.getTrailer().toString()));
  System.out.println("Fileinfo:");
  for (Map.Entry<byte[], byte[]> e : fileInfo.entrySet()) {
    System.out.print(FOUR_SPACES + Bytes.toString(e.getKey()) + " = ");
    if (Bytes.compareTo(e.getKey(), Bytes.toBytes("MAX_SEQ_ID_KEY")) == 0) {
      long seqid = Bytes.toLong(e.getValue());
      System.out.println(seqid);
    } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("TIMERANGE")) == 0) {
      TimeRangeTracker timeRangeTracker = new TimeRangeTracker();
      Writables.copyWritable(e.getValue(), timeRangeTracker);
      System.out.println(timeRangeTracker.getMinimumTimestamp() + "...."
          + timeRangeTracker.getMaximumTimestamp());
    } else if (Bytes.compareTo(e.getKey(), FileInfo.AVG_KEY_LEN) == 0
        || Bytes.compareTo(e.getKey(), FileInfo.AVG_VALUE_LEN) == 0) {
      System.out.println(Bytes.toInt(e.getValue()));
    } else {
      System.out.println(Bytes.toStringBinary(e.getValue()));
    }
  }

  System.out.println("Mid-key: " + Bytes.toStringBinary(reader.midkey()));

  // Printing bloom information
  DataInput bloomMeta = reader.getBloomFilterMetadata();
  BloomFilter bloomFilter = null;
  if (bloomMeta != null)
    bloomFilter = BloomFilterFactory.createFromMeta(bloomMeta, reader);

  System.out.println("Bloom filter:");
  if (bloomFilter != null) {
    System.out.println(FOUR_SPACES + bloomFilter.toString().replaceAll(
        ByteBloomFilter.STATS_RECORD_SEP, "\n" + FOUR_SPACES));
  } else {
    System.out.println(FOUR_SPACES + "Not present");
  }
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:43,代码来源:HFilePrettyPrinter.java

示例3: printMeta

import org.apache.hadoop.hbase.util.BloomFilterFactory; //导入方法依赖的package包/类
private void printMeta(HFile.Reader reader, Map<byte[], byte[]> fileInfo)
    throws IOException {
  System.out.println("Block index size as per heapsize: "
      + reader.indexSize());
  System.out.println(asSeparateLines(reader.toString()));
  System.out.println("Trailer:\n    "
      + asSeparateLines(reader.getTrailer().toString()));
  System.out.println("Fileinfo:");
  for (Map.Entry<byte[], byte[]> e : fileInfo.entrySet()) {
    System.out.print(FOUR_SPACES + Bytes.toString(e.getKey()) + " = ");
    if (Bytes.compareTo(e.getKey(), Bytes.toBytes("MAX_SEQ_ID_KEY")) == 0) {
      long seqid = Bytes.toLong(e.getValue());
      System.out.println(seqid);
    } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("TIMERANGE")) == 0) {
      TimeRangeTracker timeRangeTracker = new TimeRangeTracker();
      Writables.copyWritable(e.getValue(), timeRangeTracker);
      System.out.println(timeRangeTracker.getMinimumTimestamp() + "...."
          + timeRangeTracker.getMaximumTimestamp());
    } else if (Bytes.compareTo(e.getKey(), FileInfo.AVG_KEY_LEN) == 0
        || Bytes.compareTo(e.getKey(), FileInfo.AVG_VALUE_LEN) == 0) {
      System.out.println(Bytes.toInt(e.getValue()));
    } else {
      System.out.println(Bytes.toStringBinary(e.getValue()));
    }
  }

  System.out.println("Mid-key: " + Bytes.toStringBinary(reader.midkey()));

  // Printing general bloom information
  DataInput bloomMeta = reader.getGeneralBloomFilterMetadata();
  BloomFilter bloomFilter = null;
  if (bloomMeta != null)
    bloomFilter = BloomFilterFactory.createFromMeta(bloomMeta, reader);

  System.out.println("Bloom filter:");
  if (bloomFilter != null) {
    System.out.println(FOUR_SPACES + bloomFilter.toString().replaceAll(
        ByteBloomFilter.STATS_RECORD_SEP, "\n" + FOUR_SPACES));
  } else {
    System.out.println(FOUR_SPACES + "Not present");
  }

  // Printing delete bloom information
  bloomMeta = reader.getDeleteBloomFilterMetadata();
  bloomFilter = null;
  if (bloomMeta != null)
    bloomFilter = BloomFilterFactory.createFromMeta(bloomMeta, reader);

  System.out.println("Delete Family Bloom filter:");
  if (bloomFilter != null) {
    System.out.println(FOUR_SPACES
        + bloomFilter.toString().replaceAll(ByteBloomFilter.STATS_RECORD_SEP,
            "\n" + FOUR_SPACES));
  } else {
    System.out.println(FOUR_SPACES + "Not present");
  }
}
 
开发者ID:zwqjsj0404,项目名称:HBase-Research,代码行数:58,代码来源:HFilePrettyPrinter.java


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