|
@@ -66,7 +66,7 @@ public class TableStoreUtils {
|
|
|
taskExecutor = new ThreadPoolTaskExecutor();
|
|
|
//设置线程池参数
|
|
|
taskExecutor.setCorePoolSize(1);
|
|
|
- taskExecutor.setMaxPoolSize(100);
|
|
|
+ taskExecutor.setMaxPoolSize(10);
|
|
|
taskExecutor.setQueueCapacity(10000);
|
|
|
taskExecutor.initialize();
|
|
|
}
|
|
@@ -145,12 +145,20 @@ public class TableStoreUtils {
|
|
|
List<List<String>> pkValuePartitionList = ListUtils.partition(pkValueList, MAX_COUNT_ONCE);
|
|
|
List<List<List<Column>>> columnsPartitionList = ListUtils.partition(columnsList, MAX_COUNT_ONCE);
|
|
|
|
|
|
+ log.info("batchPutRow 拆分任务数:"+pkValuePartitionList.size());
|
|
|
+
|
|
|
//丢给执行器去多线程执行
|
|
|
for(int i=0;i<pkValuePartitionList.size();i++){
|
|
|
+ final int num = i;
|
|
|
List<String> tempPkList = pkValuePartitionList.get(i);
|
|
|
List<List<Column>> tempColumnsList = columnsPartitionList.get(i);
|
|
|
taskExecutor.execute(()->{
|
|
|
+ long begin = System.currentTimeMillis();
|
|
|
+ log.info("第"+num+"个任务开始");
|
|
|
doBatchPutRow(primaryKeyName,tempPkList,tableName,tempColumnsList);
|
|
|
+ long end = System.currentTimeMillis();
|
|
|
+ log.info("第"+num+"个任务结束,耗时"+(end-begin));
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
}
|