|
|
@ -217,6 +217,7 @@ class HistogramDataJni { |
|
|
|
return mid; |
|
|
|
return mid; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class BackupableDBOptionsJni { |
|
|
|
class BackupableDBOptionsJni { |
|
|
|
public: |
|
|
|
public: |
|
|
|
// Get the java class id of org.rocksdb.BackupableDBOptions.
|
|
|
|
// Get the java class id of org.rocksdb.BackupableDBOptions.
|
|
|
@ -250,6 +251,72 @@ class BackupableDBOptionsJni { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RestoreOptionsJni { |
|
|
|
|
|
|
|
public: |
|
|
|
|
|
|
|
// Get the java class id of org.rocksdb.RestoreOptions.
|
|
|
|
|
|
|
|
static jclass getJClass(JNIEnv* env) { |
|
|
|
|
|
|
|
static jclass jclazz = env->FindClass("org/rocksdb/RestoreOptions"); |
|
|
|
|
|
|
|
assert(jclazz != nullptr); |
|
|
|
|
|
|
|
return jclazz; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the field id of the member variable of org.rocksdb.RestoreOptions
|
|
|
|
|
|
|
|
// that stores the pointer to rocksdb::RestoreOptions
|
|
|
|
|
|
|
|
static jfieldID getHandleFieldID(JNIEnv* env) { |
|
|
|
|
|
|
|
static jfieldID fid = env->GetFieldID( |
|
|
|
|
|
|
|
getJClass(env), "nativeHandle_", "J"); |
|
|
|
|
|
|
|
assert(fid != nullptr); |
|
|
|
|
|
|
|
return fid; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the pointer to rocksdb::RestoreOptions
|
|
|
|
|
|
|
|
static rocksdb::RestoreOptions* getHandle(JNIEnv* env, jobject jobj) { |
|
|
|
|
|
|
|
return reinterpret_cast<rocksdb::RestoreOptions*>( |
|
|
|
|
|
|
|
env->GetLongField(jobj, getHandleFieldID(env))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Pass the rocksdb::RestoreOptions pointer to the java side.
|
|
|
|
|
|
|
|
static void setHandle( |
|
|
|
|
|
|
|
JNIEnv* env, jobject jobj, rocksdb::RestoreOptions* op) { |
|
|
|
|
|
|
|
env->SetLongField( |
|
|
|
|
|
|
|
jobj, getHandleFieldID(env), |
|
|
|
|
|
|
|
reinterpret_cast<jlong>(op)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RestoreBackupableDBJni { |
|
|
|
|
|
|
|
public: |
|
|
|
|
|
|
|
// Get the java class id of org.rocksdb.RestoreBackupableDB.
|
|
|
|
|
|
|
|
static jclass getJClass(JNIEnv* env) { |
|
|
|
|
|
|
|
static jclass jclazz = env->FindClass("org/rocksdb/RestoreBackupableDB"); |
|
|
|
|
|
|
|
assert(jclazz != nullptr); |
|
|
|
|
|
|
|
return jclazz; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the field id of the member variable of org.rocksdb.RestoreBackupableDB
|
|
|
|
|
|
|
|
// that stores the pointer to rocksdb::RestoreBackupableDB
|
|
|
|
|
|
|
|
static jfieldID getHandleFieldID(JNIEnv* env) { |
|
|
|
|
|
|
|
static jfieldID fid = env->GetFieldID( |
|
|
|
|
|
|
|
getJClass(env), "nativeHandle_", "J"); |
|
|
|
|
|
|
|
assert(fid != nullptr); |
|
|
|
|
|
|
|
return fid; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get the pointer to rocksdb::RestoreBackupableDB
|
|
|
|
|
|
|
|
static rocksdb::RestoreBackupableDB* getHandle(JNIEnv* env, jobject jobj) { |
|
|
|
|
|
|
|
return reinterpret_cast<rocksdb::RestoreBackupableDB*>( |
|
|
|
|
|
|
|
env->GetLongField(jobj, getHandleFieldID(env))); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Pass the rocksdb::RestoreBackupableDB pointer to the java side.
|
|
|
|
|
|
|
|
static void setHandle( |
|
|
|
|
|
|
|
JNIEnv* env, jobject jobj, rocksdb::RestoreBackupableDB* op) { |
|
|
|
|
|
|
|
env->SetLongField( |
|
|
|
|
|
|
|
jobj, getHandleFieldID(env), |
|
|
|
|
|
|
|
reinterpret_cast<jlong>(op)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class IteratorJni { |
|
|
|
class IteratorJni { |
|
|
|
public: |
|
|
|
public: |
|
|
|
// Get the java class id of org.rocksdb.Iteartor.
|
|
|
|
// Get the java class id of org.rocksdb.Iteartor.
|
|
|
|