[ 
https://issues.apache.org/jira/browse/GOBBLIN-1919?focusedWorklogId=887451&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-887451
 ]

ASF GitHub Bot logged work on GOBBLIN-1919:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Oct/23 19:33
            Start Date: 26/Oct/23 19:33
    Worklog Time Spent: 10m 
      Work Description: Will-Lo commented on code in PR #3784:
URL: https://github.com/apache/gobblin/pull/3784#discussion_r1373724345


##########
gobblin-utility/src/main/java/org/apache/gobblin/util/JobLauncherUtils.java:
##########
@@ -123,6 +126,20 @@ public static List<WorkUnit> 
flattenWorkUnits(Collection<WorkUnit> workUnits) {
     return flattenedWorkUnits;
   }
 
+  /** @return flattened list of {@link WorkUnit}s loaded from `path`, which 
may possibly hold a multi-work unit */
+  public static List<WorkUnit> loadFlattenedWorkUnits(FileSystem fs, Path 
path) throws IOException {
+    WorkUnit workUnit = path.getName().endsWith(MULTI_WORK_UNIT_FILE_EXTENSION)
+        ? MultiWorkUnit.createEmpty()
+        : WorkUnit.createEmpty();
+    SerializationUtils.deserializeState(fs, path, workUnit);
+
+    if (workUnit instanceof MultiWorkUnit) {
+      return JobLauncherUtils.flattenWorkUnits(((MultiWorkUnit) 
workUnit).getWorkUnits());
+    } else {

Review Comment:
   I'd prefer the current over ternary, I guess because there's quite a bit of 
casting involved here so it's not as easy to follow what's going on.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 887451)
    Time Spent: 40m  (was: 0.5h)

> Simplify impl related to MR job execution (before reusing code in 
> Temporal-based exec)
> --------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1919
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1919
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-core
>            Reporter: Kip Kohn
>            Assignee: Abhishek Tiwari
>            Priority: Trivial
>          Time Spent: 40m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to