trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From selvaganesang <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #1206: [TRAFODION-2617] Optionally push est...
Date Tue, 15 Aug 2017 20:29:05 GMT
Github user selvaganesang commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/1206#discussion_r133294784
  
    --- Diff: core/sql/src/main/java/org/trafodion/sql/HBaseClient.java ---
    @@ -1395,6 +1422,169 @@ private boolean estimateRowCountBody(String tblName, int partialRowSize,
           return true;
         }
     
    +    // Similar to estimateRowCount, except that the implementation
    +    // uses a coprocessor. This is necessary when HBase encryption is
    +    // in use, because the Trafodion ID does not have the proper 
    +    // authorization to the KeyStore file used by HBase.
    +    public boolean estimateRowCountViaCoprocessor(String tblName, int partialRowSize,
    +                                    int numCols, int retryLimitMilliSeconds, long[] rc)
    +                   throws ServiceException, IOException {
    +      if (logger.isDebugEnabled()) {
    +        logger.debug("HBaseClient.estimateRowCountViaCoprocessor(" + tblName + ") called.");
    +        logger.debug("numCols = " + numCols + ", partialRowSize = " + partialRowSize);
    +      }
    +
    +      boolean retcode = true; 
    +      rc[0] = 0;
    +
    +      HConnection connection = null;
    +      HTableInterface table = null; 
    +      connection = HConnectionManager.createConnection(config);
    --- End diff --
    
    Can you use getConnection instead. It ensures that there is only one connection per process


---
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