Github user bucaojit commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1028#discussion_r108588061
--- Diff: core/sqf/src/seatrans/tm/hbasetmlib2/hbasetm.cpp ---
@@ -1218,6 +1220,22 @@ char* HashMapArray::get(int tid)
return cp_val;
}
+char* HashMapArray::getRegionInfo(int64 tid)
+{
+ jstring js_val = (jstring)(_tlp_jenv->CallObjectMethod(javaObj_,
JavaMethods_[JM_GET_REGINFO].methodID, tid));
+ if (getExceptionDetails(NULL)) {
+ tm_log_write(DTM_TM_JNI_ERROR, SQ_LOG_ERR, (char
*)"HashMapArray::getRegionInfo()", (char *)_tlp_error_msg->c_str(), -1LL);
+ return NULL;
+ }
+ if(js_val == NULL){
+ return NULL;
+ }
+
+ const jbyte* jb_val = (jbyte*)_tlp_jenv->GetStringUTFChars(js_val,
NULL);
--- End diff --
Hi Dave, thanks for the review. You make excellent points. I did find
that I was not deleting a reference of the map on the C++ side in tm.cpp. I
will add that change. As for the frames, I don't see that on the JNI for the
TM side. From what I understand once the reference is gone it is up to the
Java gc to manage the memory cleanup.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---