Abacn commented on code in PR #37265:
URL: https://github.com/apache/beam/pull/37265#discussion_r3112088235


##########
sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopFileSystem.java:
##########
@@ -336,6 +337,27 @@ protected String getScheme() {
     return scheme;
   }
 
+  @Override
+  protected void reportLineage(HadoopResourceId resourceId, Lineage lineage) {

Review Comment:
   This duplicates base classes' default impl. We only need to override 
`reportLineage(HadoopResourceId resourceId, Lineage lineage, LineageLevel 
level)`



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSource.java:
##########
@@ -318,35 +317,10 @@ public final List<? extends FileBasedSource<T>> split(
     }
   }
 
-  /**
-   * Report source Lineage. Due to the size limit of Beam metrics, report full 
file name or only dir
-   * depend on the number of files.
-   *
-   * <p>- Number of files<=100, report full file paths;
-   *
-   * <p>- Number of directory<=100, report directory names (one level up);
-   *
-   * <p>- Otherwise, report top level only.
-   */
   private static void reportSourceLineage(List<Metadata> expandedFiles) {
-    if (expandedFiles.size() <= 100) {
-      for (Metadata metadata : expandedFiles) {
-        FileSystems.reportSourceLineage(metadata.resourceId());
-      }
-    } else {
-      HashSet<ResourceId> uniqueDirs = new HashSet<>();
-      for (Metadata metadata : expandedFiles) {
-        ResourceId dir = metadata.resourceId().getCurrentDirectory();
-        uniqueDirs.add(dir);
-        if (uniqueDirs.size() > 100) {
-          FileSystems.reportSourceLineage(dir, LineageLevel.TOP_LEVEL);
-          return;
-        }
-      }
-      for (ResourceId uniqueDir : uniqueDirs) {
-        FileSystems.reportSourceLineage(uniqueDir);
-      }
-    }
+    List<ResourceId> resourceIds =

Review Comment:
   Just make this public and add "internal use only...." comments. Not 
necessarily to move code around



-- 
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