slfan1989 commented on code in PR #4858:
URL: https://github.com/apache/hadoop/pull/4858#discussion_r971425926
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/test/java/org/apache/hadoop/yarn/server/federation/store/impl/HSQLDBFederationStateStore.java:
##########
@@ -356,4 +376,31 @@ public void closeConnection() {
}
}
+ /**
+ * Extract The Create Table Sql From The Script.
+ *
+ * @param dbIdentifier database identifier, Like Mysql / SqlServer
+ * @param regex the regex
+ * @throws IOException IO exception.
+ */
+ protected void extractCreateTableSQL(String dbIdentifier, String regex)
throws IOException {
+ String createTableScriptPath = "." + File.separator + "target" +
File.separator +
Review Comment:
Thanks for your suggestion, I will modify the code.
I found that if I use string.format, the code readability doesn't seem to be
very good
```
String.format(".%starget%stest-classes%s%s%sFederationStateStoreTables.sql");
```
I think it might be better to write the following.
```
String[] createTableScriptPathItem = new String[] {
".", "target", "test-classes", dbIdentifier,
"FederationStateStoreTables.sql" };
String createTableScriptPath = StringUtils.join(createTableScriptPathItem,
File.separator);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]