prashantwason commented on a change in pull request #4739:
URL: https://github.com/apache/hudi/pull/4739#discussion_r799238795



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieCreateHandle.java
##########
@@ -235,19 +235,18 @@ protected void setupWriteStatus() throws IOException {
     stat.setPrevCommit(HoodieWriteStat.NULL_COMMIT);
     stat.setFileId(writeStatus.getFileId());
     stat.setPath(new Path(config.getBasePath()), path);
-    stat.setTotalWriteBytes(computeTotalWriteBytes());
-    stat.setFileSizeInBytes(computeFileSizeInBytes());
     stat.setTotalWriteErrors(writeStatus.getTotalErrorRecords());
+
+    long totalWrittenBytes = computeTotalWrittenBytes();
+    stat.setTotalWriteBytes(totalWrittenBytes);
+    stat.setFileSizeInBytes(totalWrittenBytes);
+
     RuntimeStats runtimeStats = new RuntimeStats();
     runtimeStats.setTotalCreateTime(timer.endTimer());
     stat.setRuntimeStats(runtimeStats);
   }
 
-  protected long computeTotalWriteBytes() throws IOException {
-    return FSUtils.getFileSize(fs, path);
-  }
-
-  protected long computeFileSizeInBytes() throws IOException {
+  protected long computeTotalWrittenBytes() throws IOException {

Review comment:
       computeFileSizeInBytes is a better name here and matches the 
FSUtils.getFileSize.
   
   It is an internal details that for CreateHandle the total written bytes will 
be equal to the file size. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to