You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "Abyss-lord (via GitHub)" <gi...@apache.org> on 2025/06/24 02:48:43 UTC
[PR] [#7179] improvement(core): Remove old cached System [gravitino]
Abyss-lord opened a new pull request, #7459:
URL: https://github.com/apache/gravitino/pull/7459
### What changes were proposed in this pull request?
Remove old cached System.
### Why are the changes needed?
Fix: #7179
### Does this PR introduce _any_ user-facing change?
no.
### How was this patch tested?
local test.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades merged PR #7459:
URL: https://github.com/apache/gravitino/pull/7459
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "Abyss-lord (via GitHub)" <gi...@apache.org>.
Abyss-lord commented on PR #7459:
URL: https://github.com/apache/gravitino/pull/7459#issuecomment-2998896318
Hi @jerryshao , could you please review this PR when you have time? I’d really appreciate your feedback.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "Abyss-lord (via GitHub)" <gi...@apache.org>.
Abyss-lord commented on code in PR #7459:
URL: https://github.com/apache/gravitino/pull/7459#discussion_r2168042046
##########
catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java:
##########
@@ -217,28 +213,24 @@ public NameIdentifier[] listFilesets(Namespace namespace) throws NoSuchSchemaExc
@Override
public Fileset loadFileset(NameIdentifier ident) throws NoSuchFilesetException {
- return filesetCache.get(
- ident,
- k -> {
- try {
- FilesetEntity filesetEntity =
- store.get(ident, Entity.EntityType.FILESET, FilesetEntity.class);
-
- return FilesetImpl.builder()
- .withName(ident.name())
- .withType(filesetEntity.filesetType())
- .withComment(filesetEntity.comment())
- .withStorageLocations(filesetEntity.storageLocations())
- .withProperties(filesetEntity.properties())
- .withAuditInfo(filesetEntity.auditInfo())
- .build();
-
- } catch (NoSuchEntityException exception) {
- throw new NoSuchFilesetException(exception, FILESET_DOES_NOT_EXIST_MSG, ident);
- } catch (IOException ioe) {
- throw new RuntimeException("Failed to load fileset %s" + ident, ioe);
- }
- });
+ try {
+ FilesetEntity filesetEntity =
+ store.get(ident, Entity.EntityType.FILESET, FilesetEntity.class);
Review Comment:
> so the current cache is behind the store?
Yes — the cache is embedded inside `EntityStore` via the `get()` logic.
It handles caching transparently, so callers like `FilesetCatalogOperations` don’t need to manage caching themselves.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "mchades (via GitHub)" <gi...@apache.org>.
mchades commented on code in PR #7459:
URL: https://github.com/apache/gravitino/pull/7459#discussion_r2168039016
##########
catalogs/catalog-fileset/src/main/java/org/apache/gravitino/catalog/fileset/FilesetCatalogOperations.java:
##########
@@ -217,28 +213,24 @@ public NameIdentifier[] listFilesets(Namespace namespace) throws NoSuchSchemaExc
@Override
public Fileset loadFileset(NameIdentifier ident) throws NoSuchFilesetException {
- return filesetCache.get(
- ident,
- k -> {
- try {
- FilesetEntity filesetEntity =
- store.get(ident, Entity.EntityType.FILESET, FilesetEntity.class);
-
- return FilesetImpl.builder()
- .withName(ident.name())
- .withType(filesetEntity.filesetType())
- .withComment(filesetEntity.comment())
- .withStorageLocations(filesetEntity.storageLocations())
- .withProperties(filesetEntity.properties())
- .withAuditInfo(filesetEntity.auditInfo())
- .build();
-
- } catch (NoSuchEntityException exception) {
- throw new NoSuchFilesetException(exception, FILESET_DOES_NOT_EXIST_MSG, ident);
- } catch (IOException ioe) {
- throw new RuntimeException("Failed to load fileset %s" + ident, ioe);
- }
- });
+ try {
+ FilesetEntity filesetEntity =
+ store.get(ident, Entity.EntityType.FILESET, FilesetEntity.class);
Review Comment:
so the current cache is behind the store?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "yuqi1129 (via GitHub)" <gi...@apache.org>.
yuqi1129 commented on code in PR #7459:
URL: https://github.com/apache/gravitino/pull/7459#discussion_r2168224583
##########
core/src/main/java/org/apache/gravitino/metalake/MetalakeManager.java:
##########
@@ -103,13 +79,6 @@ public void close() {
public MetalakeManager(EntityStore store, IdGenerator idGenerator) {
this.store = store;
this.idGenerator = idGenerator;
-
- // pre-load all metalakes and put them into cache, this is useful when user load schema/table
- // directly without list/get metalake first.
- BaseMetalake[] metalakes = listMetalakes();
- for (BaseMetalake metalake : metalakes) {
- METALAKE_CACHE.put(metalake.nameIdentifier(), metalake);
- }
Review Comment:
Should we add similar logic here to maintain consistency with the current logic?
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "Abyss-lord (via GitHub)" <gi...@apache.org>.
Abyss-lord commented on code in PR #7459:
URL: https://github.com/apache/gravitino/pull/7459#discussion_r2168274094
##########
core/src/main/java/org/apache/gravitino/metalake/MetalakeManager.java:
##########
@@ -103,13 +79,6 @@ public void close() {
public MetalakeManager(EntityStore store, IdGenerator idGenerator) {
this.store = store;
this.idGenerator = idGenerator;
-
- // pre-load all metalakes and put them into cache, this is useful when user load schema/table
- // directly without list/get metalake first.
- BaseMetalake[] metalakes = listMetalakes();
- for (BaseMetalake metalake : metalakes) {
- METALAKE_CACHE.put(metalake.nameIdentifier(), metalake);
- }
Review Comment:
If we want to cache all Metalakes during initialization, we would need to modify the list method in the cache layer.
Currently, `EntityCache#list` does not perform any caching operation—it simply delegates to the underlying store.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#7179] improvement(core): Remove old cached System [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on PR #7459:
URL: https://github.com/apache/gravitino/pull/7459#issuecomment-3006920522
@yuqi1129 @mchades can you please help to review this PR.
--
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: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org