diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-02-17 17:25:57 +0000 |
---|---|---|
committer | <> | 2015-03-17 16:26:24 +0000 |
commit | 780b92ada9afcf1d58085a83a0b9e6bc982203d1 (patch) | |
tree | 598f8b9fa431b228d29897e798de4ac0c1d3d970 /lang/java/libdb_java/java_callbacks.i | |
parent | 7a2660ba9cc2dc03a69ddfcfd95369395cc87444 (diff) | |
download | berkeleydb-master.tar.gz |
Diffstat (limited to 'lang/java/libdb_java/java_callbacks.i')
-rw-r--r-- | lang/java/libdb_java/java_callbacks.i | 65 |
1 files changed, 59 insertions, 6 deletions
diff --git a/lang/java/libdb_java/java_callbacks.i b/lang/java/libdb_java/java_callbacks.i index 6c3805dc..cee83795 100644 --- a/lang/java/libdb_java/java_callbacks.i +++ b/lang/java/libdb_java/java_callbacks.i @@ -174,6 +174,10 @@ static void __dbj_event_notify(DB_ENV *dbenv, u_int32_t event_id, void * info) (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class, panic_event_notify_method); break; + case DB_EVENT_REP_AUTOTAKEOVER_FAILED: + (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, + dbenv_class, rep_autotakeover_failed_event_notify_method); + break; case DB_EVENT_REP_CLIENT: (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class, rep_client_event_notify_method); @@ -206,6 +210,10 @@ static void __dbj_event_notify(DB_ENV *dbenv, u_int32_t event_id, void * info) (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class, rep_init_done_event_notify_method); break; + case DB_EVENT_REP_INQUEUE_FULL: + (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, + dbenv_class, rep_inqueue_full_event_notify_method); + break; case DB_EVENT_REP_JOIN_FAILURE: (*jenv)->CallNonvirtualVoidMethod(jenv, jdbenv, dbenv_class, rep_join_failure_event_notify_method); @@ -646,8 +654,11 @@ err: if (dbt1->app_data == NULL) return (ret); } -static int __dbj_bt_compare(DB *db, const DBT *dbt1, const DBT *dbt2) +static int __dbj_bt_compare(DB *db, + const DBT *dbt1, const DBT *dbt2, size_t *locp) { + if (locp != NULL) + locp = NULL; return __dbj_am_compare(db, dbt1, dbt2, bt_compare_method); } @@ -853,7 +864,8 @@ err: if (dbt1->app_data == NULL) { return (ret); } -static int __dbj_dup_compare(DB *db, const DBT *dbt1, const DBT *dbt2) +static int __dbj_dup_compare(DB *db, + const DBT *dbt1, const DBT *dbt2, size_t *locp) { int detach; JNIEnv *jenv = __dbj_get_jnienv(&detach); @@ -861,6 +873,8 @@ static int __dbj_dup_compare(DB *db, const DBT *dbt1, const DBT *dbt2) jbyteArray jdbtarr1, jdbtarr2; int ret; + if (locp != NULL) + locp = NULL; if (jdb == NULL) return (EINVAL); @@ -906,8 +920,11 @@ static void __dbj_db_feedback(DB *db, int opcode, int percent) __dbj_detach(); } -static int __dbj_h_compare(DB *db, const DBT *dbt1, const DBT *dbt2) +static int __dbj_h_compare(DB *db, + const DBT *dbt1, const DBT *dbt2, size_t *locp) { + if (locp != NULL) + locp = NULL; return __dbj_am_compare(db, dbt1, dbt2, h_compare_method); } @@ -1051,6 +1068,40 @@ err: if (detach) __dbj_detach(); return (ret); } + +static int __dbj_rep_view(DB_ENV *dbenv, const char *name, int *result, u_int32_t flags) { + int detach; + JNIEnv *jenv = __dbj_get_jnienv(&detach); + jobject jdbenv = (jobject)DB_ENV_INTERNAL(dbenv); + jobject jname; + jboolean jresult; + int ret; + + if (jdbenv == NULL) { + ret = EINVAL; + goto err; + } + + jname = (*jenv)->NewStringUTF(jenv, name); + + jresult = (*jenv)->CallNonvirtualBooleanMethod(jenv, jdbenv, dbenv_class, rep_view_method, jname, flags); + + if ((*jenv)->ExceptionOccurred(jenv)) { + /* The exception will be thrown, so this could be any error. */ + ret = EINVAL; + goto err; + } + + ret = 0; + if (jresult == JNI_FALSE) + *result = 0; + else + *result = 1; + +err: if (detach) + __dbj_detach(); + return (ret); +} %} JAVA_CALLBACK(int (*backup_close_fcn)(DB_ENV *, @@ -1098,7 +1149,7 @@ JAVA_CALLBACK(int (*callback)(DB *, const DBT *, DBT *, const DBT *, int *), JAVA_CALLBACK(int (*db_append_recno_fcn)(DB *, DBT *, db_recno_t), com.sleepycat.db.RecordNumberAppender, append_recno) -JAVA_CALLBACK(int (*bt_compare_fcn)(DB *, const DBT *, const DBT *), +JAVA_CALLBACK(int (*bt_compare_fcn)(DB *, const DBT *, const DBT *, size_t *), java.util.Comparator, bt_compare) JAVA_CALLBACK(int (*bt_compress_fcn)(DB *, const DBT *, const DBT *, const DBT *, const DBT *, DBT *), @@ -1109,11 +1160,13 @@ JAVA_CALLBACK(u_int32_t (*db_partition_fcn)(DB *, DBT *), com.sleepycat.db.PartitionHandler, partition) JAVA_CALLBACK(size_t (*bt_prefix_fcn)(DB *, const DBT *, const DBT *), com.sleepycat.db.BtreePrefixCalculator, bt_prefix) -JAVA_CALLBACK(int (*dup_compare_fcn)(DB *, const DBT *, const DBT *), +JAVA_CALLBACK(int (*dup_compare_fcn)(DB *, const DBT *, const DBT *, size_t *), java.util.Comparator, dup_compare) JAVA_CALLBACK(void (*db_feedback_fcn)(DB *, int, int), com.sleepycat.db.FeedbackHandler, db_feedback) -JAVA_CALLBACK(int (*h_compare_fcn)(DB *, const DBT *, const DBT *), +JAVA_CALLBACK(int (*h_compare_fcn)(DB *, const DBT *, const DBT *, size_t *), java.util.Comparator, h_compare) JAVA_CALLBACK(u_int32_t (*h_hash_fcn)(DB *, const void *, u_int32_t), com.sleepycat.db.Hasher, h_hash) +JAVA_CALLBACK(int (*rep_view_fcn)(DB_ENV *, const char *, int *, u_int32_t), + com.sleepycat.db.ReplicationViewHandler, rep_view); |