This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 00ac72b57 [core] Introduce tag prefix (#1367)
00ac72b57 is described below
commit 00ac72b57f951f88375c94853405b008e96becbf
Author: yuzelin <[email protected]>
AuthorDate: Wed Jun 14 14:55:23 2023 +0800
[core] Introduce tag prefix (#1367)
---
paimon-core/src/main/java/org/apache/paimon/utils/TagManager.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/paimon-core/src/main/java/org/apache/paimon/utils/TagManager.java
b/paimon-core/src/main/java/org/apache/paimon/utils/TagManager.java
index 60133d456..ea3dce938 100644
--- a/paimon-core/src/main/java/org/apache/paimon/utils/TagManager.java
+++ b/paimon-core/src/main/java/org/apache/paimon/utils/TagManager.java
@@ -35,6 +35,8 @@ import static
org.apache.paimon.utils.Preconditions.checkArgument;
/** Manager for {@code Tag}. */
public class TagManager {
+ private static final String TAG_PREFIX = "tag-";
+
private final FileIO fileIO;
private final Path tablePath;
@@ -50,7 +52,7 @@ public class TagManager {
/** Return the path of a tag. */
public Path tagPath(String tagName) {
- return new Path(tablePath + "/tag/" + tagName);
+ return new Path(tablePath + "/tag/" + TAG_PREFIX + tagName);
}
/** Create a tag from given snapshot and save it in the storage. */
@@ -113,6 +115,7 @@ public class TagManager {
return Arrays.stream(statuses)
.map(FileStatus::getPath)
+ .filter(path -> path.getName().startsWith(TAG_PREFIX))
.map(path -> Snapshot.fromPath(fileIO, path))
.sorted(Comparator.comparingLong(Snapshot::id))
.collect(Collectors.toList());