Github user sureshsubbiah commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/6#discussion_r33176421
--- 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) {
+ ComDiagsArea * diagsArea = NULL;
+ ExRaiseSqlError(getHeap(), &diagsArea,
+ (ExeErrorCode)(8102));
--- End diff --
Could resultArray_[0] be FALSE for some reason other than uniqueness
violation? Like say a some kind of RPC failure or HBase issue.
---
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.
---