From e26f82ad769e2a3c915fe704bcef2a89c545bf76 Mon Sep 17 00:00:00 2001 From: mengxiaopeng <602012854@qq.com> Date: Wed, 12 Jul 2023 17:14:57 +0800 Subject: [PATCH] =?UTF-8?q?[improve][plugin][DRDS]=20The=20task=20of=20DRD?= =?UTF-8?q?S-Reader=20Big=20data=20fails=20with=20the=20following=20error?= =?UTF-8?q?=20=E3=80=90net=5Fwrite=5Ftimeout=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/rdbms/reader/CommonRdbmsReader.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java index f3180402..81d5b7f2 100755 --- a/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java +++ b/plugin-rdbms-util/src/main/java/com/alibaba/datax/plugin/rdbms/reader/CommonRdbmsReader.java @@ -27,10 +27,7 @@ import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.Types; +import java.sql.*; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -189,6 +186,18 @@ public class CommonRdbmsReader { DBUtil.dealWithSessionConfig(conn, readerSliceConfig, this.dataBaseType, basicMsg); + //deal with drds big data error net_write_timeout + if (DataBaseType.DRDS.equals(dataBaseType)){ + LOG.info("start DRDS setNetWorkTimeOut..."); + try { + conn.setNetworkTimeout(Executors.newFixedThreadPool(1), 172800000); + LOG.info("end DRDS setNetWorkTimeOut..."); + } catch (SQLException throwables) { + LOG.error("setNetWorkTimeOut error ["+throwables.getMessage()+"]"); + throwables.printStackTrace(); + } + } + int columnNumber = 0; ResultSet rs = null; try {