Auto-Format two recent diffs and add HISTORY.md (#6685)

Summary:
Two recent diffs can be autoformatted.
Also add HISTORY.md entry for https://github.com/facebook/rocksdb/pull/6214
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6685

Test Plan: Run all existing tests

Reviewed By: cheng-chang

Differential Revision: D20965780

fbshipit-source-id: 195b08d7849513d42fe14073112cd19fdda6af95
main
sdong 5 years ago committed by Facebook GitHub Bot
parent f08630b914
commit 1be3be5522
  1. 1
      HISTORY.md
  2. 3
      memory/memkind_kmem_allocator.cc
  3. 1
      memory/memkind_kmem_allocator.h
  4. 13
      memory/memkind_kmem_allocator_test.cc
  5. 2
      tools/db_bench_tool.cc
  6. 8
      utilities/transactions/transaction_lock_mgr_test.cc

@ -5,6 +5,7 @@
### New Features
* Added support for pipelined & parallel compression optimization for `BlockBasedTableBuilder`. This optimization makes block building, block compression and block appending a pipeline, and uses multiple threads to accelerate block compression. Users can set `CompressionOptions::parallel_threads` greater than 1 to enable compression parallelism.
* Provide an allocator for memkind to be used with block cache. This is to work with memory technologies (Intel DCPMM is one such technology currently available) that require different libraries for allocation and management (such as PMDK and memkind). The high capacities available make it possible to provision large caches (up to several TBs in size) beyond what is achievable with DRAM.
### Bug Fixes
* Fix a bug when making options.bottommost_compression, options.compression_opts and options.bottommost_compression_opts dynamically changeable: the modified values are not written to option files or returned back to users when being queried.

@ -23,7 +23,8 @@ void MemkindKmemAllocator::Deallocate(void* p) {
}
#ifdef ROCKSDB_MALLOC_USABLE_SIZE
size_t MemkindKmemAllocator::UsableSize(void* p, size_t /*allocation_size*/) const {
size_t MemkindKmemAllocator::UsableSize(void* p,
size_t /*allocation_size*/) const {
return memkind_malloc_usable_size(MEMKIND_DAX_KMEM, p);
}
#endif // ROCKSDB_MALLOC_USABLE_SIZE

@ -25,4 +25,3 @@ class MemkindKmemAllocator : public MemoryAllocator {
} // namespace rocksdb
#endif // MEMKIND

@ -8,11 +8,11 @@
#ifdef MEMKIND
#include "memkind_kmem_allocator.h"
#include "test_util/testharness.h"
#include "rocksdb/cache.h"
#include "rocksdb/db.h"
#include "rocksdb/options.h"
#include "table/block_based/block_based_table_factory.h"
#include "test_util/testharness.h"
namespace rocksdb {
TEST(MemkindKmemAllocatorTest, Allocate) {
@ -44,8 +44,8 @@ TEST(MemkindKmemAllocatorTest, DatabaseBlockCache) {
ASSERT_OK(DestroyDB(dbname, options));
options.create_if_missing = true;
std::shared_ptr<Cache> cache = NewLRUCache(1024 * 1024, 6, false, false,
std::make_shared<MemkindKmemAllocator>());
std::shared_ptr<Cache> cache = NewLRUCache(
1024 * 1024, 6, false, false, std::make_shared<MemkindKmemAllocator>());
BlockBasedTableOptions table_options;
table_options.block_cache = cache;
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
@ -65,7 +65,8 @@ TEST(MemkindKmemAllocatorTest, DatabaseBlockCache) {
s = db->Put(wo, Slice(key), Slice(val));
ASSERT_OK(s);
}
ASSERT_OK(db->Flush(FlushOptions())); // Flush all data from memtable so that reads are from block cache
ASSERT_OK(db->Flush(FlushOptions())); // Flush all data from memtable so that
// reads are from block cache
// Read and check block cache usage
ReadOptions ro;
@ -93,7 +94,9 @@ int main(int argc, char** argv) {
#else
int main(int /*argc*/, char** /*argv*/) {
printf("Skip memkind_kmem_allocator_test as the required library memkind is missing.");
printf(
"Skip memkind_kmem_allocator_test as the required library memkind is "
"missing.");
}
#endif // MEMKIND

@ -2638,7 +2638,7 @@ class Benchmark {
}
return cache;
} else {
if(FLAGS_use_cache_memkind_kmem_allocator) {
if (FLAGS_use_cache_memkind_kmem_allocator) {
#ifdef MEMKIND
return NewLRUCache(
static_cast<size_t>(capacity), FLAGS_cache_numshardbits,

@ -5,12 +5,12 @@
#ifndef ROCKSDB_LITE
#include "utilities/transactions/transaction_lock_mgr.h"
#include "port/port.h"
#include "port/stack_trace.h"
#include "rocksdb/utilities/transaction_db.h"
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "rocksdb/utilities/transaction_db.h"
#include "utilities/transactions/transaction_lock_mgr.h"
#include "utilities/transactions/transaction_db_mutex_impl.h"
namespace ROCKSDB_NAMESPACE {
@ -29,8 +29,8 @@ class TransactionLockMgrTest : public testing::Test {
txn_opt.transaction_lock_timeout = 0;
ASSERT_OK(TransactionDB::Open(opt, txn_opt, db_dir_, &db_));
locker_.reset(new TransactionLockMgr(
db_, txn_opt.num_stripes, txn_opt.max_num_locks,
locker_.reset(
new TransactionLockMgr(db_, txn_opt.num_stripes, txn_opt.max_num_locks,
txn_opt.max_num_deadlocks, mutex_factory_));
}

Loading…
Cancel
Save