private void sanityCheck(Cell cell) throws IOException { if (this.getLastCell() != null) { if (comparator.compare(cell, this.getLastCell()) <= 0) { throw new IOException("Added a key not lexically larger than" + " previous. Current cell = " + cell + ", prevCell = " + this.getLastCell()); } } }
/** * Bloom information from the cell is retrieved * @param cell * @throws IOException */ public void writeBloom(Cell cell) throws IOException { // only add to the bloom filter on a new, unique key if (isNewKey(cell)) { sanityCheck(cell); bloomFilterWriter.append(cell); } }
private void appendGeneralBloomfilter(final Cell cell) throws IOException { if (this.generalBloomFilterWriter != null) { /* * http://2.bp.blogspot.com/_Cib_A77V54U/StZMrzaKufI/AAAAAAAAADo/ZhK7bGoJdMQ/s400/KeyValue.png * Key = RowLen + Row + FamilyLen + Column [Family + Qualifier] + Timestamp * * 4 Types of Filtering: * 1. Row = Row * 2. RowCol = Row + Qualifier * 3. RowPrefixFixedLength = Fixed Length Row Prefix * 4. RowPrefixDelimiter = Delimited Row Prefix */ bloomContext.writeBloom(cell); } }
private boolean closeGeneralBloomFilter() throws IOException { boolean hasGeneralBloom = closeBloomFilter(generalBloomFilterWriter); // add the general Bloom filter writer and append file info if (hasGeneralBloom) { writer.addGeneralBloomFilter(generalBloomFilterWriter); writer.appendFileInfo(BLOOM_FILTER_TYPE_KEY, Bytes.toBytes(bloomType.toString())); if (bloomParam != null) { writer.appendFileInfo(BLOOM_FILTER_PARAM_KEY, bloomParam); } bloomContext.addLastBloomKey(writer); } return hasGeneralBloom; }
private void appendDeleteFamilyBloomFilter(final Cell cell) throws IOException { if (!PrivateCellUtil.isDeleteFamily(cell) && !PrivateCellUtil.isDeleteFamilyVersion(cell)) { return; } // increase the number of delete family in the store file deleteFamilyCnt++; if (this.deleteFamilyBloomFilterWriter != null) { deleteFamilyBloomContext.writeBloom(cell); } }