Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Nov 21, 2024
1 parent 3701edd commit 9f8ab33
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
9 changes: 1 addition & 8 deletions paimon-core/src/main/java/org/apache/paimon/tag/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
import java.util.Map;
import java.util.Objects;

import static org.apache.paimon.utils.MetaCacheManager.TAG_CACHE;

/** Snapshot with tagCreateTime and tagTimeRetained. */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Tag extends Snapshot {
Expand Down Expand Up @@ -198,12 +196,7 @@ public static Tag fromPath(FileIO fileIO, Path path) {

public static Tag tryFromPath(FileIO fileIO, Path path) throws FileNotFoundException {
try {
Tag tag = TAG_CACHE.getIfPresent(path);
if (tag == null) {
tag = fromJson(fileIO.readFileUtf8(path));
TAG_CACHE.put(path, tag);
}
return tag;
return fromJson(fileIO.readFileUtf8(path));
} catch (FileNotFoundException e) {
throw e;
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ public class MetaCacheManager {
.executor(Runnable::run)
.build();

public static final Cache<Path, Tag> TAG_CACHE =
Caffeine.newBuilder()
.softValues()
.expireAfterAccess(Duration.ofMinutes(10))
.maximumSize(100)
.executor(Runnable::run)
.build();

public static final Cache<Path, TableSchema> SCHEMA_CACHE =
Caffeine.newBuilder()
.softValues()
Expand All @@ -60,7 +52,6 @@ public class MetaCacheManager {
public static void invalidateCacheForPrefix(Path tablePath) {
String path = tablePath.toString();
invalidateCacheForPrefix(SNAPSHOT_CACHE, path);
invalidateCacheForPrefix(TAG_CACHE, path);
invalidateCacheForPrefix(SCHEMA_CACHE, path);
}

Expand Down

0 comments on commit 9f8ab33

Please sign in to comment.