From af270c644bf6de064968157404d3380ab3107d8e Mon Sep 17 00:00:00 2001 From: lwj <3529558005@qq.com> Date: Sun, 8 Sep 2024 16:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B7=BB=E5=8A=A0=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/muyu/cloud/etl/service/impl/ProductServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/ProductServiceImpl.java b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/ProductServiceImpl.java index 5a9e87f..5a048e1 100644 --- a/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/ProductServiceImpl.java +++ b/cloud-etl-server/src/main/java/com/muyu/cloud/etl/service/impl/ProductServiceImpl.java @@ -179,6 +179,7 @@ public class ProductServiceImpl implements ProductService { HikariDataSource hikariDataSource = HikariPool.getHikariDataSource(dataSources); ExecutorService executorService = Executors.newFixedThreadPool(8); + AtomicInteger addCount = new AtomicInteger(); // 分割数据为3000个批次 @@ -189,6 +190,7 @@ public class ProductServiceImpl implements ProductService { for (DataValue[][] batch : batches) { log.info("数量batch{}", batch.length); + executorService.submit(() -> { try (Statement stmt = conn.createStatement()) { @@ -226,6 +228,8 @@ public class ProductServiceImpl implements ProductService { } private String buildBatchInsertSQL(String tableName, DataValue[][] batch) { + + log.info("陈思豪是傻逼"+tableName); StringBuilder columns = new StringBuilder("("); StringBuilder values = new StringBuilder("VALUES "); // 构建字段名