You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/17 17:17:41 UTC

[GitHub] [hadoop-ozone] avijayanhwx commented on a change in pull request #839: HDDS-3411. Switch Recon SQL DB to Derby.

avijayanhwx commented on a change in pull request #839: HDDS-3411. Switch Recon SQL DB to Derby.
URL: https://github.com/apache/hadoop-ozone/pull/839#discussion_r410361209
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/JooqCodeGenerator.java
 ##########
 @@ -109,20 +113,25 @@ private void generateSourceCode(String outputDir) throws Exception {
    * Provider for embedded datasource.
    */
   static class LocalDataSourceProvider implements Provider<DataSource> {
-    private static SQLiteDataSource db;
-
+    private static EmbeddedDataSource dataSource;
     static {
-      db = new SQLiteDataSource();
-      db.setUrl(JDBC_URL);
+      try {
+        createNewDerbyDatabase(JDBC_URL, RECON_SCHEMA_NAME);
+      } catch (Exception e) {
+        LOG.error("Error creating Recon Derby DB.", e);
+      }
+      dataSource = new EmbeddedDataSource();
+      dataSource.setDatabaseName(DB);
+      dataSource.setUser(RECON_SCHEMA_NAME);
 
 Review comment:
   In derby (at least), user name becomes the schema.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org