Browse Source

support datax custom config

pull/2/head
张世鸣 5 years ago
parent
commit
74708b3b84
  1. 1
      dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/utils/CheckUtilsTest.java
  2. 3
      dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java

1
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/utils/CheckUtilsTest.java

@ -211,6 +211,7 @@ public class CheckUtilsTest {
// DataxParameters // DataxParameters
DataxParameters dataxParameters = new DataxParameters(); DataxParameters dataxParameters = new DataxParameters();
assertFalse(CheckUtils.checkTaskNodeParameters(JSONUtils.toJsonString(dataxParameters), TaskType.DATAX.toString())); assertFalse(CheckUtils.checkTaskNodeParameters(JSONUtils.toJsonString(dataxParameters), TaskType.DATAX.toString()));
dataxParameters.setCustomConfig(0);
dataxParameters.setDataSource(111); dataxParameters.setDataSource(111);
dataxParameters.setDataTarget(333); dataxParameters.setDataTarget(333);
dataxParameters.setSql("sql"); dataxParameters.setSql("sql");

3
dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/task/datax/DataxParameters.java

@ -186,6 +186,7 @@ public class DataxParameters extends AbstractParameters {
@Override @Override
public boolean checkParameters() { public boolean checkParameters() {
if (customConfig == null) return false;
if (customConfig == 0) { if (customConfig == 0) {
return dataSource != 0 return dataSource != 0
&& dataTarget != 0 && dataTarget != 0
@ -204,7 +205,7 @@ public class DataxParameters extends AbstractParameters {
@Override @Override
public String toString() { public String toString() {
return "DataxParameters{" + return "DataxParameters{" +
"customConfig=" + customConfig + "customConfig=" + customConfig +
", json='" + json + '\'' + ", json='" + json + '\'' +
", dsType='" + dsType + '\'' + ", dsType='" + dsType + '\'' +
", dataSource=" + dataSource + ", dataSource=" + dataSource +

Loading…
Cancel
Save