Skip to content

Commit

Permalink
Trigger test.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuqi1129 committed Sep 4, 2024
1 parent bb9d1b8 commit 3531af7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/src/main/java/org/apache/gravitino/EntityStoreFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,21 @@ public static EntityStore createEntityStore(Config config) {
throw new RuntimeException("Failed to create and initialize EntityStore: " + name, e);
}
}

public static EntityStore createEntityStore(Config config) {
String name = config.get(Configs.ENTITY_STORE);
String className = ENTITY_STORES.getOrDefault(name, name);

if (KV_STORE_KEY.equals(name)) {
throw new UnsupportedOperationException(
"KvEntityStore is not supported since version 0.6.0. Please use RelationalEntityStore instead.");
}

try {
return (EntityStore) Class.forName(className).getDeclaredConstructor().newInstance();
} catch (Exception e) {
LOG.error("Failed to create and initialize EntityStore by name {}.", name, e);
throw new RuntimeException("Failed to create and initialize EntityStore: " + name, e);
}
}
}

0 comments on commit 3531af7

Please sign in to comment.