|
|
|
@ -206,20 +206,30 @@ public class SqoopParameters extends AbstractParameters {
|
|
|
|
|
@Override |
|
|
|
|
public ResourceParametersHelper getResources() { |
|
|
|
|
ResourceParametersHelper resources = super.getResources(); |
|
|
|
|
if (SqoopJobType.TEMPLATE.getDescp().equals(this.getJobType())) { |
|
|
|
|
if (!SqoopJobType.TEMPLATE.getDescp().equals(this.getJobType())) { |
|
|
|
|
return resources; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SourceMysqlParameter sourceMysqlParameter = JSONUtils.parseObject(this.getSourceParams(), SourceMysqlParameter.class); |
|
|
|
|
TargetMysqlParameter targetMysqlParameter = JSONUtils.parseObject(this.getTargetParams(), TargetMysqlParameter.class); |
|
|
|
|
if (sourceMysqlParameter.getSrcDatasource() != 0) { |
|
|
|
|
resources.put(ResourceType.DATASOURCE, sourceMysqlParameter.getSrcDatasource()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TargetMysqlParameter targetMysqlParameter = JSONUtils.parseObject(this.getTargetParams(), TargetMysqlParameter.class); |
|
|
|
|
if (targetMysqlParameter.getTargetDatasource() != 0) { |
|
|
|
|
resources.put(ResourceType.DATASOURCE, targetMysqlParameter.getTargetDatasource()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return resources; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public SqoopTaskExecutionContext generateExtendedContext(ResourceParametersHelper parametersHelper) { |
|
|
|
|
|
|
|
|
|
SqoopTaskExecutionContext sqoopTaskExecutionContext = new SqoopTaskExecutionContext(); |
|
|
|
|
if (!SqoopJobType.TEMPLATE.getDescp().equals(this.getJobType())) { |
|
|
|
|
return sqoopTaskExecutionContext; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (SqoopJobType.TEMPLATE.getDescp().equals(this.getJobType())) { |
|
|
|
|
SourceMysqlParameter sourceMysqlParameter = JSONUtils.parseObject(this.getSourceParams(), SourceMysqlParameter.class); |
|
|
|
|
TargetMysqlParameter targetMysqlParameter = JSONUtils.parseObject(this.getTargetParams(), TargetMysqlParameter.class); |
|
|
|
|
|
|
|
|
@ -237,7 +247,6 @@ public class SqoopParameters extends AbstractParameters {
|
|
|
|
|
sqoopTaskExecutionContext.setTargetType(dataTarget.getType()); |
|
|
|
|
sqoopTaskExecutionContext.setTargetConnectionParams(dataTarget.getConnectionParams()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return sqoopTaskExecutionContext; |
|
|
|
|
} |
|
|
|
|