[ 
https://issues.apache.org/jira/browse/HDDS-1189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16804021#comment-16804021
 ] 

Yiqun Lin commented on HDDS-1189:
---------------------------------

Thanks for working on this, [~swagle]. Overall looks good, some initial 
comments from me:

*JooqCodeGenerator*
 1.
{code:java}
*+import com.google.inject.Injector;
+import com.google.inject.Provider;
+
+public class JooqCodeGenerator {*
{code}
Can we add the javadoc for this class?

2.
{code:java}
 public static void main(String[] args) {
+    if (args.length < 1) {
+      throw new ExceptionInInitializerError("Missing required arguments: " +
+          "Need a ouput directory for generated code.\nUsage: " +
+          "org.apache.hadoop.ozone.recon.persistence.JooqCodeGenerator " +
+          "<outputDirectory>.");
+    }
+    
     ...
+    // Cleanup resources
+    LocalDataSourceProvider.cleanup();
+  }
{code}
Can I understand this as the test program? If so, how about move this logic 
into an independent unit test?

*ReconSchemaDefinition/UtilizationSchemaDefinition*
{code:java}
+public interface ReconSchemaDefinition {
+
+  /**
+   * Execute DDL that will create Recon schema.
+   */
+  void initializeSchema() throws SQLException;
+}
{code}
Can we refactor these interfaces and newly add create/select/update/delete 
operations and implement them
 in subclasses? These interfaces will be invoked when we do CRUD operations.

*ReconServerConfigKeys*
{code:java}
       "recon.om.connection.request.timeout";
+  
   public static final String RECON_OM_CONNECTION_REQUEST_TIMEOUT_DEFAULT = 
"5s";
{code}
This line can be reverted, seems not related.

*TestUtilizationSchemaDefinition#testReconSchemaCreated*
 Besides the the field we defined, can we check the primary key for the 
CLUSTER_GROWTH_DAILY_TABLE_NAME table as well?

I noted one thing that current patch only defines the table of 
{{cluster_growth_daily}}, however there are many tables definitions in design 
doc. What's the plan for completing this?

> Recon Aggregate DB schema and ORM
> ---------------------------------
>
>                 Key: HDDS-1189
>                 URL: https://issues.apache.org/jira/browse/HDDS-1189
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>    Affects Versions: 0.5.0
>            Reporter: Siddharth Wagle
>            Assignee: Siddharth Wagle
>            Priority: Major
>             Fix For: 0.5.0
>
>         Attachments: HDDS-1189.01.patch, HDDS-1189.02.patch
>
>
> _Objectives_
> - Define V1 of the db schema for recon service
> - The current proposal is to use jOOQ as the ORM for SQL interaction. For two 
> main reasons: a) powerful DSL for querying, that abstracts out SQL dialects, 
> b) Allows code to schema and schema to code seamless transition, critical for 
> creating DDL through the code and unit testing across versions of the 
> application.
> - Add e2e unit tests suite for Recon entities, created based on the design doc



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to