[
https://issues.apache.org/jira/browse/GOBBLIN-1919?focusedWorklogId=887315&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-887315
]
ASF GitHub Bot logged work on GOBBLIN-1919:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 26/Oct/23 06:32
Start Date: 26/Oct/23 06:32
Worklog Time Spent: 10m
Work Description: phet commented on code in PR #3784:
URL: https://github.com/apache/gobblin/pull/3784#discussion_r1372649990
##########
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 agree it's not necessary, but I prefer the parallel indentation of
`if`/`else`, which I find clearer. TBH, I almost went w/ the ternary
operator... but it seemed harder to read.
Issue Time Tracking
-------------------
Worklog Id: (was: 887315)
Remaining Estimate: 0h
Time Spent: 10m
> 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: 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)