This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 903113b64 [MINOR] improvement(tez): Only invoking LOG.debug when
LOG.isDebugEnabled is true (#1541)
903113b64 is described below
commit 903113b64c32c165096aec5409fda08e94229d30
Author: RickyMa <[email protected]>
AuthorDate: Mon Feb 26 09:55:44 2024 +0800
[MINOR] improvement(tez): Only invoking LOG.debug when LOG.isDebugEnabled
is true (#1541)
### What changes were proposed in this pull request?
Only invoking LOG.debug when LOG.isDebugEnabled is true
### Why are the changes needed?
For https://github.com/apache/incubator-uniffle/issues/1201
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing UTs.
---
.../runtime/library/common/sort/buffer/WriteBuffer.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git
a/client-tez/src/main/java/org/apache/tez/runtime/library/common/sort/buffer/WriteBuffer.java
b/client-tez/src/main/java/org/apache/tez/runtime/library/common/sort/buffer/WriteBuffer.java
index 774c54e9f..43d784f1d 100644
---
a/client-tez/src/main/java/org/apache/tez/runtime/library/common/sort/buffer/WriteBuffer.java
+++
b/client-tez/src/main/java/org/apache/tez/runtime/library/common/sort/buffer/WriteBuffer.java
@@ -147,13 +147,15 @@ public class WriteBuffer<K, V> extends OutputStream {
private boolean compact(int lastIndex, int lastOffset, int dataLength) {
if (lastIndex != currentIndex) {
- LOG.debug(
- "compact lastIndex {}, currentIndex {}, lastOffset {} currentOffset
{} dataLength {}",
- lastIndex,
- currentIndex,
- lastOffset,
- currentOffset,
- dataLength);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug(
+ "compact lastIndex {}, currentIndex {}, lastOffset {}
currentOffset {} dataLength {}",
+ lastIndex,
+ currentIndex,
+ lastOffset,
+ currentOffset,
+ dataLength);
+ }
WrappedBuffer buffer = new WrappedBuffer(lastOffset + dataLength);
// copy data
int offset = 0;