This is an automated email from the ASF dual-hosted git repository. rong pushed a commit to branch reduce-pipe-log in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 128b7745881f8192abb548cee3f082f72e356ce2 Author: Steve Yurong Su <[email protected]> AuthorDate: Thu May 30 11:59:26 2024 +0800 Pipe: Reduce pipe logs generated by PipeEventCommitter --- .../commons/pipe/progress/PipeEventCommitter.java | 44 ++++++++++++++-------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/progress/PipeEventCommitter.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/progress/PipeEventCommitter.java index 2dba84a3877..04502441daf 100644 --- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/progress/PipeEventCommitter.java +++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/progress/PipeEventCommitter.java @@ -63,14 +63,26 @@ public class PipeEventCommitter { public synchronized void commit(final EnrichedEvent event) { commitQueue.offer(event); - LOGGER.info( - "COMMIT QUEUE OFFER: pipe name {}, creation time {}, region id {}, event commit id {}, last commit id {}, commit queue size {}", - pipeName, - creationTime, - regionId, - event.getCommitId(), - lastCommitId.get(), - commitQueue.size()); + final int commitQueueSizeBeforeCommit = commitQueue.size(); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug( + "COMMIT QUEUE OFFER: pipe name {}, creation time {}, region id {}, event commit id {}, last commit id {}, commit queue size {}", + pipeName, + creationTime, + regionId, + event.getCommitId(), + lastCommitId.get(), + commitQueueSizeBeforeCommit); + } else if (commitQueueSizeBeforeCommit != 0 && commitQueueSizeBeforeCommit % 100 == 0) { + LOGGER.info( + "COMMIT QUEUE OFFER: pipe name {}, creation time {}, region id {}, event commit id {}, last commit id {}, commit queue size {}", + pipeName, + creationTime, + regionId, + event.getCommitId(), + lastCommitId.get(), + commitQueueSizeBeforeCommit); + } while (!commitQueue.isEmpty()) { final EnrichedEvent e = commitQueue.peek(); @@ -94,13 +106,15 @@ public class PipeEventCommitter { lastCommitId.incrementAndGet(); commitQueue.poll(); - LOGGER.info( - "COMMIT QUEUE POLL: pipe name {}, creation time {}, region id {}, last commit id {}, commit queue size after commit {}", - pipeName, - creationTime, - regionId, - lastCommitId.get(), - commitQueue.size()); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug( + "COMMIT QUEUE POLL: pipe name {}, creation time {}, region id {}, last commit id {}, commit queue size after commit {}", + pipeName, + creationTime, + regionId, + lastCommitId.get(), + commitQueue.size()); + } } }
