mchades commented on code in PR #4267:
URL: https://github.com/apache/gravitino/pull/4267#discussion_r1691595245
##########
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:
> This is the program used for CI and testers should be responsible for
their own parameters being correct. If every parameter is required to be
correct, is it still my job to help the developer check that this ranger server
is working and that the ranger HIVE/HDFS repository name is correct?
we can only check `DOCKER_ENV_RANGER_SERVER_URL` is not null, and
`HIVE_RUNTIME_VERSION=hive3`
--
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]