pvary commented on code in PR #5327:
URL: https://github.com/apache/iceberg/pull/5327#discussion_r933076387


##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java:
##########
@@ -345,6 +345,30 @@ protected void doCommit(TableMetadata base, TableMetadata 
metadata) {
         "Committed to table {} with the new metadata location {}", fullName, 
newMetadataLocation);
   }
 
+  @Override
+  public void reset(String metadataFileLocation) {
+    Optional<Long> lockId = Optional.empty();
+    ReentrantLock tableLevelMutex = commitLockCache.get(fullName, t -> new 
ReentrantLock(true));
+    tableLevelMutex.lock();
+    try {
+      lockId = Optional.of(acquireLock());
+      Table tbl = loadHmsTable();

Review Comment:
   I do not like this. Too big part of the commit code is duplicated, and this 
is especially true for the error handling. This part is complicated and error 
prone, so we might want to try to find a better way to wave the to parts of the 
code together.



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