This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new a4aa458403 [core] Cache outputBytes in SingleFileWriter
a4aa458403 is described below
commit a4aa458403eaada3fd3382367a1560438c728267
Author: JingsongLi <[email protected]>
AuthorDate: Fri Nov 7 15:52:48 2025 +0800
[core] Cache outputBytes in SingleFileWriter
---
paimon-core/src/main/java/org/apache/paimon/io/SingleFileWriter.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/paimon-core/src/main/java/org/apache/paimon/io/SingleFileWriter.java
b/paimon-core/src/main/java/org/apache/paimon/io/SingleFileWriter.java
index 936f2409af..5a810d716f 100644
--- a/paimon-core/src/main/java/org/apache/paimon/io/SingleFileWriter.java
+++ b/paimon-core/src/main/java/org/apache/paimon/io/SingleFileWriter.java
@@ -202,6 +202,9 @@ public abstract class SingleFileWriter<T, R> implements
FileWriter<T, R> {
}
protected long outputBytes() throws IOException {
- return outputBytes == null ? fileIO.getFileSize(path) : outputBytes;
+ if (outputBytes == null) {
+ outputBytes = fileIO.getFileSize(path);
+ }
+ return outputBytes;
}
}