Zach Brown b8d7e04262 Add negative caching of item ranges
The item cache only knew about present items in the rbtree.  Attempts to
read items that didn't exist would always trigger expensive manfifest
and segment searches.

This reworks the item cache and item reading code to support the notion
of cached ranges of keys.  When we read items we also communicate the
range of keys that we searched.  This lets the cache return negative lookups
for key values in the search that don't have items.

The item cache gets an rbtree of key ranges.  Each item lookup method
now uses it to determine if a missing item needs to trigger a read.

Item reading is now performed in batches instead of one at a time.  This
lets us specify the cache range along with the batch and apply them all
atomically under the lock.

The item range code is much more robust now that it has to track
the range of keys that it searches.  The read items call now takes a range.
It knows to look for all level0 segments that interesect that range, not
just the first key.  The manifest segment references now include the
min and max keys for the segment so we can use those to define the
item search range.

Since the refs now include keys we no longer have them as a dumb allocated
array but instead have a list of alloced ref structs.

Signed-off-by: Zach Brown <zab@versity.com>
2017-04-18 13:44:53 -07:00
2017-04-18 13:44:53 -07:00
Description
No description provided
6.7 MiB
Languages
C 87.2%
Shell 9.1%
Roff 2.5%
TeX 0.9%
Makefile 0.3%