summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-05-29 17:05:54 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-05-29 17:05:54 +1000
commit8fd65fb4a0e434d432452418d48a24185a3879c3 (patch)
treef6a1cfb3a5da215a1951b2f5fa7a61a4993ba465
parentd2b2805fef14b288cec2c6149cb3bb7778f14180 (diff)
downloadmongo-8fd65fb4a0e434d432452418d48a24185a3879c3.tar.gz
Fix build of HyperLevelDB support.
-rw-r--r--api/leveldb/leveldb_wt.cc20
-rw-r--r--api/leveldb/leveldb_wt.h2
-rw-r--r--build_posix/aclocal/options.m43
3 files changed, 14 insertions, 11 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>
diff --git a/build_posix/aclocal/options.m4 b/build_posix/aclocal/options.m4
index f07c18fc167..95b9e823d54 100644
--- a/build_posix/aclocal/options.m4
+++ b/build_posix/aclocal/options.m4
@@ -67,19 +67,20 @@ hyper) wt_cv_enable_leveldb=yes
wt_cv_enable_hyperleveldb=yes;;
*) wt_cv_enable_leveldb=yes;;
esac
+AH_TEMPLATE(HAVE_HYPERLEVELDB, [Build the LevelDB API with HyperLevelDB support.])
AC_MSG_RESULT($wt_cv_enable_leveldb)
if test "$wt_cv_enable_hyperleveldb" = "yes"; then
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(hyperleveldb/db.h,,
[AC_MSG_ERROR([--enable-leveldb=hyper requires hyperleveldb/db.h])])
AC_LANG_POP([C++])
+ AC_DEFINE(HAVE_HYPERLEVELDB)
elif test "$wt_cv_enable_leveldb" = "yes"; then
AC_LANG_PUSH([C++])
AC_CHECK_HEADER(leveldb/db.h,,
[AC_MSG_ERROR([--enable-leveldb requires leveldb/db.h])])
AC_LANG_POP([C++])
fi
-AM_CONDITIONAL([HYPERLEVELDB], [test "$wt_cv_enable_hyperleveldb" = "yes"])
AM_CONDITIONAL([LEVELDB], [test "$wt_cv_enable_leveldb" = "yes"])
AC_MSG_CHECKING(if --enable-python option specified)