Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata cmd #2091

Merged
merged 11 commits into from
Aug 26, 2022
Prev Previous commit
Simplify newOlEvents()
Signed-off-by: wslulciuc <[email protected]>
  • Loading branch information
wslulciuc committed Aug 26, 2022
commit f6d0536322a6515ea4da734c828b89df89a29565
15 changes: 4 additions & 11 deletions api/src/main/java/marquez/cli/MetadataCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,10 @@ private static List<OpenLineage.RunEvent> newOlEvents(
System.out.format(
"Generating '%d' runs, each COMPLETE event will have a size of '~%d' (bytes)...\n",
numOfRuns, bytesPerEvent);
final List<RunEvents> olRunEvents =
Stream.generate(() -> newOlRunEvents(bytesPerEvent))
.limit(numOfRuns)
.collect(toImmutableList());

final ImmutableList.Builder<OpenLineage.RunEvent> olEvents = ImmutableList.builder();
for (final RunEvents startAndComplete : olRunEvents) {
olEvents.add(startAndComplete.start()); // Add START event
olEvents.add(startAndComplete.complete()); // Add COMPLETE event
}
return olEvents.build();
return Stream.generate(() -> newOlRunEvents(bytesPerEvent))
.limit(numOfRuns)
.flatMap(runEvents -> Stream.of(runEvents.start(), runEvents.complete()))
.collect(toImmutableList());
}

/**
Expand Down