deniskuzZ commented on code in PR #4566:
URL: https://github.com/apache/hive/pull/4566#discussion_r1419068628


##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -6052,450 +1096,53 @@ protected synchronized static DataSource 
setupJdbcConnectionPool(Configuration c
         throw new RuntimeException(e);
       }
     } else {
-      String connectionPooler = MetastoreConf.getVar(conf, 
ConfVars.CONNECTION_POOLING_TYPE).toLowerCase();
+      String connectionPooler = MetastoreConf.getVar(conf, 
MetastoreConf.ConfVars.CONNECTION_POOLING_TYPE).toLowerCase();
       if ("none".equals(connectionPooler)) {
         LOG.info("Choosing not to pool JDBC connections");
-        return new NoPoolConnectionPool(conf);
+        return new NoPoolConnectionPool(conf, dbProduct);
       } else {
         throw new RuntimeException("Unknown JDBC connection pooling " + 
connectionPooler);
       }
     }
   }
 
-  /**
-   * Returns true if {@code ex} should be retried
-   */
-  static boolean isRetryable(Configuration conf, Exception ex) {
-    if(ex instanceof SQLException) {
-      SQLException sqlException = (SQLException)ex;
-      if (MANUAL_RETRY.equalsIgnoreCase(sqlException.getSQLState())) {
-        // Manual retry exception was thrown
-        return true;
-      }
-      if ("08S01".equalsIgnoreCase(sqlException.getSQLState())) {
-        //in MSSQL this means Communication Link Failure
-        return true;
-      }
-      if ("ORA-08176".equalsIgnoreCase(sqlException.getSQLState()) ||
-        sqlException.getMessage().contains("consistent read failure; rollback 
data not available")) {
-        return true;
-      }
-
-      String regex = MetastoreConf.getVar(conf, 
ConfVars.TXN_RETRYABLE_SQLEX_REGEX);
-      if (regex != null && !regex.isEmpty()) {
-        String[] patterns = regex.split(",(?=\\S)");
-        String message = getMessage((SQLException)ex);
-        for (String p : patterns) {
-          if (Pattern.matches(p, message)) {
-            return true;
-          }
-        }
-      }
-      //see also https://issues.apache.org/jira/browse/HIVE-9938
-    }
-    return false;
-  }
-
-  private boolean isDuplicateKeyError(SQLException ex) {
-    return dbProduct.isDuplicateKeyError(ex);
-  }
-
-  private static String getMessage(SQLException ex) {
-    return ex.getMessage() + " (SQLState=" + ex.getSQLState() + ", ErrorCode=" 
+ ex.getErrorCode() + ")";
-  }
-  static String quoteString(String input) {
-    return "'" + input + "'";
-  }
-  static String quoteChar(char c) {
-    return "'" + c + "'";
-  }
-
-  /**
-   * {@link #lockInternal()} and {@link #unlockInternal()} are used to 
serialize those operations that require
-   * Select ... For Update to sequence operations properly.  In practice that 
means when running
-   * with Derby database.  See more notes at class level.
-   */
-  protected void lockInternal() {
-    if(dbProduct.isDERBY()) {
-      derbyLock.lock();
-    }
-  }
-  protected void unlockInternal() {
-    if(dbProduct.isDERBY()) {
-      derbyLock.unlock();
-    }
-  }
   @Override
   @RetrySemantics.Idempotent

Review Comment:
   should we keep this, as it's also present in interface



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to