@ -18,7 +18,8 @@ using namespace std::placeholders;
# if defined(_MSC_VER)
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(push)
# pragma warning(disable : 4503) // identifier' : decorated name length exceeded, name was truncated
# pragma warning(disable : 4503) // identifier' : decorated name length
// exceeded, name was truncated
# endif
# endif
/*
/*
@ -271,8 +272,8 @@ typedef std::function<std::vector<rocksdb::Status>(
void free_parts (
void free_parts (
JNIEnv * env ,
JNIEnv * env ,
std : : vector < std : : tuple < jbyteArray , jbyte * , jobject > > & parts_to_free ) {
std : : vector < std : : tuple < jbyteArray , jbyte * , jobject > > & parts_to_free ) {
for ( auto & value : parts_to_free ) {
for ( auto & value : parts_to_free ) {
jobject jk ;
jobject jk ;
jbyteArray jk_ba ;
jbyteArray jk_ba ;
jbyte * jk_val ;
jbyte * jk_val ;
@ -671,10 +672,10 @@ void txn_write_kv_parts_helper(JNIEnv* env,
return ;
return ;
}
}
jparts_to_free . push_back ( std : : make_tuple (
jparts_to_free . push_back (
jba_key_part , jkey_part , jobj_key_part ) ) ;
std : : make_tuple ( jba_key_part , jkey_part , jobj_key_part ) ) ;
jparts_to_free . push_back ( std : : make_tuple (
jparts_to_free . push_back (
jba_value_part , jvalue_part , jobj_value_part ) ) ;
std : : make_tuple ( jba_value_part , jvalue_part , jobj_value_part ) ) ;
key_parts . push_back (
key_parts . push_back (
rocksdb : : Slice ( reinterpret_cast < char * > ( jkey_part ) , jkey_part_len ) ) ;
rocksdb : : Slice ( reinterpret_cast < char * > ( jkey_part ) , jkey_part_len ) ) ;
@ -830,13 +831,11 @@ void Java_org_rocksdb_Transaction_delete__J_3BI(JNIEnv* env, jobject /*jobj*/,
typedef std : : function < rocksdb : : Status ( const rocksdb : : SliceParts & ) >
typedef std : : function < rocksdb : : Status ( const rocksdb : : SliceParts & ) >
FnWriteKParts ;
FnWriteKParts ;
// TODO(AR) consider refactoring to share this between here and rocksjni.cc
// TODO(AR) consider refactoring to share this between here and rocksjni.cc
void txn_write_k_parts_helper ( JNIEnv * env ,
void txn_write_k_parts_helper ( JNIEnv * env ,
const FnWriteKParts & fn_write_k_parts ,
const FnWriteKParts & fn_write_k_parts ,
const jobjectArray & jkey_parts ,
const jobjectArray & jkey_parts ,
const jint & jkey_parts_len ) {
const jint & jkey_parts_len ) {
std : : vector < rocksdb : : Slice > key_parts ;
std : : vector < rocksdb : : Slice > key_parts ;
std : : vector < std : : tuple < jbyteArray , jbyte * , jobject > > jkey_parts_to_free ;
std : : vector < std : : tuple < jbyteArray , jbyte * , jobject > > jkey_parts_to_free ;
@ -868,12 +867,13 @@ void txn_write_k_parts_helper(JNIEnv* env,
jkey_parts_to_free . push_back ( std : : tuple < jbyteArray , jbyte * , jobject > (
jkey_parts_to_free . push_back ( std : : tuple < jbyteArray , jbyte * , jobject > (
jba_key_part , jkey_part , jobj_key_part ) ) ;
jba_key_part , jkey_part , jobj_key_part ) ) ;
key_parts . push_back ( rocksdb : : Slice ( reinterpret_cast < char * > ( jkey_part ) , jkey_part_len ) ) ;
key_parts . push_back (
rocksdb : : Slice ( reinterpret_cast < char * > ( jkey_part ) , jkey_part_len ) ) ;
}
}
// call the write_multi function
// call the write_multi function
rocksdb : : Status s =
rocksdb : : Status s = fn_write_k_parts (
fn_write_k_parts ( rocksdb : : SliceParts ( key_parts . data ( ) , ( int ) key_parts . size ( ) ) ) ;
rocksdb : : SliceParts ( key_parts . data ( ) , ( int ) key_parts . size ( ) ) ) ;
// cleanup temporary memory
// cleanup temporary memory
free_parts ( env , jkey_parts_to_free ) ;
free_parts ( env , jkey_parts_to_free ) ;