Github user selvaganesang commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/6#discussion_r33178133
--- Diff: core/sql/executor/ExHbaseIUD.cpp ---
@@ -532,26 +534,64 @@ ExWorkProcRetcode ExHbaseAccessInsertSQTcb::work()
break;
}
- if (setupError(retcode, "ExpHbaseInterface::rowExists"))
+ if (setupError(retcode, "ExpHbaseInterface::checkAndInsertRow"))
{
step_ = HANDLE_ERROR;
break;
}
- if (getHbaseAccessStats())
- getHbaseAccessStats()->incUsedRows();
- if (hbaseAccessTdb().returnRow())
+ if (hbaseAccessTdb().returnRow()) {
step_ = RETURN_ROW;
- else
- {
+ break;
+ }
+ matches_++;
+ if (hbaseAccessTdb().asyncOperations()) {
+ step_ = ASYNC_INSERT_COMPLETE;
+ return WORK_CALL_AGAIN;
+ }
+ else {
step_ = INSERT_CLOSE;
- matches_++;
- }
+ }
+ if (getHbaseAccessStats())
+ getHbaseAccessStats()->incUsedRows();
}
break;
-
+ case ASYNC_INSERT_COMPLETE:
+ {
+ if (resultArray_ == NULL)
+ resultArray_ = new (getHeap()) NABoolean[1];
+ Int32 timeout;
+ if (asyncCompleteRetryCount_ < 10)
+ timeout = -1;
+ else {
+ asyncOperationTimeout_ = asyncOperationTimeout_ * 2;
+ timeout = asyncOperationTimeout_;
+ }
+ retcode = ehi_->completeAsyncOperation(timeout, resultArray_,
1);
+ if (retcode == HBASE_RETRY_AGAIN) {
+ asyncCompleteRetryCount_++;
+ return WORK_CALL_AGAIN;
+ }
+ asyncCompleteRetryCount_ = 0;
+ if (setupError(retcode,
"ExpHbaseInterface::completeAsyncOperation")) {
+ step_ = HANDLE_ERROR;
+ break;
+ }
+ if (resultArray_[0] == FALSE) {
--- End diff --
resultArray_ is an array for two reasons.
1) As an output parameter in java. To return the status of the Put operation
2) To enhance it to return an status array denoting the outcome of each Put
operation.
This array is populated on the java side
---
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.
---