summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-09-08 22:20:49 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-09-08 22:20:49 +1000
commitc7ddaaeef8cf7483111c7266c99bf490b4e88016 (patch)
treeb209f6c76d52e0423780841f422771998a36b5e9 /api
parentdea653d368b8544d634a0dd816c96a5b1afbfb98 (diff)
downloadmongo-c7ddaaeef8cf7483111c7266c99bf490b4e88016.tar.gz
Fixes for the LevelDB JNI build. Make the fields of Slice public, rename the config file and only include the necessary defines.
Diffstat (limited to 'api')
-rw-r--r--api/leveldb/Makefile.am2
-rw-r--r--api/leveldb/basho/perf_count.h2
-rw-r--r--api/leveldb/config.hin22
-rw-r--r--api/leveldb/hyperleveldb/replay_iterator.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/cache.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/comparator.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/db.h8
-rw-r--r--api/leveldb/leveldb/include/leveldb/env.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/filter_policy.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/iterator.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/options.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/slice.h5
-rw-r--r--api/leveldb/leveldb/include/leveldb/status.h2
-rw-r--r--api/leveldb/leveldb/include/leveldb/write_batch.h2
-rw-r--r--api/leveldb/leveldb_wt.cc14
-rw-r--r--api/leveldb/leveldb_wt.h3
16 files changed, 47 insertions, 27 deletions
diff --git a/api/leveldb/Makefile.am b/api/leveldb/Makefile.am
index 44aa69bbd48..2cfd9d945a5 100644
--- a/api/leveldb/Makefile.am
+++ b/api/leveldb/Makefile.am
@@ -16,7 +16,7 @@ leveldbincludedir = $(includedir)/wiredtiger/leveldb
endif
endif
leveldbinclude_HEADERS = \
- wiredtiger_config.h \
+ leveldb_wt_config.h \
leveldb/include/leveldb/cache.h \
leveldb/include/leveldb/comparator.h\
leveldb/include/leveldb/db.h \
diff --git a/api/leveldb/basho/perf_count.h b/api/leveldb/basho/perf_count.h
index 0edf1b96549..b0f4abf9b66 100644
--- a/api/leveldb/basho/perf_count.h
+++ b/api/leveldb/basho/perf_count.h
@@ -23,7 +23,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_PERF_COUNT_H_
#define STORAGE_LEVELDB_INCLUDE_PERF_COUNT_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#include <stdint.h>
#include <string>
diff --git a/api/leveldb/config.hin b/api/leveldb/config.hin
new file mode 100644
index 00000000000..131b68969d3
--- /dev/null
+++ b/api/leveldb/config.hin
@@ -0,0 +1,22 @@
+/* api/leveldb/config.hin. Generated by autoheader, then hand-edited. */
+
+/* Build the LevelDB API with Basho LevelDB support. */
+#undef HAVE_BASHOLEVELDB
+
+/* Snappy support automatically loaded. */
+#undef HAVE_BUILTIN_EXTENSION_SNAPPY
+
+/* Zlib support automatically loaded. */
+#undef HAVE_BUILTIN_EXTENSION_ZLIB
+
+/* Define to 1 for diagnostic tests. */
+#undef HAVE_DIAGNOSTIC
+
+/* Build the LevelDB API with HyperLevelDB support. */
+#undef HAVE_HYPERLEVELDB
+
+/* Define to 1 if you have the `snappy' library (-lsnappy). */
+#undef HAVE_LIBSNAPPY
+
+/* Build the LevelDB API with RocksDB support. */
+#undef HAVE_ROCKSDB
diff --git a/api/leveldb/hyperleveldb/replay_iterator.h b/api/leveldb/hyperleveldb/replay_iterator.h
index 6e2f562c6c4..397acdfd889 100644
--- a/api/leveldb/hyperleveldb/replay_iterator.h
+++ b/api/leveldb/hyperleveldb/replay_iterator.h
@@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_REPLAY_ITERATOR_H_
#define STORAGE_LEVELDB_INCLUDE_REPLAY_ITERATOR_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#include "slice.h"
#include "status.h"
diff --git a/api/leveldb/leveldb/include/leveldb/cache.h b/api/leveldb/leveldb/include/leveldb/cache.h
index 6ae25122133..94be8e919a8 100644
--- a/api/leveldb/leveldb/include/leveldb/cache.h
+++ b/api/leveldb/leveldb/include/leveldb/cache.h
@@ -18,7 +18,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_CACHE_H_
#define STORAGE_LEVELDB_INCLUDE_CACHE_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/comparator.h b/api/leveldb/leveldb/include/leveldb/comparator.h
index 23e0ba84559..78d83a4d08e 100644
--- a/api/leveldb/leveldb/include/leveldb/comparator.h
+++ b/api/leveldb/leveldb/include/leveldb/comparator.h
@@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_
#define STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/db.h b/api/leveldb/leveldb/include/leveldb/db.h
index c1818d28a7a..df8fcbbe9f8 100644
--- a/api/leveldb/leveldb/include/leveldb/db.h
+++ b/api/leveldb/leveldb/include/leveldb/db.h
@@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_DB_H_
#define STORAGE_LEVELDB_INCLUDE_DB_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
@@ -292,6 +292,12 @@ class DB {
// db->CompactRange(NULL, NULL);
virtual void CompactRange(const Slice* begin, const Slice* end) = 0;
+ // Suspends the background compaction thread. This methods
+ // returns once suspended.
+ virtual void SuspendCompactions() = 0;
+ // Resumes a suspended background compation thread.
+ virtual void ResumeCompactions() = 0;
+
#ifdef HAVE_HYPERLEVELDB
// Create a live backup of a live LevelDB instance.
// The backup is stored in a directory named "backup-<name>" under the top
diff --git a/api/leveldb/leveldb/include/leveldb/env.h b/api/leveldb/leveldb/include/leveldb/env.h
index 0d043307736..4ad67d36fea 100644
--- a/api/leveldb/leveldb/include/leveldb/env.h
+++ b/api/leveldb/leveldb/include/leveldb/env.h
@@ -13,7 +13,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_ENV_H_
#define STORAGE_LEVELDB_INCLUDE_ENV_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/filter_policy.h b/api/leveldb/leveldb/include/leveldb/filter_policy.h
index 2d970e709d6..e434ef4b241 100644
--- a/api/leveldb/leveldb/include/leveldb/filter_policy.h
+++ b/api/leveldb/leveldb/include/leveldb/filter_policy.h
@@ -16,7 +16,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_
#define STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/iterator.h b/api/leveldb/leveldb/include/leveldb/iterator.h
index 3845d553a4e..2d97d180b17 100644
--- a/api/leveldb/leveldb/include/leveldb/iterator.h
+++ b/api/leveldb/leveldb/include/leveldb/iterator.h
@@ -15,7 +15,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_ITERATOR_H_
#define STORAGE_LEVELDB_INCLUDE_ITERATOR_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/options.h b/api/leveldb/leveldb/include/leveldb/options.h
index a14503fe086..9dcf73fc2a0 100644
--- a/api/leveldb/leveldb/include/leveldb/options.h
+++ b/api/leveldb/leveldb/include/leveldb/options.h
@@ -5,7 +5,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
#define STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/slice.h b/api/leveldb/leveldb/include/leveldb/slice.h
index d7c20cfcaac..1eb66dd825f 100644
--- a/api/leveldb/leveldb/include/leveldb/slice.h
+++ b/api/leveldb/leveldb/include/leveldb/slice.h
@@ -15,7 +15,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_SLICE_H_
#define STORAGE_LEVELDB_INCLUDE_SLICE_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
@@ -82,7 +82,8 @@ class Slice {
(memcmp(data_, x.data_, x.size_) == 0));
}
- private:
+// The LevelDB JNI layer peeks in here
+// private:
const char* data_;
size_t size_;
diff --git a/api/leveldb/leveldb/include/leveldb/status.h b/api/leveldb/leveldb/include/leveldb/status.h
index 8b2cbb9b422..3c21f64462b 100644
--- a/api/leveldb/leveldb/include/leveldb/status.h
+++ b/api/leveldb/leveldb/include/leveldb/status.h
@@ -13,7 +13,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_STATUS_H_
#define STORAGE_LEVELDB_INCLUDE_STATUS_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb/include/leveldb/write_batch.h b/api/leveldb/leveldb/include/leveldb/write_batch.h
index 9184d42c24c..293b41ad818 100644
--- a/api/leveldb/leveldb/include/leveldb/write_batch.h
+++ b/api/leveldb/leveldb/include/leveldb/write_batch.h
@@ -21,7 +21,7 @@
#ifndef STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_
#define STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#if defined(HAVE_ROCKSDB) && !defined(leveldb)
#define leveldb rocksdb
#endif
diff --git a/api/leveldb/leveldb_wt.cc b/api/leveldb/leveldb_wt.cc
index cfeb0549db4..6425a5a8dfd 100644
--- a/api/leveldb/leveldb_wt.cc
+++ b/api/leveldb/leveldb_wt.cc
@@ -755,13 +755,8 @@ IteratorImpl::Next()
int ret;
WT_ITEM item;
- if (!Status().ok())
- return;
-
- if (!valid_) {
- SetError(EINVAL);
+ if (!Status().ok() || !valid_)
return;
- }
ret = cursor_->next(cursor_);
if (ret != 0) {
@@ -791,13 +786,8 @@ IteratorImpl::Prev()
{
WT_ITEM item;
- if (!Status().ok())
- return;
-
- if (!valid_) {
- SetError(EINVAL);
+ if (!Status().ok() || !valid_)
return;
- }
int ret = cursor_->prev(cursor_);
if (ret != 0) {
diff --git a/api/leveldb/leveldb_wt.h b/api/leveldb/leveldb_wt.h
index 301fa250e85..683482ad23c 100644
--- a/api/leveldb/leveldb_wt.h
+++ b/api/leveldb/leveldb_wt.h
@@ -27,7 +27,7 @@
#ifndef _INCLUDE_LEVELDB_WT_H
#define _INCLUDE_LEVELDB_WT_H 1
-#include "wiredtiger_config.h"
+#include "leveldb_wt_config.h"
#include "leveldb/cache.h"
#include "leveldb/comparator.h"
@@ -171,6 +171,7 @@ private:
class CacheImpl : public Cache {
public:
CacheImpl(size_t capacity) : Cache(), capacity_(capacity) {}
+ virtual ~CacheImpl() {}
virtual Handle* Insert(const Slice&, void*, size_t,
void (*)(const Slice&, void*)) { return 0; }