askwang commented on code in PR #4346:
URL: https://github.com/apache/paimon/pull/4346#discussion_r1808413213


##########
paimon-core/src/main/java/org/apache/paimon/table/AbstractFileStoreTable.java:
##########
@@ -576,6 +576,25 @@ public void renameTag(String tagName, String 
targetTagName) {
         tagManager().renameTag(tagName, targetTagName);
     }
 
+    @Override
+    public void replaceTag(String tagName, @Nullable Duration timeRetained) {
+        Snapshot latestSnapshot = snapshotManager().latestSnapshot();
+        SnapshotNotExistException.checkNotNull(
+                latestSnapshot, "Cannot create tag because latest snapshot 
doesn't exist.");
+        tagManager()
+                .replaceTag(latestSnapshot, tagName, timeRetained, 
store().createTagCallbacks());
+    }
+
+    @Override
+    public void replaceTag(String tagName, long fromSnapshotId, @Nullable 
Duration timeRetained) {
+        tagManager()
+                .replaceTag(
+                        findSnapshot(fromSnapshotId),
+                        tagName,
+                        timeRetained,
+                        store().createTagCallbacks());

Review Comment:
   good, replace the existing tag is no need to call callback again.



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

Reply via email to