Reviewing LevelDB: Part VII - Filters?
Join the DZone community and get the full member experience.
Join For Free
i was all set to finish this series, when i realized that i missed something important, i didn’t covered, and indeed, i don’t currently understand, what filters are, and how are they used.
as usual, once i actually got to the part of the code where this is actually handled (instead of ignoring it), it made a lot more sense:
and that, following with the rest of the code that i read makes a lot more sense.
a sst is a sorted table, essentially. we have the keys and the blocks, etc. and we can find a value very quickly. but what if you could do this even more cheaply?
using a bloom filter is a good way to never get false negative, and it will reduce the amount of work we have to do if we can’t find the key in the sst drastically (only need to read the filter value, don’t even need to do any additional checks). quite elegant, even if i say so myself.
there is one thing to pay attention to and that is that you can define your own comparator, in which case you must also define you own filter policy. if you use a comparator that ignore casing, you also need to provider a filter that ignore casing.
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
AI and Cybersecurity Protecting Against Emerging Threats
-
Avoiding Pitfalls With Java Optional: Common Mistakes and How To Fix Them [Video]
-
A Deep Dive Into the Differences Between Kafka and Pulsar
-
Integrating AWS With Salesforce Using Terraform
Comments