You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by et...@apache.org on 2024/01/11 03:09:39 UTC

(incubator-celeborn) branch main updated: [CELEBORN-1133][FOLLOWUP] Refactor FileInfo

This is an automated email from the ASF dual-hosted git repository.

ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 5f0a8406c [CELEBORN-1133][FOLLOWUP] Refactor FileInfo
5f0a8406c is described below

commit 5f0a8406c62211fcf275c0ba31d84e3c151517b5
Author: sychen <sy...@ctrip.com>
AuthorDate: Thu Jan 11 11:09:15 2024 +0800

    [CELEBORN-1133][FOLLOWUP] Refactor FileInfo
    
    ### What changes were proposed in this pull request?
    
    ### Why are the changes needed?
    ```
    common/src/main/java/org/apache/celeborn/common/meta/DiskFileInfo.java:[110,14] [MissingOverride] getFileLength implements method in FileInfo; expected Override
    common/src/main/java/org/apache/celeborn/common/meta/MapFileMeta.java:[40,38] [InconsistentCapitalization] Found the field 'numSubPartitions' with the same name as the parameter 'numSubpartitions' but with different capitalization.
    worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/MapPartitionDataWriter.java:[164,65] [UnnecessaryParentheses] These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    GA
    
    Closes #2222 from cxzl25/CELEBORN-1133-FOLLOWUP.
    
    Authored-by: sychen <sy...@ctrip.com>
    Signed-off-by: mingji <fe...@alibaba-inc.com>
---
 .../src/main/java/org/apache/celeborn/common/meta/DiskFileInfo.java   | 1 +
 common/src/main/java/org/apache/celeborn/common/meta/MapFileMeta.java | 4 ++--
 .../service/deploy/worker/storage/MapPartitionDataWriter.java         | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/src/main/java/org/apache/celeborn/common/meta/DiskFileInfo.java b/common/src/main/java/org/apache/celeborn/common/meta/DiskFileInfo.java
index a689e2ecb..ab10df2ec 100644
--- a/common/src/main/java/org/apache/celeborn/common/meta/DiskFileInfo.java
+++ b/common/src/main/java/org/apache/celeborn/common/meta/DiskFileInfo.java
@@ -107,6 +107,7 @@ public class DiskFileInfo extends FileInfo {
     }
   }
 
+  @Override
   public long getFileLength() {
     return bytesFlushed;
   }
diff --git a/common/src/main/java/org/apache/celeborn/common/meta/MapFileMeta.java b/common/src/main/java/org/apache/celeborn/common/meta/MapFileMeta.java
index 7c32cf1d5..cd5dfd868 100644
--- a/common/src/main/java/org/apache/celeborn/common/meta/MapFileMeta.java
+++ b/common/src/main/java/org/apache/celeborn/common/meta/MapFileMeta.java
@@ -37,8 +37,8 @@ public class MapFileMeta implements FileMeta {
     return numSubPartitions;
   }
 
-  public void setNumSubpartitions(int numSubpartitions) {
-    this.numSubPartitions = numSubpartitions;
+  public void setNumSubPartitions(int numSubPartitions) {
+    this.numSubPartitions = numSubPartitions;
   }
 
   public void setBufferSize(int bufferSize) {
diff --git a/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/MapPartitionDataWriter.java b/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/MapPartitionDataWriter.java
index 66200d24b..2ce0cbbc1 100644
--- a/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/MapPartitionDataWriter.java
+++ b/worker/src/main/java/org/apache/celeborn/service/deploy/worker/storage/MapPartitionDataWriter.java
@@ -161,7 +161,7 @@ public final class MapPartitionDataWriter extends PartitionDataWriter {
               deleted = true;
             } else {
               StorageManager.hadoopFs()
-                  .create(new Path(Utils.getWriteSuccessFilePath((diskFileInfo.getIndexPath()))))
+                  .create(new Path(Utils.getWriteSuccessFilePath(diskFileInfo.getIndexPath())))
                   .close();
             }
           }
@@ -185,7 +185,7 @@ public final class MapPartitionDataWriter extends PartitionDataWriter {
     numSubpartitionBytes = new long[numSubpartitions];
     MapFileMeta mapFileMeta = (MapFileMeta) diskFileInfo.getFileMeta();
     mapFileMeta.setBufferSize(bufferSize);
-    mapFileMeta.setNumSubpartitions(numSubpartitions);
+    mapFileMeta.setNumSubPartitions(numSubpartitions);
   }
 
   public void regionStart(int currentDataRegionIndex, boolean isBroadcastRegion) {