[
https://issues.apache.org/jira/browse/TRAFODION-1444?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14692659#comment-14692659
]
ASF GitHub Bot commented on TRAFODION-1444:
-------------------------------------------
Github user sureshsubbiah commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/52#discussion_r36816942
--- Diff: core/sql/executor/HBaseClient_JNI.cpp ---
@@ -2844,819 +2871,980 @@ HBC_RetCode
HBaseClient_JNI::getHbaseTableInfo(const char* tblName,
return HBC_OK; // Table exists.
}
-
-//
===========================================================================
-// ===== Class HTableClient
-//
===========================================================================
-
-JavaMethodInit* HTableClient_JNI::JavaMethods_ = NULL;
-jclass HTableClient_JNI::javaClass_ = 0;
-bool HTableClient_JNI::javaMethodsInitialized_ = false;
-pthread_mutex_t HTableClient_JNI::javaMethodsInitMutex_ =
PTHREAD_MUTEX_INITIALIZER;
-
-static const char* const htcErrorEnumStr[] =
-{
- "Preparing parameters for initConnection()."
- ,"Java exception in initConnection()."
- ,"Java exception in setTransactionID()."
- ,"Java exception in cleanup()."
- ,"Java exception in close()."
- ,"Preparing parameters for scanOpen()."
- ,"Java exception in scanOpen()."
- ,"Java exception in fetchRows()."
- ,"Java exception in scanClose()."
- ,"Preparing parameters for getRowOpen()."
- ,"Java exception in getRowOpen()."
- ,"Preparing parameters for getRowsOpen()."
- ,"Java exception in getRowsOpen()."
- ,"Java exception in getClose()."
- ,"Preparing parameters for deleteRow()."
- ,"Java exception in deleteRow()."
- ,"Preparing parameters for deleteRows()."
- ,"Java exception in deleteRows()."
- ,"Preparing parameters for checkAndDeleteRow()."
- ,"Java exception in checkAndDeleteRow()."
- ,"Row deleted in checkAndDeleteRow()."
- ,"Preparing parameters for insertRow()."
- ,"Java exception in insertRow()."
- ,"Preparing parameters for insertRows()."
- ,"Java exception in insertRows()."
- ,"Preparing parameters for checkAndInsertRow()."
- ,"Java exception in checkAndInsertRow()."
- ,"Dup RowId in checkAndInsertRow()."
- ,"Transactions not supported yet in checkAndInsertRow()"
- ,"Preparing parameters for checkAndUpdateRow()."
- ,"Java exception in checkAndUpdateRow()."
- ,"Dup RowId in checkAndUpdateRow()."
- ,"Transactions not supported yet in checkAndUpdateRow()"
- ,"Preparing parameters for create()."
- ,"Java exception in create()."
- ,"Preparing parameters for drop()."
- ,"Java exception in drop()."
- ,"Preparing parameters for exists()."
- ,"Java exception in exists()."
- ,"Preparing parameters for coProcAggr()."
- ,"Java exception in coProcAggr()."
- ,"Preparing parameters for grant()."
- ,"Java exception in grant()."
- ,"Preparing parameters for revoke()."
- ,"Java exception in revoke()."
- ,"Java exception in getendkeys()."
- ,"Java exception in getHTableName()."
- ,"Java exception in flush()."
- ,"Java exception in getColName()."
- ,"Java exception in getColValue()."
- ,"Java exception in getRowID()."
- ,"Java exception in nextCell()."
- ,"Preparing parameters for getRows()."
- ,"Java exception in getRows()."
- ,"Java exception in completeAsyncOperation()."
- ,"Async Hbase Operation not yet complete."
-};
-
//////////////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////////////
-char* HTableClient_JNI::getErrorText(HTC_RetCode errEnum)
+HBC_RetCode HBaseClient_JNI::insertRow(NAHeap *heap, const char *tableName,
+ ExHbaseAccessStats *hbs, bool useTRex, Int64 transID, HbaseStr rowID,
+ HbaseStr row, Int64 timestamp, bool checkAndPut, bool asyncOperation,
+ HTableClient_JNI **outHtc)
{
- if (errEnum < (HTC_RetCode)JOI_LAST)
- return JavaObjectInterface::getErrorText((JOI_RetCode)errEnum);
- else
- return (char*)htcErrorEnumStr[errEnum-HTC_FIRST-1];
-}
+
+ HTableClient_JNI *htc = NULL;
-//////////////////////////////////////////////////////////////////////////////
-//
-//////////////////////////////////////////////////////////////////////////////
-HTableClient_JNI::~HTableClient_JNI()
-{
- //QRLogger::log(CAT_JNI_TOP, LL_DEBUG, "HTableClient destructor
called.");
- cleanupResultInfo();
- if (tableName_ != NULL)
- {
- NADELETEBASIC(tableName_, heap_);
+ if (asyncOperation) {
+ HTableClient_JNI *htc = new (heap) HTableClient_JNI(heap,
(jobject)-1);
--- End diff --
Should this just be htc = ... ?
In line 2883 we have already declared the htc variable.
> Reduce the path length for IUD operations in Trafodion in the hbase client
> layer
> --------------------------------------------------------------------------------
>
> Key: TRAFODION-1444
> URL: https://issues.apache.org/jira/browse/TRAFODION-1444
> Project: Apache Trafodion
> Issue Type: Improvement
> Components: sql-exe
> Affects Versions: 2.0-incubating
> Reporter: Selvaganesan Govindarajan
> Assignee: Selvaganesan Govindarajan
> Original Estimate: 96h
> Remaining Estimate: 96h
>
> There are 3 JNI to java transitions for insert, update, delete,
> checkAndInsert, checkAndUpdate and checkAndDelete operations. It can be done
> with one jni transition and reduced memory allocation.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)