Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions chunjun-e2e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
</properties>

<dependencies>
<dependency>
<groupId>com.dtstack.chunjun</groupId>
<artifactId>chunjun-clients</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>

<!-- testcontainer-->
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand All @@ -30,15 +38,15 @@
</dependency>

<dependency>
<groupId>com.github.noraui</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
<groupId>org.testcontainers</groupId>
<artifactId>jdbc</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>jdbc</artifactId>
<artifactId>oracle-xe</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
</dependency>
Expand All @@ -58,16 +66,16 @@
</dependency>

<dependency>
<groupId>com.dtstack.chunjun</groupId>
<artifactId>chunjun-clients</artifactId>
<version>${project.version}</version>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.19</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.19</version>
<groupId>com.github.noraui</groupId>
<artifactId>ojdbc8</artifactId>
<version>12.2.0.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
package com.dtstack.chunjun.connector.entity;

import com.dtstack.chunjun.enums.ClusterMode;
import com.dtstack.chunjun.util.GsonUtil;

import com.google.gson.GsonBuilder;
import org.junit.Assert;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class LaunchCommandBuilder {
private List<String> commands;
Expand Down Expand Up @@ -55,6 +56,12 @@ public LaunchCommandBuilder withChunJunDistDir(String chunJunDistDir) {
return this;
}

public LaunchCommandBuilder withFlinkLibDir(String chunJunDistDir) {
commands.add("-flinkLibDir");
commands.add(chunJunDistDir);
return this;
}

public LaunchCommandBuilder withFlinkConfDir(String flinkConfDir) {
commands.add("-flinkConfDir");
commands.add(flinkConfDir);
Expand All @@ -63,13 +70,13 @@ public LaunchCommandBuilder withFlinkConfDir(String flinkConfDir) {

public LaunchCommandBuilder withFlinkCustomConf(Map<String, Object> properties) {
commands.add("-confProp");
commands.add(GsonUtil.GSON.toJson(properties));
commands.add(new GsonBuilder().create().toJson(properties));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use new Gson rather than GsonUtil.GSON?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ablove.

return this;
}

public LaunchCommandBuilder withAddJar(List<String> path) {
commands.add("-addjar");
commands.add(GsonUtil.GSON.toJson(path));
commands.add(new GsonBuilder().create().toJson(path));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use new Gson rather than GsonUtil.GSON?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this time, because GsonUtil uses prettyjson by default, when using the shell to submit, we cannot appear \r\n json data.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The json we use must be one line of data.

return this;
}

Expand All @@ -79,6 +86,18 @@ public LaunchCommandBuilder withShipFile(String path) {
return this;
}

public LaunchCommandBuilder withParameters(Map<String, String> parameters) {
if (parameters != null && !parameters.isEmpty()) {
commands.add("-p");
String params =
parameters.entrySet().stream()
.map(entry -> entry.getKey() + "=" + entry.getValue())
.collect(Collectors.joining(","));
commands.add(params);
}
return this;
}

public String[] builder() {
return commands.toArray(new String[0]);
}
Expand Down
Loading