[RocksJava] Integrated changes from D31449
This commit is contained in:
parent
859c54a03d
commit
e828567541
@ -117,8 +117,9 @@ public class TtlDB extends RocksDB {
|
|||||||
"family handle.");
|
"family handle.");
|
||||||
}
|
}
|
||||||
TtlDB ttlDB = new TtlDB();
|
TtlDB ttlDB = new TtlDB();
|
||||||
List<Long> cfReferences = ttlDB.open(options.nativeHandle_, db_path, columnFamilyDescriptors,
|
List<Long> cfReferences = ttlDB.openCF(options.nativeHandle_, db_path,
|
||||||
columnFamilyDescriptors.size(), ttlValues, readOnly);
|
columnFamilyDescriptors, columnFamilyDescriptors.size(),
|
||||||
|
ttlValues, readOnly);
|
||||||
for (int i=0; i<columnFamilyDescriptors.size(); i++) {
|
for (int i=0; i<columnFamilyDescriptors.size(); i++) {
|
||||||
columnFamilyHandles.add(new ColumnFamilyHandle(ttlDB, cfReferences.get(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,
|
private native void open(long optionsHandle, String db_path, int ttl,
|
||||||
boolean readOnly) throws RocksDBException;
|
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,
|
List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
||||||
int columnFamilyDescriptorsLength, List<Integer> ttlValues,
|
int columnFamilyDescriptorsLength, List<Integer> ttlValues,
|
||||||
boolean readOnly) throws RocksDBException;
|
boolean readOnly) throws RocksDBException;
|
||||||
|
@ -22,9 +22,9 @@
|
|||||||
* Method: open
|
* Method: open
|
||||||
* Signature: (JLjava/lang/String;IZ)V
|
* Signature: (JLjava/lang/String;IZ)V
|
||||||
*/
|
*/
|
||||||
void Java_org_rocksdb_TtlDB_open__JLjava_lang_String_2IZ(JNIEnv* env, jobject jttldb,
|
void Java_org_rocksdb_TtlDB_open(JNIEnv* env,
|
||||||
jlong joptions_handle, jstring jdb_path, jint jttl,
|
jobject jttldb, jlong joptions_handle, jstring jdb_path,
|
||||||
jboolean jread_only) {
|
jint jttl, jboolean jread_only) {
|
||||||
auto opt = reinterpret_cast<rocksdb::Options*>(joptions_handle);
|
auto opt = reinterpret_cast<rocksdb::Options*>(joptions_handle);
|
||||||
rocksdb::DBWithTTL* db = nullptr;
|
rocksdb::DBWithTTL* db = nullptr;
|
||||||
const char* db_path = env->GetStringUTFChars(jdb_path, 0);
|
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
|
* Class: org_rocksdb_TtlDB
|
||||||
* Method: open
|
* Method: openCF
|
||||||
* Signature: (JLjava/lang/String;Ljava/util/List;ILjava/util/List;Z)Ljava/util/List;
|
* Signature: (JLjava/lang/String;Ljava/util/List;
|
||||||
|
* ILjava/util/List;Z)Ljava/util/List;
|
||||||
*/
|
*/
|
||||||
jobject
|
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,
|
JNIEnv* env, jobject jdb, jlong jopt_handle, jstring jdb_path,
|
||||||
jobject jcfdesc_list, jint jcfdesc_count, jobject jttl_list,
|
jobject jcfdesc_list, jint jcfdesc_count, jobject jttl_list,
|
||||||
jboolean jread_only) {
|
jboolean jread_only) {
|
||||||
|
Loading…
Reference in New Issue
Block a user