Skip to content

[MINOR] feat(core): Support cached Entity Store. #7172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 29 commits into
base: branch-metadata-authz
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2db6db0
[MINOR] feat(core): Support global cache
Abyss-lord Apr 29, 2025
294c04d
[MINOR] feat(core): Support global cache
Abyss-lord Apr 29, 2025
03e8f2c
[MINOR] feat(core): Support global cache
Abyss-lord Apr 29, 2025
9ab8880
[MINOR] feat(core): Support global cache
Abyss-lord Apr 29, 2025
a6a7e16
[MINOR] feat(core): Support global cache
Abyss-lord Apr 29, 2025
d59e72b
[MINOR] feat(core): Support global cache
Abyss-lord Apr 30, 2025
f9d6865
[MINOR] feat(core): Support global cache
Abyss-lord May 1, 2025
8f9530e
[MINOR] feat(core): Support global cache
Abyss-lord May 1, 2025
98c02b8
[MINOR] feat(core): Support global cache
Abyss-lord May 1, 2025
04bb44a
[MINOR] feat(core): Support global cache
Abyss-lord May 2, 2025
9b02150
[MINOR] feat(core): Support global cache
Abyss-lord May 3, 2025
5ea5144
[MINOR] feat(core): Support global cache
Abyss-lord May 6, 2025
d353bf1
[MINOR] feat(core): Support global cache
Abyss-lord May 6, 2025
2702207
[MINOR] feat(core): Support global cache
Abyss-lord May 9, 2025
54cff76
[MINOR] feat(core): Support global cache
Abyss-lord May 9, 2025
1d4db05
[MINOR] feat(core): Support global cache
Abyss-lord May 9, 2025
07cb50d
[MINOR] feat(core): Support global cache
Abyss-lord May 9, 2025
81990ca
[MINOR] feat(core): Support global cache
Abyss-lord May 9, 2025
aa4c2c7
[MINOR] feat(core): Support global cache
Abyss-lord May 12, 2025
0ea446c
[MINOR] feat(core): Support global cache
Abyss-lord May 12, 2025
03b10c3
[MINOR] feat(core): Support global cache
Abyss-lord May 12, 2025
ae224d2
[MINOR] feat(core): Support global cache
Abyss-lord May 13, 2025
7fa8d8a
[MINOR] feat(core): Support global cache
Abyss-lord Apr 22, 2025
14de45d
[MINOR] feat(core): Support cached Entity Store.
Abyss-lord May 16, 2025
fb1a75f
[MINOR] feat(core): Support cached Entity Store.
Abyss-lord May 16, 2025
c46c539
[MINOR] feat(core): Support cached Entity Store.
Abyss-lord May 16, 2025
dfbdf70
[MINOR] feat(core): Support cached Entity Store.
Abyss-lord May 16, 2025
f003e12
[MINOR] feat(core): Support cached Entity Store.
Abyss-lord May 16, 2025
e478b07
[MINOR] feat(core): Support cached Entity Store.
Abyss-lord May 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
implementation(libs.guava)
implementation(libs.h2db)
implementation(libs.mybatis)
implementation(libs.concurrent.trees)

annotationProcessor(libs.lombok)

Expand Down
12 changes: 12 additions & 0 deletions core/src/main/java/org/apache/gravitino/GravitinoEnv.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import org.apache.gravitino.authorization.FutureGrantManager;
import org.apache.gravitino.authorization.OwnerManager;
import org.apache.gravitino.auxiliary.AuxiliaryServiceManager;
import org.apache.gravitino.cache.CacheConfig;
import org.apache.gravitino.cache.CaffeineMetaCache;
import org.apache.gravitino.cache.MetaCache;
import org.apache.gravitino.catalog.CatalogDispatcher;
import org.apache.gravitino.catalog.CatalogManager;
import org.apache.gravitino.catalog.CatalogNormalizeDispatcher;
Expand Down Expand Up @@ -74,6 +77,7 @@
import org.apache.gravitino.metrics.source.JVMMetricsSource;
import org.apache.gravitino.storage.IdGenerator;
import org.apache.gravitino.storage.RandomIdGenerator;
import org.apache.gravitino.storage.relational.CachedEntityStore;
import org.apache.gravitino.tag.TagDispatcher;
import org.apache.gravitino.tag.TagManager;
import org.slf4j.Logger;
Expand Down Expand Up @@ -133,6 +137,7 @@ public class GravitinoEnv {
private EventBus eventBus;
private OwnerManager ownerManager;
private FutureGrantManager futureGrantManager;
private MetaCache metaCache;

protected GravitinoEnv() {}

Expand Down Expand Up @@ -354,6 +359,10 @@ public FutureGrantManager futureGrantManager() {
return futureGrantManager;
}

public MetaCache metaCache() {
return metaCache;
}

public void start() {
metricsSystem.start();
eventListenerManager.start();
Expand Down Expand Up @@ -418,6 +427,9 @@ private void initGravitinoServerComponents() {
// Initialize EntityStore
this.entityStore = EntityStoreFactory.createEntityStore(config);
entityStore.initialize(config);
// TODO make it configurable
this.metaCache = CaffeineMetaCache.getInstance(new CacheConfig(), entityStore);
this.entityStore = new CachedEntityStore(entityStore, metaCache);

// create and initialize a random id generator
this.idGenerator = new RandomIdGenerator();
Expand Down
Loading
Loading