Skip to content

Commit

Permalink
chore: comment out LOG for streamInsert()
Browse files Browse the repository at this point in the history
  • Loading branch information
hishidama committed Aug 13, 2024
1 parent ea6a3b0 commit 54b0346
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;

import org.slf4j.Logger;
Expand Down Expand Up @@ -162,7 +161,7 @@ private void executeAllInTransaction() {
}

private void streamInsert(Stream<CostMaster> stream, LocalDateTime now) {
var count = new AtomicInteger(0);
// var count = new AtomicInteger(0);
var dao = dbManager.getStockHistoryDao();
final int batchSize = 10000;
var list = new ArrayList<StockHistory>(batchSize);
Expand All @@ -178,15 +177,15 @@ private void streamInsert(Stream<CostMaster> stream, LocalDateTime now) {
list.add(entity);
if (list.size() >= batchSize) {
dao.insertBatch(list);
count.addAndGet(list.size());
LOG.info("streamInsert() inserted {}", count.get());
// count.addAndGet(list.size());
// LOG.info("streamInsert() inserted {}", count.get());
list.clear();
}
});
if (!list.isEmpty()) {
dao.insertBatch(list);
count.addAndGet(list.size());
LOG.info("streamInsert() inserted {}", count.get());
// count.addAndGet(list.size());
// LOG.info("streamInsert() inserted {}", count.get());
}
}

Expand Down

0 comments on commit 54b0346

Please sign in to comment.