-
Notifications
You must be signed in to change notification settings - Fork 415
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
[#6467] improve(core): Allow JDBC backend configs be configurable #6469
base: main
Are you sure you want to change the base?
Conversation
0b2769e
to
3b9872f
Compare
@yuqi1129 can you please help to review? |
public static final ConfigEntry<Integer> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = | ||
new ConfigBuilder(ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION_KEY) | ||
.doc("Max total connect of `JDBCBackend`") | ||
.version(ConfigConstants.VERSION_0_5_0) |
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.
The version should be 0.9 NOT 0.5
|
||
public static final ConfigEntry<Long> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION = | ||
new ConfigBuilder(ENTITY_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION_KEY) | ||
.doc("Max max wait millis of `JDBCBackend`") |
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.
ditto
All suggestions have been incorporated. Thank you for your thorough review! |
lgtm |
new ConfigBuilder(ENTITY_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION_KEY) | ||
.doc( | ||
"The maximum wait time in milliseconds for a connection from the JDBC Backend connection pool") | ||
.version(ConfigConstants.VERSION_0_5_0) |
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.
This should also be changed.
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.
OK
@TEOTEO520 |
974b2fc
to
727d369
Compare
public static final String ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION_KEY = | ||
"gravitino.entity.store.relational.max_connections"; | ||
|
||
public static final String ENTITY_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION_KEY = | ||
"gravitino.entity.store.relational.max_wait_millis"; |
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.
Please be aware that the configuration should be camel-style.
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.
OK, thank you for reviewing
@@ -137,6 +147,21 @@ private Configs() {} | |||
.stringConf() | |||
.createWithDefault(DEFAULT_RELATIONAL_JDBC_BACKEND_PASSWORD); | |||
|
|||
public static final ConfigEntry<Integer> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = |
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.
public static final ConfigEntry<Integer> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = | |
public static final ConfigEntry<Integer> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_CONNECTIONS = |
@@ -137,6 +147,21 @@ private Configs() {} | |||
.stringConf() | |||
.createWithDefault(DEFAULT_RELATIONAL_JDBC_BACKEND_PASSWORD); | |||
|
|||
public static final ConfigEntry<Integer> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = | |||
new ConfigBuilder(ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION_KEY) |
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.
new ConfigBuilder(ENTITY_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION_KEY) | |
new ConfigBuilder(ENTITY_RELATIONAL_JDBC_BACKEND_MAX_CONNECTION_KEYS) |
.intConf() | ||
.createWithDefault(DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION); | ||
|
||
public static final ConfigEntry<Long> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION = |
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.
public static final ConfigEntry<Long> ENTITY_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION = | |
public static final ConfigEntry<Long> ENTITY_RELATIONAL_JDBC_BACKEND_WAIT_MILLISECONDS = |
@@ -84,6 +90,10 @@ private Configs() {} | |||
|
|||
public static final String DEFAULT_RELATIONAL_JDBC_BACKEND_PASSWORD = "gravitino"; | |||
|
|||
public static final int DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = 100; |
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.
public static final int DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = 100; | |
public static final int DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_CONNECTIONS = 100; |
@@ -84,6 +90,10 @@ private Configs() {} | |||
|
|||
public static final String DEFAULT_RELATIONAL_JDBC_BACKEND_PASSWORD = "gravitino"; | |||
|
|||
public static final int DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_TOTAL_CONNECTION = 100; | |||
|
|||
public static final long DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION = 1000L; |
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.
public static final long DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLIS_CONNECTION = 1000L; | |
public static final long DEFAULT_RELATIONAL_JDBC_BACKEND_MAX_WAIT_MILLISECONDS = 1000L; |
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.
All of your suggestions have been adopted, thank you very much
lgtm |
@@ -381,6 +381,7 @@ protected String readGitCommitIdFromGitFile() { | |||
String gravitinoHome = System.getenv("GRAVITINO_HOME"); | |||
String gitFolder = gravitinoHome + File.separator + ".git" + File.separator; | |||
String headFileContent = FileUtils.readFileToString(new File(gitFolder + "HEAD"), "UTF-8"); | |||
LOG.error("\n\n\noooooooooooooooooooooooooooooooooooooooooooooooooooooo" + headFileContent); |
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.
Could remove this line?
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.
OK
I think you should also update the related documents about newly added configurations. |
b61add5
to
9aa62a3
Compare
done |
What changes were proposed in this pull request?
Add 2 user properties:
gravitino.entity.store.relational.max.total.connection
gravitino.entity.store.relational.max.wait.millis
Why are the changes needed?
To support users to configure JDBC connection pool parameters
Fix: #6467
Does this PR introduce any user-facing change?
No
How was this patch tested?
No need to test