Jiro Nishiguchi > RocksDB-0.02 > RocksDB::BloomFilterPolicy

Download:
RocksDB-0.02.tar.gz

Annotate this POD

Website

View/Report Bugs
Source   Latest Release: RocksDB-0.03

NAME ^

RocksDB::BloomFilterPolicy - rocksdb::BloomFilterPolicy object

SYNOPSIS ^

  use RocksDB;

  my $bits_per_key = 10;
  my $policy = RocksDB::BloomFilterPolicy->new($bits_per_key);
  my $db = RocksDB->new('/path/to/db', { filter_policy => $policy });

DESCRIPTION ^

RocksDB::BloomFilterPolicy is a rocksdb::BloomFilterPolicy object.

CONSTRUCTOR ^

RocksDB::BloomFilterPolicy->new($bits_per_key :Int) :RocksDB::BloomFilterPolicy

Return a new filter policy that uses a bloom filter with approximately the specified number of bits per key. A good value for $bits_per_key is 10, which yields a filter with ~ 1% false positive rate.

Note: if you are using a custom comparator that ignores some parts of the keys being compared, you must not use this class and must provide your own FilterPolicy that also ignores the corresponding parts of the keys. For example, if the comparator ignores trailing spaces, it would be incorrect to use a FilterPolicy (like this class) that does not ignore trailing spaces in keys.

SEE ALSO ^

RocksDB, RocksDB::FilterPolicy

AUTHOR ^

Jiro Nishiguchi <jiro@cpan.org>

syntax highlighting: