in adb3client/src/main/java/com/alibaba/cloud/analyticdb/adb3client/impl/handler/PutActionHandler.java [159:187]
protected void doHandlePutAction(List<Record> list, WriteMode mode) throws AdbClientException {
dbExecutor.executeWithRetry(conn -> {
List<PreparedStatementWithBatchInfo> psArray = builder.buildStatements(conn, list.get(0).getSchema(), list.get(0).getTableName(), list, mode);
try {
long startTime = System.nanoTime() / 1000000L;
long bytes = 0L;
long batchCount = 0;
for (PreparedStatementWithBatchInfo ps : psArray) {
if (ps != null) {
if (ps.r) {
ps.l.executeBatch();
} else {
ps.l.execute();
}
}
bytes += ps.getByteSize();
batchCount += ps.getBatchCount();
}
} finally {
for (PreparedStatementWithBatchInfo ps : psArray) {
if (ps != null && ps.l != null) {
ps.l.close();
}
}
}
return null;
});
}