* If the HStore already exists, it will read in the bloom filter saved
* previously. Otherwise, it will create a new bloom filter.
*/
private Filter loadOrCreateBloomFilter() throws IOException {
Path filterFile = new Path(filterDir, BLOOMFILTER_FILE_NAME);
Filter bloomFilter = null;
if(fs.exists(filterFile)) {
if (LOG.isDebugEnabled()) {
LOG.debug("loading bloom filter for " + this.storeName);
}
BloomFilterDescriptor.BloomFilterType type =
family.getBloomFilter().filterType;
switch(type) {
case BLOOMFILTER:
bloomFilter = new BloomFilter();
break;
case COUNTING_BLOOMFILTER:
bloomFilter = new CountingBloomFilter();
break;
case RETOUCHED_BLOOMFILTER:
bloomFilter = new RetouchedBloomFilter();
break;
default:
throw new IllegalArgumentException("unknown bloom filter type: " +
type);
}
FSDataInputStream in = fs.open(filterFile);
try {
bloomFilter.readFields(in);
} finally {
fs.close();
}
} else {
if (LOG.isDebugEnabled()) {