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


Java BloomFilter类代码示例

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


BloomFilter类属于org.apache.hadoop.hbase.util包,在下文中一共展示了BloomFilter类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: passesDeleteFamilyBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
public boolean passesDeleteFamilyBloomFilter(byte[] row, int rowOffset, int rowLen) {
  // Cache Bloom filter as a local variable in case it is set to null by
  // another thread on an IO error.
  BloomFilter bloomFilter = this.deleteFamilyBloomFilter;

  // Empty file or there is no delete family at all
  if (reader.getTrailer().getEntryCount() == 0 || deleteFamilyCnt == 0) {
    return false;
  }

  if (bloomFilter == null) {
    return true;
  }

  try {
    if (!bloomFilter.supportsAutoLoading()) {
      return true;
    }
    return bloomFilter.contains(row, rowOffset, rowLen, null);
  } catch (IllegalArgumentException e) {
    LOG.error("Bad Delete Family bloom filter data -- proceeding without", e);
    setDeleteFamilyBloomFilterFaulty();
  }

  return true;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:StoreFile.java

示例2: passesGeneralRowBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
/**
 * A method for checking Bloom filters. Called directly from
 * StoreFileScanner in case of a multi-column query.
 *
 * @return True if passes
 */
public boolean passesGeneralRowBloomFilter(byte[] row, int rowOffset, int rowLen) {
  BloomFilter bloomFilter = this.generalBloomFilter;
  if (bloomFilter == null) {
    return true;
  }

  // Used in ROW bloom
  byte[] key = null;
  if (rowOffset != 0 || rowLen != row.length) {
    throw new AssertionError(
        "For row-only Bloom filters the row " + "must occupy the whole array");
  }
  key = row;
  return checkGeneralBloomFilter(key, null, bloomFilter);
}
 
开发者ID:apache,项目名称:hbase,代码行数:22,代码来源:StoreFileReader.java

示例3: passesGeneralRowColBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
/**
 * A method for checking Bloom filters. Called directly from
 * StoreFileScanner in case of a multi-column query.
 *
 * @param cell
 *          the cell to check if present in BloomFilter
 * @return True if passes
 */
public boolean passesGeneralRowColBloomFilter(Cell cell) {
  BloomFilter bloomFilter = this.generalBloomFilter;
  if (bloomFilter == null) {
    return true;
  }
  // Used in ROW_COL bloom
  Cell kvKey = null;
  // Already if the incoming key is a fake rowcol key then use it as it is
  if (cell.getTypeByte() == KeyValue.Type.Maximum.getCode() && cell.getFamilyLength() == 0) {
    kvKey = cell;
  } else {
    kvKey = PrivateCellUtil.createFirstOnRowCol(cell);
  }
  return checkGeneralBloomFilter(null, kvKey, bloomFilter);
}
 
开发者ID:apache,项目名称:hbase,代码行数:24,代码来源:StoreFileReader.java

示例4: passesDeleteFamilyBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
public boolean passesDeleteFamilyBloomFilter(byte[] row, int rowOffset,
                                             int rowLen) {
    // Cache Bloom filter as a local variable in case it is set to null by
    // another thread on an IO error.
    BloomFilter bloomFilter = this.deleteFamilyBloomFilter;

    // Empty file or there is no delete family at all
    if (reader.getTrailer().getEntryCount() == 0 || deleteFamilyCnt == 0) {
        return false;
    }

    if (bloomFilter == null) {
        return true;
    }

    try {
        if (!bloomFilter.supportsAutoLoading()) {
            return true;
        }
        return bloomFilter.contains(row, rowOffset, rowLen, null);
    } catch (IllegalArgumentException e) {
        LOG.error("Bad Delete Family bloom filter data -- proceeding without",
                e);
        setDeleteFamilyBloomFilterFaulty();
    }

    return true;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:29,代码来源:StoreFile.java

示例5: passesDeleteFamilyBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
public boolean passesDeleteFamilyBloomFilter(byte[] row, int rowOffset,
    int rowLen) {
  // Cache Bloom filter as a local variable in case it is set to null by
  // another thread on an IO error.
  BloomFilter bloomFilter = this.deleteFamilyBloomFilter;

  // Empty file or there is no delete family at all
  if (reader.getTrailer().getEntryCount() == 0 || deleteFamilyCnt == 0) {
    return false;
  }

  if (bloomFilter == null) {
    return true;
  }

  try {
    if (!bloomFilter.supportsAutoLoading()) {
      return true;
    }
    return bloomFilter.contains(row, rowOffset, rowLen, null);
  } catch (IllegalArgumentException e) {
    LOG.error("Bad Delete Family bloom filter data -- proceeding without",
        e);
    setDeleteFamilyBloomFilterFaulty();
  }

  return true;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:29,代码来源:StoreFile.java

示例6: getGeneralBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
BloomFilter getGeneralBloomFilter() {
  return generalBloomFilter;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:4,代码来源:StoreFile.java

示例7: getGeneralBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
BloomFilter getGeneralBloomFilter() {
    return generalBloomFilter;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:4,代码来源:StoreFile.java

示例8: getBloomFilter

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的package包/类
BloomFilter getBloomFilter() {
  return bloomFilter;
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:4,代码来源:StoreFile.java

示例9: printMeta

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的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

示例10: printMeta

import org.apache.hadoop.hbase.util.BloomFilter; //导入依赖的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.BloomFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。