]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Removed Cache from metrics flow for Block::MetricsIter to DBImpl
authorKosie van der Merwe <kosie.vandermerwe@gmail.com>
Fri, 15 Feb 2013 20:10:00 +0000 (12:10 -0800)
committerKosie van der Merwe <kosie.vandermerwe@gmail.com>
Fri, 15 Feb 2013 20:10:00 +0000 (12:10 -0800)
commit2c0dde198c5804ca48f27d6c512c57dee45f06a0
tree1c1d547f55dc69705207dc2fff75f7cbe470517a
parentdc23fd24a04aaf110a105506981266ed114c36c0
Removed Cache from metrics flow for Block::MetricsIter to DBImpl

Summary:
Before this patch we had to send metrics to `Cache`, which then sent the metrics to `DBImpl`. Now we directly send them to `DBImpl`, by the use of a pointer to a pointer of a `BlockMetrics` instance. We can do this safely and without additional locks because:

* `Block::MetricsIter` runs in the same thread as `DBImpl::Get()` (in which the `BlockMetrics` pointer resides)
* `DBImpl::Get()` locks `DBImpl` again after the `Block::MetricsIter` is destroyed, so we don't have to do an additional lock.

Test Plan: make check

Reviewers: vamsi, dhruba

Reviewed By: vamsi

CC: leveldb
Differential Revision: https://reviews.facebook.net/D8583
db/db_impl.cc
db/db_impl.h
db/version_set.cc
include/leveldb/cache.h
include/leveldb/options.h
table/block.cc
table/block.h
table/block_test.cc
table/table.cc
util/cache.cc