[RocksJava] Integrated changes from D31449

This commit is contained in:
fyrz 2015-01-17 23:28:54 +01:00
parent 859c54a03d
commit e828567541
2 changed files with 11 additions and 9 deletions

View File

@ -117,8 +117,9 @@ public class TtlDB extends RocksDB {
"family handle.");
}
TtlDB ttlDB = new TtlDB();
List<Long> cfReferences = ttlDB.open(options.nativeHandle_, db_path, columnFamilyDescriptors,
columnFamilyDescriptors.size(), ttlValues, readOnly);
List<Long> cfReferences = ttlDB.openCF(options.nativeHandle_, db_path,
columnFamilyDescriptors, columnFamilyDescriptors.size(),
ttlValues, readOnly);
for (int i=0; i<columnFamilyDescriptors.size(); i++) {
columnFamilyHandles.add(new ColumnFamilyHandle(ttlDB, cfReferences.get(i)));
}
@ -185,7 +186,7 @@ public class TtlDB extends RocksDB {
private native void open(long optionsHandle, String db_path, int ttl,
boolean readOnly) throws RocksDBException;
private native List<Long> open(long optionsHandle, String db_path,
private native List<Long> openCF(long optionsHandle, String db_path,
List<ColumnFamilyDescriptor> columnFamilyDescriptors,
int columnFamilyDescriptorsLength, List<Integer> ttlValues,
boolean readOnly) throws RocksDBException;

View File

@ -22,9 +22,9 @@
* Method: open
* Signature: (JLjava/lang/String;IZ)V
*/
void Java_org_rocksdb_TtlDB_open__JLjava_lang_String_2IZ(JNIEnv* env, jobject jttldb,
jlong joptions_handle, jstring jdb_path, jint jttl,
jboolean jread_only) {
void Java_org_rocksdb_TtlDB_open(JNIEnv* env,
jobject jttldb, jlong joptions_handle, jstring jdb_path,
jint jttl, jboolean jread_only) {
auto opt = reinterpret_cast<rocksdb::Options*>(joptions_handle);
rocksdb::DBWithTTL* db = nullptr;
const char* db_path = env->GetStringUTFChars(jdb_path, 0);
@ -43,11 +43,12 @@ void Java_org_rocksdb_TtlDB_open__JLjava_lang_String_2IZ(JNIEnv* env, jobject jt
/*
* Class: org_rocksdb_TtlDB
* Method: open
* Signature: (JLjava/lang/String;Ljava/util/List;ILjava/util/List;Z)Ljava/util/List;
* Method: openCF
* Signature: (JLjava/lang/String;Ljava/util/List;
* ILjava/util/List;Z)Ljava/util/List;
*/
jobject
Java_org_rocksdb_TtlDB_open__JLjava_lang_String_2Ljava_util_List_2ILjava_util_List_2Z(
Java_org_rocksdb_TtlDB_openCF(
JNIEnv* env, jobject jdb, jlong jopt_handle, jstring jdb_path,
jobject jcfdesc_list, jint jcfdesc_count, jobject jttl_list,
jboolean jread_only) {