[ 
https://issues.apache.org/jira/browse/HIVE-24120?focusedWorklogId=486308&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-486308
 ]

ASF GitHub Bot logged work on HIVE-24120:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Sep/20 17:41
            Start Date: 18/Sep/20 17:41
    Worklog Time Spent: 10m 
      Work Description: gatorblue commented on a change in pull request #1470:
URL: https://github.com/apache/hive/pull/1470#discussion_r491098079



##########
File path: 
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/DatabaseProduct.java
##########
@@ -20,71 +20,646 @@
 
 import java.sql.SQLException;
 import java.sql.SQLTransactionRollbackException;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
-/** Database product infered via JDBC. */
-public enum DatabaseProduct {
-  DERBY, MYSQL, POSTGRES, ORACLE, SQLSERVER, OTHER;
+import org.apache.hadoop.conf.Configurable;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.metastore.api.MetaException;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf;
+import org.apache.hadoop.hive.metastore.conf.MetastoreConf.ConfVars;
+import org.apache.hadoop.util.ReflectionUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+/** Database product inferred via JDBC. Encapsulates all SQL logic associated 
with
+ * the database product.
+ * This class is a singleton, which is instantiated the first time
+ * method determineDatabaseProduct is invoked.
+ * Tests that need to create multiple instances can use the reset method
+ * */
+public class DatabaseProduct implements Configurable {
+  static final private Logger LOG = 
LoggerFactory.getLogger(DatabaseProduct.class.getName());
+
+  private static enum DbType {DERBY, MYSQL, POSTGRES, ORACLE, SQLSERVER, 
EXTERNAL, OTHER};
+  public DbType dbType;
+  
+  // Singleton instance
+  private static DatabaseProduct theDatabaseProduct;
+
+  static {
+    final Configuration conf = MetastoreConf.newMetastoreConf();

Review comment:
       I'm adding the constructor, and the associated signature for method 
determineDatabaseProduct with the extra conf parameter. However, in places 
where determineDatabaseProduct is invoked, I don't see how to get a hold of the 
the HiveMetastore instance. Could you pls provide some pointer?




----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 486308)
    Time Spent: 0.5h  (was: 20m)

> Plugin for external DatabaseProduct in standalone HMS
> -----------------------------------------------------
>
>                 Key: HIVE-24120
>                 URL: https://issues.apache.org/jira/browse/HIVE-24120
>             Project: Hive
>          Issue Type: Improvement
>          Components: Standalone Metastore
>    Affects Versions: 3.1.1
>            Reporter: Gustavo Arocena
>            Assignee: Gustavo Arocena
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.0.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Add a pluggable way to support ANSI compliant databases as backends for 
> standalone HMS



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to