Add Header cache to KeyValueStore

In the performance statistic recently, the header lookup becomes the main time
consuming for the read/write operations. Most of time it occur 50% to deal with
header lookup, decode/encode logics.

Now adding header cache using SharedLRU structure which will maintain the header
cache and caller will get the pointer to the real header. It also avoid too much
header copy operations overhead.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Remove exclusive lock on GenericObjectMap

Now most of GenericObjectMap interfaces use header as argument not the union of
coll_t and ghobject_t. So caller should be responsible for maintain the
exclusive header.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Add random cache and replace SharedLRU in KeyValueStore

SharedLRU plays pool performance in KeyValueStore with large header cache size,
so a performance optimized RandomCache could improve it.

RandomCache will record the lookup frequency of key. When evictint element,
it will randomly compare several elements's frequency and evict the least
one.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Use submit_transaction_sync to make change durable

submit_transaction will use asynchronous write operation, there is no journal
for keyvaluestore so we need to make it sync

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Add random_cache.hpp to Makefile.am

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Merge pull request #1999 from yuyuyu101/keyvaluestore-cache

Keyvaluestore cache

Reviewed-by: Samuel Just <sam.just@inktank.com>