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