rocksdb/java/rocksjni
Marton Trencseni 522de4f59e Adding pin_l0_filter_and_index_blocks_in_cache feature.
Summary:
When a block based table file is opened, if prefetch_index_and_filter is true, it will prefetch the index and filter blocks, putting them into the block cache.
What this feature adds: when a L0 block based table file is opened, if pin_l0_filter_and_index_blocks_in_cache is true in the options (and prefetch_index_and_filter is true), then the filter and index blocks aren't released back to the block cache at the end of BlockBasedTableReader::Open(). Instead the table reader takes ownership of them, hence pinning them, ie. the LRU cache will never push them out. Meanwhile in the table reader, further accesses will not hit the block cache, thus avoiding lock contention.
When the table reader is destroyed, it releases the pinned blocks (if there were any). This has to happen before the cache is destroyed, so I had to introduce a TableReader::Close(), to guarantee the order of destruction.

Test Plan:
Added two unit tests for this. Existing unit tests run fine (default is pin_l0_filter_and_index_blocks_in_cache=false).

DISABLE_JEMALLOC=1 OPT=-g make all valgrind_check -j32
  Mac: OK.
  Linux: with D55287 patched in it's OK.

Reviewers: sdong

Reviewed By: sdong

Subscribers: andrewkr, leveldb, dhruba

Differential Revision: https://reviews.facebook.net/D54801
2016-03-17 22:40:01 +00:00
..
backupablejni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
backupenginejni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
checkpoint.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
columnfamilyhandle.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
compaction_filter.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
comparator.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
comparatorjnicallback.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
comparatorjnicallback.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
env.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
filter.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
iterator.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
loggerjnicallback.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
loggerjnicallback.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
memtablejni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
merge_operator.cc Integrated feedback from ankgup87 2014-10-13 15:37:29 -07:00
options.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
portal.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
ratelimiterjni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
remove_emptyvalue_compactionfilterjni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
restorejni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
rocksjni.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
slice.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
snapshot.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
statistics.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
table.cc Adding pin_l0_filter_and_index_blocks_in_cache feature. 2016-03-17 22:40:01 +00:00
transaction_log.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
ttl.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
write_batch_test.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
write_batch_with_index.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
write_batch.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
writebatchhandlerjnicallback.cc Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
writebatchhandlerjnicallback.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00