You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/31 15:10:36 UTC

[GitHub] [iceberg] yabola commented on a diff in pull request #5327: Support resetTable procedure

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


##########
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:
   @pvary I abstract the part of the metadata locking logic. Please have a look.



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org