Skip to content
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

Merged
merged 16 commits into from
Jun 27, 2024

Conversation

yuqi1129
Copy link
Contributor

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

@yuqi1129 yuqi1129 self-assigned this Jun 20, 2024
@yuqi1129 yuqi1129 requested review from qqqttt123, mchades, lw-yang and FANNG1 and removed request for lw-yang June 25, 2024 12:10
.create();

public static final ConfigEntry<String> ENTRY_RELATIONAL_JDBC_BACKEND_PATH =
Copy link
Contributor

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?

Copy link
Contributor Author

@yuqi1129 yuqi1129 Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENTITY

}
}

private static void initH2Backend(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -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");
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@jerryshao jerryshao merged commit f5f092f into apache:main Jun 27, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support embedded JDBC databases like Derby, SQLite and MariaDB Emebeded or so as Gravitino JDBC backend.
4 participants