You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2023/12/19 08:39:07 UTC
(incubator-paimon) branch master updated: [core] Use isAutoTag in TagAutoCreation
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 ee98ef0eb [core] Use isAutoTag in TagAutoCreation
ee98ef0eb is described below
commit ee98ef0ebce9b76ee544e6dc0fbc30058b01015b
Author: Jingsong <ji...@gmail.com>
AuthorDate: Tue Dec 19 16:38:58 2023 +0800
[core] Use isAutoTag in TagAutoCreation
---
.../main/java/org/apache/paimon/tag/TagAutoCreation.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/paimon-core/src/main/java/org/apache/paimon/tag/TagAutoCreation.java b/paimon-core/src/main/java/org/apache/paimon/tag/TagAutoCreation.java
index c4e9f7948..ba7069bd8 100644
--- a/paimon-core/src/main/java/org/apache/paimon/tag/TagAutoCreation.java
+++ b/paimon-core/src/main/java/org/apache/paimon/tag/TagAutoCreation.java
@@ -67,7 +67,7 @@ public class TagAutoCreation {
this.periodHandler.validateDelay(delay);
- SortedMap<Snapshot, String> tags = tagManager.tags(t -> !t.startsWith("savepoint"));
+ SortedMap<Snapshot, String> tags = tagManager.tags(this::isAutoTag);
if (tags.isEmpty()) {
this.nextSnapshot =
@@ -81,6 +81,15 @@ public class TagAutoCreation {
}
}
+ private boolean isAutoTag(String tag) {
+ try {
+ periodHandler.tagToTime(tag);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
public boolean forceCreatingSnapshot() {
return timeExtractor instanceof ProcessTimeExtractor
&& (nextTag == null
@@ -122,7 +131,7 @@ public class TagAutoCreation {
nextTag = periodHandler.nextTagTime(thisTag);
if (numRetainedMax != null) {
- SortedMap<Snapshot, String> tags = tagManager.tags(t -> !t.startsWith("savepoint"));
+ SortedMap<Snapshot, String> tags = tagManager.tags(this::isAutoTag);
if (tags.size() > numRetainedMax) {
int toDelete = tags.size() - numRetainedMax;
int i = 0;