trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sureshsubbiah <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: [TRAFODION-1444] Reduced pathlen...
Date Wed, 12 Aug 2015 16:47:41 GMT
Github user sureshsubbiah commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/52#discussion_r36883315
  
    --- Diff: core/sql/exp/ExpHbaseInterface.cpp ---
    @@ -797,178 +734,149 @@ Lng32 ExpHbaseInterface_JNI::getRowsOpen(
     }
     
     Lng32 ExpHbaseInterface_JNI::deleteRow(
    -	  HbaseStr &tblName,
    -	  HbaseStr& row, 
    +	  HbaseStr tblName,
    +	  HbaseStr row, 
     	  const LIST(HbaseStr) *columns,
     	  NABoolean noXn,
     	  const int64_t timestamp)
     
     {
    -  HTableClient_JNI *htc = client_->getHTableClient((NAHeap *)heap_, tblName.val, useTRex_,
hbs_);
    -  if (htc == NULL)
    -  {
    -    retCode_ = HBC_ERROR_GET_HTC_EXCEPTION;
    -    return HBASE_OPEN_ERROR;
    -  }
    -  
    -
    -
    +  HTableClient_JNI *htc;
    +  bool asyncOperation = false;
       Int64 transID;
    +
       if (noXn)
         transID = 0;
       else
         transID = getTransactionIDFromContext();
    -  retCode_ = htc->deleteRow(transID, row, columns, timestamp);
    -
    -
    -
    -  client_->releaseHTableClient(htc);
    -
    -  if (retCode_ != HBC_OK)
    +  retCode_ = client_->deleteRow((NAHeap *)heap_, tblName.val, hbs_, useTRex_, transID,
row, columns, timestamp, asyncOperation, &htc);
    +  if (retCode_ != HBC_OK) {
    +    asyncHtc_ = NULL;
         return -HBASE_ACCESS_ERROR;
    -  else
    +  }
    +  else {
    +    asyncHtc_ = htc;
         return HBASE_ACCESS_SUCCESS;
    +  } 
     }
     //
     //----------------------------------------------------------------------------
     Lng32 ExpHbaseInterface_JNI::deleteRows(
    -	  HbaseStr &tblName,
    +	  HbaseStr tblName,
               short rowIDLen,
    -	  HbaseStr &rowIDs,
    +	  HbaseStr rowIDs,
     	  NABoolean noXn,
     	  const int64_t timestamp)
     {
    -  HTableClient_JNI* htc = client_->getHTableClient((NAHeap *)heap_, tblName.val, useTRex_,
hbs_);
    -  if (htc == NULL)
    -  {
    -    retCode_ = HBC_ERROR_GET_HTC_EXCEPTION;
    -    return HBASE_OPEN_ERROR;
    -  }
    -  
    -
    +  HTableClient_JNI *htc;
    +  bool asyncOperation = false;
       Int64 transID;
    +
       if (noXn)
         transID = 0;
       else
         transID = getTransactionIDFromContext();
    -
    - 
    -  retCode_ = htc->deleteRows(transID, rowIDLen, rowIDs, timestamp);
    -
    -
    -
    -  client_->releaseHTableClient(htc);
    -
    -  if (retCode_ != HBC_OK)
    +  retCode_ = client_->deleteRows((NAHeap *)heap_, tblName.val, hbs_, useTRex_, transID,
rowIDLen, rowIDs,timestamp, asyncOperation, &htc);
    +  if (retCode_ != HBC_OK) {
    +    asyncHtc_ = NULL;
         return -HBASE_ACCESS_ERROR;
    -  else
    +  }
    +  else {
    +    asyncHtc_ = htc;
         return HBASE_ACCESS_SUCCESS;
    +  } 
     }
     
     //----------------------------------------------------------------------------
     Lng32 ExpHbaseInterface_JNI::checkAndDeleteRow(
     	  HbaseStr &tblName,
    -	  HbaseStr& row, 
    +	  HbaseStr& rowID, 
     	  HbaseStr& columnToCheck,
    -	  HbaseStr& colValToCheck,
    +	  HbaseStr& columnValToCheck,
     	  NABoolean noXn,
     	  const int64_t timestamp)
     
     {
    -  HTableClient_JNI* htc = client_->getHTableClient((NAHeap *)heap_, tblName.val, useTRex_,
hbs_);
    -  if (htc == NULL)
    -  {
    -    retCode_ = HBC_ERROR_GET_HTC_EXCEPTION;
    -    return HBASE_OPEN_ERROR;
    -  }
    -  
    +  HTableClient_JNI *htc;
    +  bool asyncOperation = false;
       Int64 transID;
       if (noXn)
         transID = 0;
       else
         transID = getTransactionIDFromContext();
    -  HTC_RetCode rc = htc->checkAndDeleteRow(transID, row, columnToCheck, colValToCheck,
    -					  timestamp);
    -
    -  client_->releaseHTableClient(htc);
    -
    -  if (rc == HTC_ERROR_CHECKANDDELETE_ROW_NOTFOUND)
    +  retCode_ = client_->checkAndDeleteRow((NAHeap *)heap_, tblName.val, hbs_, useTRex_,
transID, rowID, columnToCheck, 
    +                     columnValToCheck,timestamp, asyncOperation, &htc);
    +  if (retCode_ == HBC_ERROR_CHECKANDDELETEROW_NOTFOUND) {
    +    asyncHtc_ = NULL;
         return HBASE_ROW_NOTFOUND_ERROR;
    -
    -  retCode_ = rc;
    -
    -  if (retCode_ != HBC_OK)
    +  } else
    +  if (retCode_ != HBC_OK) {
    +    asyncHtc_ = NULL;
         return -HBASE_ACCESS_ERROR;
    -  else
    +  }
    +  else {
    +    asyncHtc_ = htc;
         return HBASE_ACCESS_SUCCESS;
    +  } 
     }
     //
     //----------------------------------------------------------------------------
     Lng32 ExpHbaseInterface_JNI::insertRow(
    -	  HbaseStr &tblName,
    -	  HbaseStr &rowID, 
    -          HbaseStr &row,
    +	  HbaseStr tblName,
    +	  HbaseStr rowID, 
    +          HbaseStr row,
     	  NABoolean noXn,
     	  const int64_t timestamp,
               NABoolean asyncOperation)
     {
    -  HTableClient_JNI *htc = client_->getHTableClient((NAHeap *)heap_, tblName.val, useTRex_,
hbs_);
    -  if (htc == NULL) {
    -    retCode_ = HBC_ERROR_GET_HTC_EXCEPTION;
    -    return HBASE_OPEN_ERROR;
    -  }
    -  
    -  Int64 transID;
    +  HTableClient_JNI *htc;
    --- End diff --
    
    Should we initialize to NULL here? If comment is valid please check similar places in
other methods too.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message