Skip to content

Commit be51375

Browse files
author
Torrie Fischer
committed
Update rocksdb
1 parent 3de7a32 commit be51375

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

src/ripple/nodestore/backend/RocksDBFactory.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class RocksDBBackend
8585
Scheduler& m_scheduler;
8686
BatchWriter m_batch;
8787
std::string m_name;
88-
std::unique_ptr <rocksdb::FilterPolicy const> m_filter_policy;
8988
std::unique_ptr <rocksdb::DB> m_db;
9089

9190
RocksDBBackend (int keyBytes, Parameters const& keyValues,
@@ -100,28 +99,28 @@ class RocksDBBackend
10099
throw std::runtime_error ("Missing path in RocksDBFactory backend");
101100

102101
rocksdb::Options options;
102+
rocksdb::BlockBasedTableOptions table_options;
103103
options.create_if_missing = true;
104104
options.env = env;
105105

106106
if (keyValues["cache_mb"].isEmpty())
107107
{
108-
options.block_cache = rocksdb::NewLRUCache (getConfig ().getSize (siHashNodeDBCache) * 1024 * 1024);
108+
table_options.block_cache = rocksdb::NewLRUCache (getConfig ().getSize (siHashNodeDBCache) * 1024 * 1024);
109109
}
110110
else
111111
{
112-
options.block_cache = rocksdb::NewLRUCache (keyValues["cache_mb"].getIntValue() * 1024L * 1024L);
112+
table_options.block_cache = rocksdb::NewLRUCache (keyValues["cache_mb"].getIntValue() * 1024L * 1024L);
113113
}
114114

115115
if (keyValues["filter_bits"].isEmpty())
116116
{
117117
if (getConfig ().NODE_SIZE >= 2)
118-
m_filter_policy.reset (rocksdb::NewBloomFilterPolicy (10));
118+
table_options.filter_policy.reset (rocksdb::NewBloomFilterPolicy (10));
119119
}
120120
else if (keyValues["filter_bits"].getIntValue() != 0)
121121
{
122-
m_filter_policy.reset (rocksdb::NewBloomFilterPolicy (keyValues["filter_bits"].getIntValue()));
122+
table_options.filter_policy.reset (rocksdb::NewBloomFilterPolicy (keyValues["filter_bits"].getIntValue()));
123123
}
124-
options.filter_policy = m_filter_policy.get();
125124

126125
if (! keyValues["open_files"].isEmpty())
127126
{
@@ -167,7 +166,7 @@ class RocksDBBackend
167166

168167
if (! keyValues["block_size"].isEmpty ())
169168
{
170-
options.block_size = keyValues["block_size"].getIntValue ();
169+
table_options.block_size = keyValues["block_size"].getIntValue ();
171170
}
172171

173172
if (! keyValues["universal_compaction"].isEmpty ())
@@ -181,6 +180,8 @@ class RocksDBBackend
181180
}
182181
}
183182

183+
options.table_factory.reset(NewBlockBasedTableFactory(table_options));
184+
184185
rocksdb::DB* db = nullptr;
185186
rocksdb::Status status = rocksdb::DB::Open (options, m_name, &db);
186187
if (!status.ok () || !db)
@@ -344,12 +345,12 @@ class RocksDBFactory : public Factory
344345

345346
RocksDBFactory ()
346347
{
347-
rocksdb::Options options;
348-
options.create_if_missing = true;
349-
options.block_cache = rocksdb::NewLRUCache (
348+
rocksdb::BlockBasedTableOptions table_options;
349+
350+
table_options.block_cache = rocksdb::NewLRUCache (
350351
getConfig ().getSize (siHashNodeDBCache) * 1024 * 1024);
351352

352-
m_lruCache = options.block_cache;
353+
m_lruCache = table_options.block_cache;
353354
}
354355

355356
~RocksDBFactory ()

src/ripple/unity/rocksdb.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include <rocksdb2/db/db_iter.cc>
6262
#include <rocksdb2/db/file_indexer.cc>
6363
#include <rocksdb2/db/filename.cc>
64+
#include <rocksdb2/db/flush_scheduler.cc>
6465
#include <rocksdb2/db/forward_iterator.cc>
6566
#include <rocksdb2/db/internal_stats.cc>
6667
#include <rocksdb2/db/log_reader.cc>
@@ -72,12 +73,14 @@
7273
#include <rocksdb2/db/repair.cc>
7374
#include <rocksdb2/db/table_cache.cc>
7475
#include <rocksdb2/db/table_properties_collector.cc>
75-
#include <rocksdb2/db/tailing_iter.cc>
7676
#include <rocksdb2/db/transaction_log_impl.cc>
7777
#include <rocksdb2/db/version_edit.cc>
7878
#include <rocksdb2/db/version_set.cc>
7979
#include <rocksdb2/db/write_batch.cc>
80+
#include <rocksdb2/db/write_controller.cc>
81+
#include <rocksdb2/db/write_thread.cc>
8082
#include <rocksdb2/table/adaptive_table_factory.cc>
83+
#include <rocksdb2/table/block_based_filter_block.cc>
8184
#include <rocksdb2/table/block_based_table_builder.cc>
8285
#include <rocksdb2/table/block_based_table_factory.cc>
8386
#include <rocksdb2/table/block_based_table_reader.cc>
@@ -87,10 +90,12 @@
8790
#include <rocksdb2/table/block_prefix_index.cc>
8891
#include <rocksdb2/table/bloom_block.cc>
8992
#include <rocksdb2/table/cuckoo_table_builder.cc>
93+
#include <rocksdb2/table/cuckoo_table_factory.cc>
9094
#include <rocksdb2/table/cuckoo_table_reader.cc>
91-
#include <rocksdb2/table/filter_block.cc>
9295
#include <rocksdb2/table/flush_block_policy.cc>
9396
#include <rocksdb2/table/format.cc>
97+
#include <rocksdb2/table/full_filter_block.cc>
98+
#include <rocksdb2/table/get_context.cc>
9499
#include <rocksdb2/table/iterator.cc>
95100
#include <rocksdb2/table/merger.cc>
96101
#include <rocksdb2/table/meta_blocks.cc>
@@ -109,6 +114,7 @@
109114
#include <rocksdb2/util/coding.cc>
110115
#include <rocksdb2/util/comparator.cc>
111116
#include <rocksdb2/util/crc32c.cc>
117+
#include <rocksdb2/util/db_info_dummper.cc>
112118
#include <rocksdb2/util/dynamic_bloom.cc>
113119
#include <rocksdb2/util/env.cc>
114120
#include <rocksdb2/util/env_hdfs.cc>
@@ -120,7 +126,9 @@
120126
#include <rocksdb2/util/hash_skiplist_rep.cc>
121127
#include <rocksdb2/util/histogram.cc>
122128
#include <rocksdb2/util/iostats_context.cc>
129+
#include <rocksdb2/util/options_helper.cc>
123130
#include <rocksdb2/utilities/backupable/backupable_db.cc>
131+
#include <rocksdb2/utilities/compacted_db/compacted_db_impl.cc>
124132
#include <rocksdb2/utilities/document/document_db.cc>
125133
#include <rocksdb2/utilities/document/json_document.cc>
126134
#include <rocksdb2/utilities/geodb/geodb_impl.cc>

0 commit comments

Comments
 (0)