deniskuzZ commented on code in PR #4384:
URL: https://github.com/apache/hive/pull/4384#discussion_r1309111795
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/TxnHandler.java:
##########
@@ -2502,40 +2546,22 @@ public void seedTxnId(SeedTxnIdRequest rqst) throws
MetaException {
@Override
@RetrySemantics.Idempotent
- public void addWriteNotificationLog(ListenerEvent acidWriteEvent)
- throws MetaException {
- Connection dbConn = null;
- try {
- try {
- //Idempotent case is handled by notify Event
- lockInternal();
- dbConn = getDbConn(Connection.TRANSACTION_READ_COMMITTED);
-
MetaStoreListenerNotifier.notifyEventWithDirectSql(transactionalListeners,
- acidWriteEvent instanceof AcidWriteEvent ?
EventMessage.EventType.ACID_WRITE
- : EventMessage.EventType.BATCH_ACID_WRITE,
- acidWriteEvent, dbConn, sqlGenerator);
- LOG.debug("Going to commit");
- dbConn.commit();
- } catch (SQLException e) {
- LOG.debug("Going to rollback: ", e);
- rollbackDBConn(dbConn);
- if (isDuplicateKeyError(e)) {
- // in case of key duplicate error, retry as it might be because of
race condition
- if (waitForRetry("addWriteNotificationLog(" + acidWriteEvent + ")",
e.getMessage())) {
- throw new RetryException();
- }
- retryNum = 0;
- throw new MetaException(e.getMessage());
+ public void addWriteNotificationLog(ListenerEvent acidWriteEvent) throws
MetaException {
+ retryHandler.executeWithRetry(new RetryCallProperties()
Review Comment:
why don't we use jdbcTemplate here?
--
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]