diff --git a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java index 905e8a7580..f374699678 100755 --- a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java +++ b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DBUtil.java @@ -872,10 +872,11 @@ public static IDataSourceFactoryGetter getWriterDataSourceFactoryGetter(Configur public static IDataSourceFactoryGetter getReaderDataSourceFactoryGetter(Configuration config, IJobContainerContext containerContext) { return getDataSourceFactoryGetter(config, containerContext, (res) -> { + final DBIdentity dbFactoryId = DBIdentity.parseId(config.getString(DataxUtils.DATASOURCE_FACTORY_IDENTITY)); return new IDataSourceFactoryGetter() { @Override public DataSourceFactory getDataSourceFactory() { - return TIS.getDataBasePlugin(new PostedDSProp(res.dbFactoryId)); + return TIS.getDataBasePlugin(new PostedDSProp(dbFactoryId)); } @Override @@ -893,14 +894,11 @@ private static IDataSourceFactoryGetter getDataSourceFactoryGetter( String dataXName = containerContext.getTISDataXName(); // originalConfig.getString(DataxUtils.DATAX_NAME); StoreResourceType resType = StoreResourceType.parse( originalConfig.getString(StoreResourceType.KEY_STORE_RESOURCE_TYPE)); - - final DBIdentity dbFactoryId = DBIdentity.parseId(originalConfig.getString(DataxUtils.DATASOURCE_FACTORY_IDENTITY)); - if (StringUtils.isEmpty(dataXName)) { throw new IllegalArgumentException("param dataXName:" + dataXName + "can not be null"); } try { - Object dataxPlugin = callable.apply(new DataXResourceName(() -> dataXName, resType, dbFactoryId)); + Object dataxPlugin = callable.apply(new DataXResourceName(() -> dataXName, resType)); Objects.requireNonNull(dataxPlugin, "dataXName:" + dataXName + " relevant instance can not be null"); if (!(dataxPlugin instanceof IDataSourceFactoryGetter)) { throw new IllegalStateException("dataxWriter:" + dataxPlugin.getClass() + " mus be type of " + IDataSourceFactoryGetter.class); diff --git a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataXResourceName.java b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataXResourceName.java index 622044c574..b88a430115 100644 --- a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataXResourceName.java +++ b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/util/DataXResourceName.java @@ -2,7 +2,6 @@ import com.qlangtech.tis.datax.IDataXNameAware; import com.qlangtech.tis.plugin.StoreResourceType; -import com.qlangtech.tis.plugin.ds.DBIdentity; /** * @author: 百岁(baisui@qlangtech.com) @@ -11,12 +10,12 @@ public class DataXResourceName { private final IDataXNameAware name; public final StoreResourceType resType; - public final DBIdentity dbFactoryId; + // public final DBIdentity dbFactoryId; - public DataXResourceName(IDataXNameAware name, StoreResourceType resType, DBIdentity dbFactoryId) { + public DataXResourceName(IDataXNameAware name, StoreResourceType resType) { this.name = name; this.resType = resType; - this.dbFactoryId = dbFactoryId; + // this.dbFactoryId = dbFactoryId; } public String getDataXName() {