Murmur3Partitioner partitioner = new Murmur3Partitioner(); try (DataInputStream in = new DataInputStream(new FileInputStream(new File("la-2-big-Filter.db"))); IFilter filter = FilterFactory.deserialize(in, true)) { for (int i = 1; i <= 10; i++) { DecoratedKey decoratedKey = partitioner.decorateKey(Int32Type.instance.decompose(i)); if (filter.isPresent(decoratedKey)) { System.out.println(i + " is present "); } else { System.out.println(i + " is not present "); } } }
/** * @return the largest timestamp before which it's okay to drop tombstones for the given partition; * i.e., after the maxPurgeableTimestamp there may exist newer data that still needs to be suppressed * in other sstables. This returns the minimum timestamp for any SSTable that contains this partition and is not * participating in this compaction, or LONG.MAX_VALUE if no such SSTable exists. */ public long maxPurgeableTimestamp(DecoratedKey key) { if (NEVER_PURGE_TOMBSTONES) return Long.MIN_VALUE; List<SSTableReader> filteredSSTables = overlappingTree.search(key); long min = Long.MAX_VALUE; for (SSTableReader sstable : filteredSSTables) { // if we don't have bloom filter(bf_fp_chance=1.0 or filter file is missing), // we check index file instead. if (sstable.getBloomFilter() instanceof AlwaysPresentFilter && sstable.getPosition(key, SSTableReader.Operator.EQ, false) != null) min = Math.min(min, sstable.getMinTimestamp()); else if (sstable.getBloomFilter().isPresent(key.getKey())) min = Math.min(min, sstable.getMinTimestamp()); } return min; }
|| sstable.getBloomFilter().isPresent(key))
|| sstable.getBloomFilter().isPresent(key))
|| sstable.getBloomFilter().isPresent(key))
if (!bf.isPresent((DecoratedKey)key))
if (!bf.isPresent(((DecoratedKey)key).getKey()))
if (!bf.isPresent((DecoratedKey)key))
if (!bf.isPresent((DecoratedKey)key))
if (!bf.isPresent((DecoratedKey)key))