summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/java/wiredtiger.i12
-rw-r--r--test/java/com/wiredtiger/test/AsyncTest.java20
2 files changed, 19 insertions, 13 deletions
diff --git a/lang/java/wiredtiger.i b/lang/java/wiredtiger.i
index 85bc24f5638..bd0abb2e08b 100644
--- a/lang/java/wiredtiger.i
+++ b/lang/java/wiredtiger.i
@@ -262,7 +262,6 @@ WT_CLASS(struct __wt_async_op, WT_ASYNC_OP, op, )
%ignore __wt_cursor::compare(WT_CURSOR *, WT_CURSOR *, int *);
%rename (compare_wrap) __wt_cursor::compare;
%rename (AsyncOpType) WT_ASYNC_OPTYPE;
-%rename (asyncFlush) __wt_connection::async_flush;
%rename (getKeyFormat) __wt_async_op::getKey_format;
%rename (getValueFormat) __wt_async_op::getValue_format;
%rename (getType) __wt_async_op::get_type;
@@ -396,7 +395,7 @@ javaAsyncHandler(WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP *asyncop, int opret,
/*
* We rely on the fact that the async machinery uses a pool of
* threads. Here we attach the current native (POSIX)
- * thread.to a Java thread and never detach it. If the native
+ * thread to a Java thread and never detach it. If the native
* thread was previously seen by this callback, it will be
* attached to the same Java thread as before without
* incurring the cost of the thread initialization.
@@ -1618,6 +1617,13 @@ WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
%rename(open) wiredtiger_open_wrap;
%ignore __wt_connection::async_new_op;
+%javamethodmodifiers __wt_connection::async_new_op_wrap "
+ /**
+ * @copydoc WT_CONNECTION::async_new_op
+ */
+ public ";
+%rename(async_new_op) __wt_connection::async_new_op_wrap;
+
%ignore __wt_connection::open_session;
%rename(open_session) __wt_connection::open_session_wrap;
%ignore __wt_session::open_cursor;
@@ -1696,7 +1702,7 @@ err: if (ret != 0)
}
%extend __wt_connection {
- WT_ASYNC_OP *asyncNewOp(JNIEnv *jenv, const char *uri,
+ WT_ASYNC_OP *async_new_op_wrap(JNIEnv *jenv, const char *uri,
const char *config, jobject callbackObject) {
extern WT_ASYNC_CALLBACK javaApiAsyncHandler;
WT_ASYNC_OP *asyncop = NULL;
diff --git a/test/java/com/wiredtiger/test/AsyncTest.java b/test/java/com/wiredtiger/test/AsyncTest.java
index 6bf4bfc53d1..589f7923a0b 100644
--- a/test/java/com/wiredtiger/test/AsyncTest.java
+++ b/test/java/com/wiredtiger/test/AsyncTest.java
@@ -287,14 +287,14 @@ public class AsyncTest {
Session s = sessionSetup(name, keyFormat, valueFormat,
opsMax, asyncThreads);
- for (int i=0; i<entries; i++) {
+ for (int i = 0; i < entries; i++) {
// adapter call does equivalent of:
// current.put(genkey(s, i), genvalue(s, i));
adapter.putref(s, current, i);
}
- for (int i=0; i<entries; i++) {
- AsyncOp op = conn.asyncNewOp("table:" + name, null, callback);
+ for (int i = 0; i < entries; i++) {
+ AsyncOp op = conn.async_new_op("table:" + name, null, callback);
// adapter call does equivalent of:
// op.putKeyString(genkey(s, i));
@@ -308,17 +308,17 @@ public class AsyncTest {
// to run before we fill them up.
// In a real application, we might catch
// 'Cannot allocate memory' exceptions from
- // the asyncNewOp call, and use that as
+ // the async_new_op call, and use that as
// an indicator to throttle back.
- if ((i+1) % opsBatch == 0)
+ if ((i + 1) % opsBatch == 0)
sleepMillis(milliSleep);
}
// Wait for all outstanding async ops to finish.
- conn.asyncFlush();
+ conn.async_flush();
- for (int i=0; i<entries; i++) {
- AsyncOp op = conn.asyncNewOp("table:" + name, null, callback);
+ for (int i = 0; i < entries; i++) {
+ AsyncOp op = conn.async_new_op("table:" + name, null, callback);
// adapter call does equivalent of:
// op.putKeyString(genkey(s, i));
@@ -326,12 +326,12 @@ public class AsyncTest {
adapter.putkv(s, op, i);
op.search();
- if ((i+1) % opsBatch == 0)
+ if ((i + 1) % opsBatch == 0)
sleepMillis(milliSleep);
}
// Wait for all outstanding async ops to finish.
- conn.asyncFlush();
+ conn.async_flush();
s.close("");