summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/lang/java/wiredtiger.i
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/lang/java/wiredtiger.i')
-rw-r--r--src/third_party/wiredtiger/lang/java/wiredtiger.i781
1 files changed, 1 insertions, 780 deletions
diff --git a/src/third_party/wiredtiger/lang/java/wiredtiger.i b/src/third_party/wiredtiger/lang/java/wiredtiger.i
index e544951909e..1e6c1770b89 100644
--- a/src/third_party/wiredtiger/lang/java/wiredtiger.i
+++ b/src/third_party/wiredtiger/lang/java/wiredtiger.i
@@ -78,17 +78,11 @@
* swigCPtr is 0.
*/
typedef struct {
- JavaVM *javavm; /* Used in async threads to craft a jnienv */
JNIEnv *jnienv; /* jni env that created the Session/Cursor */
WT_SESSION_IMPL *session; /* session used for alloc/free */
bool cursor_raw; /* is the cursor opened raw? */
- jobject jobj; /* the java Session/Cursor/AsyncOp object */
- jobject jcallback; /* callback object for async ops */
+ jobject jobj; /* the java Session/Cursor object */
jfieldID cptr_fid; /* cached Cursor.swigCPtr field id in session */
- jfieldID asynccptr_fid; /* cached AsyncOp.swigCptr fid in conn */
- jfieldID kunp_fid; /* cached AsyncOp.keyUnpacker fid in conn */
- jfieldID vunp_fid; /* cached AsyncOp.valueUnpacker fid in conn */
- jmethodID notify_mid; /* cached AsyncCallback.notify mid in conn */
} JAVA_CALLBACK;
static void throwWiredTigerException(JNIEnv *jenv, int err) {
@@ -306,7 +300,6 @@ WT_CLASS_WITH_CLOSE_HANDLER(struct __wt_session, WT_SESSION, session,
closeHandler, $1, ((WT_SESSION_IMPL *)$1)->lang_private)
WT_CLASS_WITH_CLOSE_HANDLER(struct __wt_cursor, WT_CURSOR, cursor,
cursorCloseHandler, $1->session, ((WT_CURSOR *)$1)->lang_private)
-WT_CLASS(struct __wt_async_op, WT_ASYNC_OP, op)
%define COPYDOC(SIGNATURE_CLASS, CLASS, METHOD)
%javamethodmodifiers SIGNATURE_CLASS::METHOD "
@@ -318,23 +311,6 @@ WT_CLASS(struct __wt_async_op, WT_ASYNC_OP, op)
%include "java_doc.i"
-/* WT_ASYNC_OP customization. */
-/* First, replace the varargs get / set methods with Java equivalents. */
-%ignore __wt_async_op::get_key;
-%ignore __wt_async_op::get_value;
-%ignore __wt_async_op::set_key;
-%ignore __wt_async_op::set_value;
-%ignore __wt_async_op::insert;
-%ignore __wt_async_op::remove;
-%ignore __wt_async_op::search;
-%ignore __wt_async_op::update;
-%immutable __wt_async_op::connection;
-%immutable __wt_async_op::key_format;
-%immutable __wt_async_op::value_format;
-
-%javamethodmodifiers __wt_async_op::key_format "protected";
-%javamethodmodifiers __wt_async_op::value_format "protected";
-
/* WT_CURSOR customization. */
/* First, replace the varargs get / set methods with Java equivalents. */
%ignore __wt_cursor::get_key;
@@ -363,10 +339,6 @@ WT_CLASS(struct __wt_async_op, WT_ASYNC_OP, op)
%rename (compare_wrap) __wt_cursor::compare;
%ignore __wt_cursor::equals(WT_CURSOR *, WT_CURSOR *, int *);
%rename (equals_wrap) __wt_cursor::equals;
-%rename (AsyncOpType) WT_ASYNC_OPTYPE;
-%rename (getKeyFormat) __wt_async_op::getKey_format;
-%rename (getValueFormat) __wt_async_op::getValue_format;
-%rename (getType) __wt_async_op::get_type;
/*
* Special cases: override the out typemap, return checking is done in the
@@ -471,710 +443,6 @@ javaCloseHandler(WT_EVENT_HANDLER *handler, WT_SESSION *session,
}
WT_EVENT_HANDLER javaApiEventHandler = {NULL, NULL, NULL, javaCloseHandler};
-
-static int
-javaAsyncHandler(WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP *asyncop, int opret,
- uint32_t flags)
-{
- int ret, envret;
- JAVA_CALLBACK *jcb, *conn_jcb;
- JavaVM *javavm;
- jclass cls;
- jfieldID fid;
- jmethodID mid;
- jobject jcallback;
- JNIEnv *jenv;
- WT_ASYNC_OP_IMPL *op;
- WT_SESSION_IMPL *session;
-
- WT_UNUSED(cb);
- WT_UNUSED(flags);
- op = (WT_ASYNC_OP_IMPL *)asyncop;
- session = O2S(op);
- jcb = (JAVA_CALLBACK *)asyncop->c.lang_private;
- conn_jcb = (JAVA_CALLBACK *)S2C(session)->lang_private;
- asyncop->c.lang_private = NULL;
- jcallback = jcb->jcallback;
-
- /*
- * 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 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.
- * Marking the Java thread as a daemon means its existence
- * won't keep an application from exiting.
- */
- javavm = jcb->javavm;
- envret = (*javavm)->GetEnv(javavm, (void **)&jenv, JNI_VERSION_1_6);
- if (envret == JNI_EDETACHED) {
- if ((*javavm)->AttachCurrentThreadAsDaemon(javavm,
- (void **)&jenv, NULL) != 0) {
- ret = EBUSY;
- goto err;
- }
- } else if (envret != JNI_OK) {
- ret = EBUSY;
- goto err;
- }
-
- /*
- * Look up any needed field and method ids, and cache them
- * in the connection's lang_private. fid and mids are
- * stable.
- */
- if (conn_jcb->notify_mid == NULL) {
- /* Any JNI error until the actual callback is unexpected. */
- ret = EINVAL;
-
- cls = (*jenv)->GetObjectClass(jenv, jcb->jobj);
- if (cls == NULL)
- goto err;
- fid = (*jenv)->GetFieldID(jenv, cls,
- "keyUnpacker", "Lcom/wiredtiger/db/PackInputStream;");
- if (fid == NULL)
- goto err;
- conn_jcb->kunp_fid = fid;
-
- fid = (*jenv)->GetFieldID(jenv, cls,
- "valueUnpacker", "Lcom/wiredtiger/db/PackInputStream;");
- if (fid == NULL)
- goto err;
- conn_jcb->vunp_fid = fid;
-
- cls = (*jenv)->GetObjectClass(jenv, jcallback);
- if (cls == NULL)
- goto err;
- mid = (*jenv)->GetMethodID(jenv, cls, "notify",
- "(Lcom/wiredtiger/db/AsyncOp;II)I");
- if (mid == NULL)
- goto err;
- conn_jcb->notify_mid = mid;
- }
-
- /*
- * Invalidate the unpackers so any calls to op.getKey()
- * and op.getValue get fresh results.
- */
- (*jenv)->SetObjectField(jenv, jcb->jobj, conn_jcb->kunp_fid, NULL);
- (*jenv)->SetObjectField(jenv, jcb->jobj, conn_jcb->vunp_fid, NULL);
-
- /* Call the registered callback. */
- ret = (*jenv)->CallIntMethod(jenv, jcallback, conn_jcb->notify_mid,
- jcb->jobj, opret, flags);
-
- if ((*jenv)->ExceptionOccurred(jenv)) {
- (*jenv)->ExceptionDescribe(jenv);
- (*jenv)->ExceptionClear(jenv);
- }
- if (0) {
-err: __wt_err(session, ret, "Java async callback error");
- }
-
- /* Invalidate the AsyncOp, further use throws NullPointerException. */
- ret = javaClose(jenv, NULL, jcb, &conn_jcb->asynccptr_fid);
-
- (*jenv)->DeleteGlobalRef(jenv, jcallback);
-
- if (ret == 0 && (opret == 0 || opret == WT_NOTFOUND))
- return (0);
- else
- return (1);
-}
-
-WT_ASYNC_CALLBACK javaApiAsyncHandler = {javaAsyncHandler};
-%}
-
-%extend __wt_async_op {
- %javamethodmodifiers get_key_wrap "protected";
- WT_ITEM get_key_wrap(JNIEnv *jenv) {
- WT_ITEM k;
- int ret;
- k.data = NULL;
- if ((ret = $self->get_key($self, &k)) != 0)
- throwWiredTigerException(jenv, ret);
- return (k);
- }
-
- %javamethodmodifiers get_value_wrap "protected";
- WT_ITEM get_value_wrap(JNIEnv *jenv) {
- WT_ITEM v;
- int ret;
- v.data = NULL;
- if ((ret = $self->get_value($self, &v)) != 0)
- throwWiredTigerException(jenv, ret);
- return (v);
- }
-
- %javamethodmodifiers insert_wrap "protected";
- int insert_wrap(WT_ITEM *k, WT_ITEM *v) {
- $self->set_key($self, k);
- $self->set_value($self, v);
- return ($self->insert($self));
- }
-
- %javamethodmodifiers remove_wrap "protected";
- int remove_wrap(WT_ITEM *k) {
- $self->set_key($self, k);
- return ($self->remove($self));
- }
-
- %javamethodmodifiers search_wrap "protected";
- int search_wrap(WT_ITEM *k) {
- $self->set_key($self, k);
- return ($self->search($self));
- }
-
- %javamethodmodifiers update_wrap "protected";
- int update_wrap(WT_ITEM *k, WT_ITEM *v) {
- $self->set_key($self, k);
- $self->set_value($self, v);
- return ($self->update($self));
- }
-
- %javamethodmodifiers _java_raw "protected";
- bool _java_raw(JNIEnv *jenv) {
- (void)jenv;
- JAVA_CALLBACK *jcb = (JAVA_CALLBACK *)$self->c.lang_private;
- return (jcb->cursor_raw);
- }
-
- %javamethodmodifiers _java_init "protected";
- int _java_init(jobject jasyncop) {
- JAVA_CALLBACK *jcb =
- (JAVA_CALLBACK *)$self->c.lang_private;
- jcb->jobj = JCALL1(NewGlobalRef, jcb->jnienv, jasyncop);
- JCALL1(DeleteLocalRef, jcb->jnienv, jasyncop);
- return (0);
- }
-}
-
-/* Cache key/value formats in Async_op */
-%typemap(javabody) struct __wt_async_op %{
- private long swigCPtr;
- protected boolean swigCMemOwn;
- protected boolean javaRaw;
- protected String keyFormat;
- protected String valueFormat;
- protected PackOutputStream keyPacker;
- protected PackOutputStream valuePacker;
- protected PackInputStream keyUnpacker;
- protected PackInputStream valueUnpacker;
-
- protected $javaclassname(long cPtr, boolean cMemoryOwn) {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = cPtr;
- keyFormat = getKey_format();
- valueFormat = getValue_format();
- javaRaw = _java_raw();
- keyPacker = new PackOutputStream(keyFormat, javaRaw);
- valuePacker = new PackOutputStream(valueFormat, javaRaw);
- wiredtigerJNI.AsyncOp__java_init(swigCPtr, this, this);
- }
-
- protected static long getCPtr($javaclassname obj) {
- return ((obj == null) ? 0 : obj.swigCPtr);
- }
-%}
-
-%typemap(javacode) struct __wt_async_op %{
-
- /**
- * Retrieve the format string for this async_op's key.
- */
- public String getKeyFormat() {
- return keyFormat;
- }
-
- /**
- * Retrieve the format string for this async_op's value.
- */
- public String getValueFormat() {
- return valueFormat;
- }
-
- /**
- * Append a byte to the async_op's key.
- *
- * \param value The value to append.
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyByte(byte value)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addByte(value);
- return this;
- }
-
- /**
- * Append a byte array to the async_op's key.
- *
- * \param value The value to append.
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyByteArray(byte[] value)
- throws WiredTigerPackingException {
- this.putKeyByteArray(value, 0, value.length);
- return this;
- }
-
- /**
- * Append a byte array to the async_op's key.
- *
- * \param value The value to append.
- * \param off The offset into value at which to start.
- * \param len The length of the byte array.
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyByteArray(byte[] value, int off, int len)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addByteArray(value, off, len);
- return this;
- }
-
- /**
- * Append an integer to the async_op's key.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyInt(int value)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addInt(value);
- return this;
- }
-
- /**
- * Append a long to the async_op's key.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyLong(long value)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addLong(value);
- return this;
- }
-
- /**
- * Append a record number to the async_op's key.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyRecord(long value)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addRecord(value);
- return this;
- }
-
- /**
- * Append a short integer to the async_op's key.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyShort(short value)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addShort(value);
- return this;
- }
-
- /**
- * Append a string to the async_op's key.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putKeyString(String value)
- throws WiredTigerPackingException {
- keyUnpacker = null;
- keyPacker.addString(value);
- return this;
- }
-
- /**
- * Append a byte to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueByte(byte value)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addByte(value);
- return this;
- }
-
- /**
- * Append a byte array to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueByteArray(byte[] value)
- throws WiredTigerPackingException {
- this.putValueByteArray(value, 0, value.length);
- return this;
- }
-
- /**
- * Append a byte array to the async_op's value.
- *
- * \param value The value to append
- * \param off The offset into value at which to start.
- * \param len The length of the byte array.
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueByteArray(byte[] value, int off, int len)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addByteArray(value, off, len);
- return this;
- }
-
- /**
- * Append an integer to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueInt(int value)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addInt(value);
- return this;
- }
-
- /**
- * Append a long to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueLong(long value)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addLong(value);
- return this;
- }
-
- /**
- * Append a record number to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueRecord(long value)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addRecord(value);
- return this;
- }
-
- /**
- * Append a short integer to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueShort(short value)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addShort(value);
- return this;
- }
-
- /**
- * Append a string to the async_op's value.
- *
- * \param value The value to append
- * \return This async_op object, so put calls can be chained.
- */
- public AsyncOp putValueString(String value)
- throws WiredTigerPackingException {
- valueUnpacker = null;
- valuePacker.addString(value);
- return this;
- }
-
- /**
- * Retrieve a byte from the async_op's key.
- *
- * \return The requested value.
- */
- public byte getKeyByte()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getByte();
- }
-
- /**
- * Retrieve a byte array from the async_op's key.
- *
- * \param output The byte array where the returned value will be stored.
- * The array should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getKeyByteArray(byte[] output)
- throws WiredTigerPackingException {
- this.getKeyByteArray(output, 0, output.length);
- }
-
- /**
- * Retrieve a byte array from the async_op's key.
- *
- * \param output The byte array where the returned value will be stored.
- * \param off Offset into the destination buffer to start copying into.
- * \param len The length should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getKeyByteArray(byte[] output, int off, int len)
- throws WiredTigerPackingException {
- getKeyUnpacker().getByteArray(output, off, len);
- }
-
- /**
- * Retrieve a byte array from the async_op's key.
- *
- * \return The requested value.
- */
- public byte[] getKeyByteArray()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getByteArray();
- }
-
- /**
- * Retrieve an integer from the async_op's key.
- *
- * \return The requested value.
- */
- public int getKeyInt()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getInt();
- }
-
- /**
- * Retrieve a long from the async_op's key.
- *
- * \return The requested value.
- */
- public long getKeyLong()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getLong();
- }
-
- /**
- * Retrieve a record number from the async_op's key.
- *
- * \return The requested value.
- */
- public long getKeyRecord()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getRecord();
- }
-
- /**
- * Retrieve a short integer from the async_op's key.
- *
- * \return The requested value.
- */
- public short getKeyShort()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getShort();
- }
-
- /**
- * Retrieve a string from the async_op's key.
- *
- * \return The requested value.
- */
- public String getKeyString()
- throws WiredTigerPackingException {
- return getKeyUnpacker().getString();
- }
-
- /**
- * Retrieve a byte from the async_op's value.
- *
- * \return The requested value.
- */
- public byte getValueByte()
- throws WiredTigerPackingException {
- return getValueUnpacker().getByte();
- }
-
- /**
- * Retrieve a byte array from the async_op's value.
- *
- * \param output The byte array where the returned value will be stored.
- * The array should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getValueByteArray(byte[] output)
- throws WiredTigerPackingException {
- this.getValueByteArray(output, 0, output.length);
- }
-
- /**
- * Retrieve a byte array from the async_op's value.
- *
- * \param output The byte array where the returned value will be stored.
- * \param off Offset into the destination buffer to start copying into.
- * \param len The length should be large enough to store the entire
- * data item, if not a truncated value will be returned.
- */
- public void getValueByteArray(byte[] output, int off, int len)
- throws WiredTigerPackingException {
- getValueUnpacker().getByteArray(output, off, len);
- }
-
- /**
- * Retrieve a byte array from the async_op's value.
- *
- * \return The requested value.
- */
- public byte[] getValueByteArray()
- throws WiredTigerPackingException {
- return getValueUnpacker().getByteArray();
- }
-
- /**
- * Retrieve an integer from the async_op's value.
- *
- * \return The requested value.
- */
- public int getValueInt()
- throws WiredTigerPackingException {
- return getValueUnpacker().getInt();
- }
-
- /**
- * Retrieve a long from the async_op's value.
- *
- * \return The requested value.
- */
- public long getValueLong()
- throws WiredTigerPackingException {
- return getValueUnpacker().getLong();
- }
-
- /**
- * Retrieve a record number from the async_op's value.
- *
- * \return The requested value.
- */
- public long getValueRecord()
- throws WiredTigerPackingException {
- return getValueUnpacker().getRecord();
- }
-
- /**
- * Retrieve a short integer from the async_op's value.
- *
- * \return The requested value.
- */
- public short getValueShort()
- throws WiredTigerPackingException {
- return getValueUnpacker().getShort();
- }
-
- /**
- * Retrieve a string from the async_op's value.
- *
- * \return The requested value.
- */
- public String getValueString()
- throws WiredTigerPackingException {
- return getValueUnpacker().getString();
- }
-
- /**
- * Insert the async_op's current key/value into the table.
- *
- * \return The status of the operation.
- */
- public int insert()
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- byte[] value = valuePacker.getValue();
- keyPacker.reset();
- valuePacker.reset();
- return insert_wrap(key, value);
- }
-
- /**
- * Update the async_op's current key/value into the table.
- *
- * \return The status of the operation.
- */
- public int update()
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- byte[] value = valuePacker.getValue();
- keyPacker.reset();
- valuePacker.reset();
- return update_wrap(key, value);
- }
-
- /**
- * Remove the async_op's current key/value into the table.
- *
- * \return The status of the operation.
- */
- public int remove()
- throws WiredTigerException {
- byte[] key = keyPacker.getValue();
- keyPacker.reset();
- return remove_wrap(key);
- }
-
- /**
- * Search for an item in the table.
- *
- * \return The result of the comparison.
- */
- public int search()
- throws WiredTigerException {
- int ret = search_wrap(keyPacker.getValue());
- keyPacker.reset();
- valuePacker.reset();
- return ret;
- }
-
- /**
- * Set up the key unpacker or return previously cached value.
- *
- * \return The key unpacker.
- */
- private PackInputStream getKeyUnpacker()
- throws WiredTigerPackingException {
- if (keyUnpacker == null)
- keyUnpacker =
- new PackInputStream(keyFormat, get_key_wrap(),
- javaRaw);
- return keyUnpacker;
- }
-
- /**
- * Set up the value unpacker or return previously cached value.
- *
- * \return The value unpacker.
- */
- private PackInputStream getValueUnpacker()
- throws WiredTigerPackingException {
- if (valueUnpacker == null)
- valueUnpacker =
- new PackInputStream(valueFormat, get_value_wrap(),
- javaRaw);
- return valueUnpacker;
- }
-
%}
%extend __wt_cursor {
@@ -2061,12 +1329,6 @@ static void modify_impl_release(WT_MODIFY_IMPL *impl) {
*/
%javaexception("com.wiredtiger.db.WiredTigerException") { $action; }
%javaexception("") wiredtiger_strerror { $action; }
-%javaexception("") __wt_async_op::_java_raw { $action; }
-%javaexception("") __wt_async_op::connection { $action; }
-%javaexception("") __wt_async_op::get_type { $action; }
-%javaexception("") __wt_async_op::get_id { $action; }
-%javaexception("") __wt_async_op::key_format { $action; }
-%javaexception("") __wt_async_op::value_format { $action; }
%javaexception("") __wt_connection::_java_init { $action; }
%javaexception("") __wt_connection::get_home { $action; }
%javaexception("") __wt_connection::is_new { $action; }
@@ -2124,16 +1386,12 @@ static void modify_impl_release(WT_MODIFY_IMPL *impl) {
%enddef
REQUIRE_WRAP(::wiredtiger_open, wiredtiger_open, open)
-REQUIRE_WRAP(WT_CONNECTION::async_new_op,
- __wt_connection::async_new_op, async_new_op)
REQUIRE_WRAP(WT_CONNECTION::open_session,
__wt_connection::open_session, open_session)
REQUIRE_WRAP(WT_SESSION::transaction_pinned_range,
__wt_session::transaction_pinned_range, transaction_pinned_range)
REQUIRE_WRAP(WT_SESSION::open_cursor, __wt_session::open_cursor, open_cursor)
-REQUIRE_WRAP(WT_ASYNC_OP::get_id, __wt_async_op::get_id,getId)
-%rename(AsyncOp) __wt_async_op;
%rename(Cursor) __wt_cursor;
%rename(Modify) __wt_modify;
%rename(Session) __wt_session;
@@ -2202,36 +1460,6 @@ err: if (ret != 0)
}
%extend __wt_connection {
- 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;
- WT_CONNECTION_IMPL *connimpl;
- JAVA_CALLBACK *jcb;
- int ret;
-
- if ((ret = $self->async_new_op($self, uri, config, &javaApiAsyncHandler, &asyncop)) != 0)
- goto err;
-
- connimpl = (WT_CONNECTION_IMPL *)$self;
- if ((ret = __wt_calloc_def(connimpl->default_session, 1, &jcb)) != 0)
- goto err;
-
- jcb->jnienv = jenv;
- jcb->session = connimpl->default_session;
- (*jenv)->GetJavaVM(jenv, &jcb->javavm);
- jcb->jcallback = JCALL1(NewGlobalRef, jenv, callbackObject);
- JCALL1(DeleteLocalRef, jenv, callbackObject);
- asyncop->c.lang_private = jcb;
- asyncop->c.flags |= WT_CURSTD_RAW;
-
-err: if (ret != 0)
- throwWiredTigerException(jenv, ret);
- return (asyncop);
- }
-}
-
-%extend __wt_connection {
WT_SESSION *open_session_wrap(JNIEnv *jenv, const char *config) {
extern WT_EVENT_HANDLER javaApiEventHandler;
WT_SESSION *session = NULL;
@@ -2282,13 +1510,6 @@ err: if (ret != 0)
}
}
-%extend __wt_async_op {
- long get_id_wrap(JNIEnv *jenv) {
- WT_UNUSED(jenv);
- return ((long)self->get_id(self));
- }
-}
-
%extend __wt_session {
long transaction_pinned_range_wrap(JNIEnv *jenv) {
int ret;