Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/929#discussion_r97918864
--- Diff: core/sql/executor/HBaseClient_JNI.cpp ---
@@ -1303,12 +1304,26 @@ HBC_RetCode HBaseClient_JNI::grant(const Text&
user, const Text& tblName, const
HBC_RetCode HBaseClient_JNI::estimateRowCount(const char* tblName,
Int32 partialRowSize,
Int32 numCols,
- Int64& rowCount)
+ Int32 retryLimitMilliSeconds,
+ Int64& rowCount,
+ Int32& breadCrumb)
{
+ // Note: Please use HBC_ERROR_ROWCOUNT_EST_EXCEPTION only for
+ // those error returns that call getExceptionDetails(). This
+ // tells the caller that Java exception information is available.
+
QRLogger::log(CAT_SQL_HBASE, LL_DEBUG,
"HBaseClient_JNI::estimateRowCount(%s) called.", tblName);
- if (initJNIEnv() != JOI_OK)
- return HBC_ERROR_INIT_PARAM;
+ breadCrumb = 1;
+ if (jenv_ == NULL)
+ if (initJVM() != JOI_OK)
+ return HBC_ERROR_INIT_PARAM;
+ breadCrumb = 2;
+ if (jenv_->PushLocalFrame(jniHandleCapacity_) != 0) {
+ getExceptionDetails();
+ return HBC_ERROR_ROWCOUNT_EST_EXCEPTION;
+ }
+ breadCrumb = 3;
--- End diff --
I know you wanted to provide breadcrumb for the errors reported. However, I
would think you would want to consider leave this initialization code as it is.
I have cleaned up the code earlier just to ensure that the initialization to
the JNI layer is encapsulated in this method initJNIEnv() so that any changes
can be made in one routine.
---
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.
---