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 03:18:53 UTC

[GitHub] [hadoop-ozone] avijayanhwx opened a new pull request #839: HDDS-3411. Switch Recon SQL DB to Derby.

avijayanhwx opened a new pull request #839: HDDS-3411. Switch Recon SQL DB to Derby.
URL: https://github.com/apache/hadoop-ozone/pull/839
 
 
   ## What changes were proposed in this pull request?
   
   Recon currently uses Sqlite as its defacto SQL DB with an option to configure other JDBC compatible databases. However, on some platforms like the IBM power pc, this causes problems from compile time since it does not have the sqlite native driver. This task aims to change the default SQL DB used by Recon to Derby, but retains the out of the box support (no need to supply the driver) for Sqlite as well.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-3411
   
   ## How was this patch tested?
   Added unit tests.
   Manually tested on docker with Derby and Sqlite.
   Built the recon modules on IBM PPC host.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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_r410365218
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/ReconSqlDbConfig.java
 ##########
 @@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.hadoop.ozone.recon.codegen;
+
+import org.apache.hadoop.hdds.conf.Config;
+import org.apache.hadoop.hdds.conf.ConfigGroup;
+import org.apache.hadoop.hdds.conf.ConfigTag;
+import org.apache.hadoop.hdds.conf.ConfigType;
+
+/**
+ * The configuration class for the Recon SQL DB.
+ */
+@ConfigGroup(prefix = "ozone.recon.sql.db")
+public class ReconSqlDbConfig {
 
 Review comment:
   Yes, but the Java configuration based API is for new config items generally. The code looks at ozone-default.xml and also Java based configuration classes and creates a master list for the default xml during assembly.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r409983094
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/persistence/DefaultDataSourceProvider.java
 ##########
 @@ -43,14 +52,26 @@
    */
   @Override
   public DataSource get() {
 
 Review comment:
   This is actually an antipattern :-) Although I am guilty of this as well. Instead of the if were should have a DerbyDataSourceProvider, SqliteDataSourceProvider and Default one.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
elek 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_r410044876
 
 

 ##########
 File path: hadoop-ozone/recon/pom.xml
 ##########
 @@ -331,6 +331,11 @@
       <artifactId>bonecp</artifactId>
       <version>0.8.0.RELEASE</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <version>10.14.2.0</version>
+    </dependency>
     <dependency>
 
 Review comment:
   Thanks the patch @avijayanhwx 
   
   Can we remove old sqlite dependency from here and from `hadoop-ozone/dist/src/main/license/LICENSE.txt`?
   
   Is it still required?
   
   One other question: do you have any performance numbers between sqlite vs derby? (I don't think it's a big problem, just interested if you know sg.)

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r409982061
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/JooqCodeGenerator.java
 ##########
 @@ -55,10 +60,11 @@
   private static final Logger LOG =
       LoggerFactory.getLogger(JooqCodeGenerator.class);
 
-  private static final String SQLITE_DB =
-      System.getProperty("java.io.tmpdir") + "/recon-generated-schema";
-  private static final String JDBC_URL = "jdbc:sqlite:" + SQLITE_DB;
-
+  private static final String DB = Paths.get(
+      System.getProperty("java.io.tmpdir"),
+      "recon-generated-schema-" + Time.monotonicNow()).toString();
+  public static final String RECON_SCHEMA_NAME = "RECON";
 
 Review comment:
   Generally, schemas are lowercase.

----------------------------------------------------------------
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


[GitHub] [hadoop-ozone] vivekratnavel commented on issue #839: HDDS-3411. Switch Recon SQL DB to Derby.

Posted by GitBox <gi...@apache.org>.
vivekratnavel commented on issue #839: HDDS-3411. Switch Recon SQL DB to Derby.
URL: https://github.com/apache/hadoop-ozone/pull/839#issuecomment-615072063
 
 
   @avijayanhwx Thanks for working on this! Looks like the integration test failure might be related to this change.
   
   ```
   [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 23.674 s <<< FAILURE! - in org.apache.hadoop.ozone.recon.TestReconWithOzoneManager
   [ERROR] testOmDBSyncing(org.apache.hadoop.ozone.recon.TestReconWithOzoneManager)  Time elapsed: 0.491 s  <<< FAILURE!
   ```
   
   

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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_r410364420
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/JooqCodeGenerator.java
 ##########
 @@ -55,10 +60,11 @@
   private static final Logger LOG =
       LoggerFactory.getLogger(JooqCodeGenerator.class);
 
-  private static final String SQLITE_DB =
-      System.getProperty("java.io.tmpdir") + "/recon-generated-schema";
-  private static final String JDBC_URL = "jdbc:sqlite:" + SQLITE_DB;
-
+  private static final String DB = Paths.get(
+      System.getProperty("java.io.tmpdir"),
+      "recon-generated-schema-" + Time.monotonicNow()).toString();
+  public static final String RECON_SCHEMA_NAME = "RECON";
 
 Review comment:
   Yes, but internally, I found that it becomes uppercase in the DB metadata. Hence, if I keep it as "recon", I have to do .toUpperCase() in Jooq code gen setSchemaName for it to find our classes. 

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
vivekratnavel 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_r410020988
 
 

 ##########
 File path: hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/persistence/TestReconWithDifferentSqlDBs.java
 ##########
 @@ -0,0 +1,142 @@
+package org.apache.hadoop.ozone.recon.persistence;
 
 Review comment:
   License is missing.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r409982227
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/JooqCodeGenerator.java
 ##########
 @@ -55,10 +60,11 @@
   private static final Logger LOG =
       LoggerFactory.getLogger(JooqCodeGenerator.class);
 
-  private static final String SQLITE_DB =
-      System.getProperty("java.io.tmpdir") + "/recon-generated-schema";
-  private static final String JDBC_URL = "jdbc:sqlite:" + SQLITE_DB;
-
+  private static final String DB = Paths.get(
+      System.getProperty("java.io.tmpdir"),
+      "recon-generated-schema-" + Time.monotonicNow()).toString();
 
 Review comment:
   Any reason to use a timestamp-based path?

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r409983094
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/persistence/DefaultDataSourceProvider.java
 ##########
 @@ -43,14 +52,26 @@
    */
   @Override
   public DataSource get() {
 
 Review comment:
   This is actually an antipattern :-) Although I am guilty of this as well. Instead of the if we should have a DerbyDataSourceProvider, SqliteDataSourceProvider and Default one. Can be left as a TODO for later as well, upto you.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r409983094
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/persistence/DefaultDataSourceProvider.java
 ##########
 @@ -43,14 +52,26 @@
    */
   @Override
   public DataSource get() {
 
 Review comment:
   This is actually an antipattern :-) Although I am guilty of this as well. Instead of the if were should have a DerbyDataSourceProvider, SqliteDataSourceProvider and Default one. Can be left as a TODO for later as well, upto you.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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_r410361299
 
 

 ##########
 File path: hadoop-ozone/recon/src/test/java/org/apache/hadoop/ozone/recon/persistence/TestReconWithDifferentSqlDBs.java
 ##########
 @@ -0,0 +1,142 @@
+package org.apache.hadoop.ozone.recon.persistence;
 
 Review comment:
   Thanks, will fix it. 

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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_r410363247
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/persistence/DefaultDataSourceProvider.java
 ##########
 @@ -43,14 +52,26 @@
    */
   @Override
   public DataSource get() {
 
 Review comment:
   Yeah, I agree. Will look into this change. Maybe I can create 2 different datasource providers and re-use in the test.

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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_r410378043
 
 

 ##########
 File path: hadoop-ozone/recon/pom.xml
 ##########
 @@ -331,6 +331,11 @@
       <artifactId>bonecp</artifactId>
       <version>0.8.0.RELEASE</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.derby</groupId>
+      <artifactId>derby</artifactId>
+      <version>10.14.2.0</version>
+    </dependency>
     <dependency>
 
 Review comment:
   @elek Thanks for the review.  We have not done perf testing on our SQL DB yet since we don't have a scale issue there (hopefully :) ) We will take up a task to try perf analysis between the 2 DBs. Until then, we can assume the performance between Derby vs Sqlite is similar as seen in some online references. 
   
   Regarding the sqlite dependency that has been left around, I wanted to retain the out of the box support for sqlite in Recon (without JAR being supplied by the user). Also, we have sqlite JAR dependency in the unit tests.  

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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_r410363859
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/JooqCodeGenerator.java
 ##########
 @@ -55,10 +60,11 @@
   private static final Logger LOG =
       LoggerFactory.getLogger(JooqCodeGenerator.class);
 
-  private static final String SQLITE_DB =
-      System.getProperty("java.io.tmpdir") + "/recon-generated-schema";
-  private static final String JDBC_URL = "jdbc:sqlite:" + SQLITE_DB;
-
+  private static final String DB = Paths.get(
+      System.getProperty("java.io.tmpdir"),
+      "recon-generated-schema-" + Time.monotonicNow()).toString();
 
 Review comment:
   If we have a failed build on a host (which I experienced), re-building fails with database already found always. 

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
swagle 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_r409981449
 
 

 ##########
 File path: hadoop-ozone/recon-codegen/src/main/java/org/hadoop/ozone/recon/codegen/ReconSqlDbConfig.java
 ##########
 @@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.hadoop.ozone.recon.codegen;
+
+import org.apache.hadoop.hdds.conf.Config;
+import org.apache.hadoop.hdds.conf.ConfigGroup;
+import org.apache.hadoop.hdds.conf.ConfigTag;
+import org.apache.hadoop.hdds.conf.ConfigType;
+
+/**
+ * The configuration class for the Recon SQL DB.
+ */
+@ConfigGroup(prefix = "ozone.recon.sql.db")
+public class ReconSqlDbConfig {
 
 Review comment:
   Why does this class only provide 1 configuration item? The JooqPersistence module properties should not be moved here?

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
vivekratnavel 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_r410021431
 
 

 ##########
 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:
   Why should we set schema name as user?

----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
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