-
Notifications
You must be signed in to change notification settings - Fork 337
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
[#3856] feat(core): Support embedded JDBC storage backend #3922
Conversation
core/src/main/java/com/datastrato/gravitino/storage/relational/EmbeddedJDBCBackend.java
Outdated
Show resolved
Hide resolved
.create(); | ||
|
||
public static final ConfigEntry<String> ENTRY_RELATIONAL_JDBC_BACKEND_PATH = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it "ENTRY" or "ENTITY" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENTITY
core/src/main/java/com/datastrato/gravitino/storage/relational/JDBCBackend.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastrato/gravitino/storage/relational/JDBCBackend.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private static void initH2Backend( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest you have new class to handle H2 related initialization things, not doing these here. Also to see if you can refactor to avoid using switch case here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, if you have time, please take another look.
core/src/main/java/com/datastrato/gravitino/storage/relational/JDBCDatabase.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastrato/gravitino/storage/relational/backend/H2Database.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastrato/gravitino/storage/relational/backend/H2Database.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/datastrato/gravitino/storage/relational/backend/H2Database.java
Outdated
Show resolved
Hide resolved
@@ -66,6 +69,17 @@ private Configs() {} | |||
public static final String DEFAULT_KV_ROCKSDB_BACKEND_PATH = | |||
String.join(File.separator, System.getenv("GRAVITINO_HOME"), "data", "rocksdb"); | |||
|
|||
public static final String DEFAULT_RELATIONAL_JDBC_BACKEND_PATH = | |||
String.join(File.separator, System.getenv("GRAVITINO_HOME"), "data", "jdbc"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to use "h2" not "jdbc" for db path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very sure h2
is a good name for the directory name as it's the default value of all JDBC database, assuming we are using SQLite as the database backend and using the default backend path, so the name is still h2
, it's very puzzling.
What changes were proposed in this pull request?
Add support for an embedded JDBC storage backend.
Why are the changes needed?
We plan to replace RocksDB KV backend with an embedded JDBC backend as the default storage backend.
Fix: #3856
Does this PR introduce any user-facing change?
N/A
How was this patch tested?
Existing UT