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

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

                Author: ASF GitHub Bot
            Created on: 13/Jan/22 14:03
            Start Date: 13/Jan/22 14:03
    Worklog Time Spent: 10m 
      Work Description: zabetak commented on a change in pull request #2919:
URL: https://github.com/apache/hive/pull/2919#discussion_r783985257



##########
File path: 
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/Mariadb.java
##########
@@ -18,19 +18,31 @@
 
 package org.apache.hadoop.hive.metastore.dbinstall.rules;
 
+import org.apache.hadoop.hive.metastore.dbinstall.AbstractDatabase;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-public class Mariadb extends DatabaseRule {
+public class Mariadb extends AbstractDatabase {
 
   @Override
   public String getDockerImageName() {
     return "mariadb:10.2";
   }
 
   @Override
-  public String[] getDockerAdditionalArgs() {
-    return buildArray("-p", "3306:3306", "-e", "MYSQL_ROOT_PASSWORD=" + 
getDbRootPassword(), "-d");
+  public String getDockerDatabaseArg() {
+    return "MARIADB_DATABASE=" + getDb();
+  }
+
+  @Override
+  public List<String> getDockerBaseArgs() {
+    return new ArrayList(Arrays.asList("-p", "3309:3306",

Review comment:
       I think that we could create a new list inside 
`AbstractDatabse.getDockerAdditionalArgs()` if necessary instead of modifying 
those that we obtain from the getters.




-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 708326)
    Time Spent: 1.5h  (was: 1h 20m)

> Unify code managing JDBC databases in tests
> -------------------------------------------
>
>                 Key: HIVE-25667
>                 URL: https://issues.apache.org/jira/browse/HIVE-25667
>             Project: Hive
>          Issue Type: Task
>          Components: Testing Infrastructure
>    Affects Versions: 4.0.0
>            Reporter: Stamatis Zampetakis
>            Assignee: Mark Bathori
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Currently there are two class hierarchies managing JDBC databases in tests, 
> [DatabaseRule|https://github.com/apache/hive/blob/d35de014dd49fdcfe0aacb68e6c587beff6d1dea/standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/dbinstall/rules/DatabaseRule.java]
>  and 
> [AbstractExternalDB|https://github.com/apache/hive/blob/d35de014dd49fdcfe0aacb68e6c587beff6d1dea/itests/util/src/main/java/org/apache/hadoop/hive/ql/externalDB/AbstractExternalDB.java].
>  There are many similarities between these hierarchies and certain parts are 
> duplicated. 
> The goal of this JIRA is to refactor the aforementioned hierarchies to reduce 
> code duplication and improve extensibility.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to