arjun4084346 commented on code in PR #4002:
URL: https://github.com/apache/gobblin/pull/4002#discussion_r1681602126
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/task/LaunchDagTask.java:
##########
@@ -36,4 +43,25 @@ public LaunchDagTask(DagActionStore.DagAction dagAction,
LeaseAttemptStatus.Leas
public <T> T host(DagTaskVisitor<T> visitor) {
return visitor.meet(this);
}
+
+ @Override
+ public final boolean conclude() {
+ try {
+ // Delete adhoc flowSpecs from catalog if the dag was concluded properly
+ if (super.conclude()) {
+ DagManager.DagId dagId =
DagManagerUtils.generateDagId(this.dagAction.getFlowGroup(),
+ this.dagAction.getFlowName(), this.dagAction.getFlowExecutionId());
+ FlowSpec flowSpec =
+
this.dagManagementStateStore.getFlowSpec(FlowSpec.Utils.createFlowSpecUri(dagId.getFlowId()));
+ flowSpec.addProperty(ConfigurationKeys.FLOW_EXECUTION_ID_KEY,
dagId.getFlowExecutionId());
+ if (!flowSpec.isScheduled()) {
+ dagManagementStateStore.removeFlowSpec(flowSpec);
+ }
+ return true;
+ }
+ } catch (SpecNotFoundException | URISyntaxException e) {
+ log.error("Unable to retrieve flowSpec to delete from flowCatalog if
adhoc.");
+ throw new RuntimeException(e);
+ } return false;
Review Comment:
return on next line, maybe with a blank line too
--
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]