xunliu commented on code in PR #4267:
URL: https://github.com/apache/gravitino/pull/4267#discussion_r1691545001


##########
integration-test-common/src/test/java/org/apache/gravitino/integration/test/container/ContainerSuite.java:
##########
@@ -98,29 +101,47 @@ public Network getNetwork() {
   }
 
   public void startHiveContainer() {
-    startHiveContainer(
-        ImmutableMap.<String, String>builder().put("HADOOP_USER_NAME", 
"anonymous").build());
+    if (hiveContainer == null) {
+      synchronized (ContainerSuite.class) {
+        if (hiveContainer == null) {
+          // Start Hive container
+          HiveContainer.Builder hiveBuilder =
+              HiveContainer.builder()
+                  .withHostName("gravitino-ci-hive")
+                  .withEnvVars(
+                      ImmutableMap.<String, String>builder()
+                          .put("HADOOP_USER_NAME", "anonymous")
+                          .build())
+                  .withNetwork(network);
+          HiveContainer container = closer.register(hiveBuilder.build());
+          container.start();
+          hiveContainer = container;
+        }
+      }
+    }
   }
 
   /**
-   * To start the Hive container, you can to specify environment variables: 
HIVE_RUNTIME_VERSION:
-   * Hive version, currently support `hive2`(default) and `hive3` 
DOCKER_ENV_RANGER_SERVER_URL:
-   * Ranger server URL DOCKER_ENV_RANGER_HIVE_REPOSITORY_NAME: Ranger Hive 
repository name
-   * DOCKER_ENV_RANGER_HDFS_REPOSITORY_NAME: Ranger HDFS repository name
+   * To start the enable ranger plugin's Hive container, <br>
+   * you can to specify environment variables: <br>
+   * 1. HIVE_RUNTIME_VERSION: Hive version, currently support `hive2`(default) 
and `hive3` <br>
+   * 2. DOCKER_ENV_RANGER_SERVER_URL: Ranger server URL <br>
+   * 3. DOCKER_ENV_RANGER_HIVE_REPOSITORY_NAME: Ranger Hive repository name 
<br>
+   * 4. DOCKER_ENV_RANGER_HDFS_REPOSITORY_NAME: Ranger HDFS repository name 
<br>
    */
-  public void startHiveContainer(Map<String, String> envVars) {
-    if (hiveContainer == null) {
+  public void startHiveRangerContainer(Map<String, String> envVars) {

Review Comment:
   > BTW, is the `HIVE_RUNTIME_VERSION` must be `hive3`? since it uses Ranger 
plugin
   
   Yes, Only Hive3 supports Ranger2.4.0.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to