diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-05-29 17:05:54 +1000 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2014-05-29 17:05:54 +1000 |
commit | 8fd65fb4a0e434d432452418d48a24185a3879c3 (patch) | |
tree | f6a1cfb3a5da215a1951b2f5fa7a61a4993ba465 /api | |
parent | d2b2805fef14b288cec2c6149cb3bb7778f14180 (diff) | |
download | mongo-8fd65fb4a0e434d432452418d48a24185a3879c3.tar.gz |
Fix build of HyperLevelDB support.
Diffstat (limited to 'api')
-rw-r--r-- | api/leveldb/leveldb_wt.cc | 20 | ||||
-rw-r--r-- | api/leveldb/leveldb_wt.h | 2 |
2 files changed, 12 insertions, 10 deletions
diff --git a/api/leveldb/leveldb_wt.cc b/api/leveldb/leveldb_wt.cc index b8daf51f80a..1d6c7e9b21a 100644 --- a/api/leveldb/leveldb_wt.cc +++ b/api/leveldb/leveldb_wt.cc @@ -103,13 +103,6 @@ public: int bits_per_key_; }; - -class CacheImpl : public Cache { -public: - CacheImpl(size_t capacity) : capacity_(capacity) {} - - size_t capacity_; -}; }; @@ -120,8 +113,15 @@ const FilterPolicy *NewBloomFilterPolicy(int bits_per_key) { return new FilterPolicyImpl(bits_per_key); } +class Cache { +public: + Cache(size_t capacity) : capacity_(capacity) {} + + size_t capacity_; +}; + Cache *NewLRUCache(size_t capacity) { - return new CacheImpl(capacity); + return new Cache(capacity); } Status DestroyDB(const std::string& name, const Options& options) { @@ -322,7 +322,7 @@ leveldb::DB::Open(const Options &options, const std::string &name, leveldb::DB * if (options.compression == kSnappyCompression) s_conn << "extensions=[libwiredtiger_snappy.so],"; if (options.block_cache) - s_conn << "cache_size=" << ((CacheImpl *)options.block_cache)->capacity_ << ","; + s_conn << "cache_size=" << ((Cache *)options.block_cache)->capacity_ << ","; std::string conn_config = s_conn.str(); WT_CONNECTION *conn; @@ -344,7 +344,7 @@ leveldb::DB::Open(const Options &options, const std::string &name, leveldb::DB * s_table << "bloom_hash_count=" << (int)(0.6 * bits) << ","; } s_table << "),"; - WT_SESSION *session/; + WT_SESSION *session; std::string table_config = s_table.str(); ret = conn->open_session(conn, NULL, NULL, &session); assert(ret == 0); diff --git a/api/leveldb/leveldb_wt.h b/api/leveldb/leveldb_wt.h index 0ab2c708114..277fd1834c9 100644 --- a/api/leveldb/leveldb_wt.h +++ b/api/leveldb/leveldb_wt.h @@ -1,3 +1,5 @@ +#include "wiredtiger_config.h" + #ifdef HAVE_HYPERLEVELDB #include <hyperleveldb/comparator.h> #include <hyperleveldb/db.h> |