-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[feat-#1204][e2e] Add Oracle Logminer E2E Test. #1205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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); | ||
|
|
@@ -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)); | ||
| return this; | ||
| } | ||
|
|
||
| public LaunchCommandBuilder withAddJar(List<String> path) { | ||
| commands.add("-addjar"); | ||
| commands.add(GsonUtil.GSON.toJson(path)); | ||
| commands.add(new GsonBuilder().create().toJson(path)); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use new Gson rather than GsonUtil.GSON?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The json we use must be one line of data. |
||
| return this; | ||
| } | ||
|
|
||
|
|
@@ -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]); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ablove.