arjun4084346 commented on code in PR #3825: URL: https://github.com/apache/gobblin/pull/3825#discussion_r1431956651
########## gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagement.java: ########## @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.gobblin.service.modules.orchestration; + +import java.io.IOException; +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.typesafe.config.Config; + +import org.apache.gobblin.runtime.api.DagActionStore; +import org.apache.gobblin.runtime.api.TopologySpec; +import org.apache.gobblin.service.modules.flowgraph.Dag; +import org.apache.gobblin.service.modules.spec.JobExecutionPlan; +import org.apache.gobblin.service.monitoring.KillFlowEvent; +import org.apache.gobblin.service.monitoring.ResumeFlowEvent; +import org.apache.gobblin.service.monitoring.event.JobStatusEvent; + + +public interface DagManagement { + DagStateStore createDagStateStore(Config config, Map<URI, TopologySpec> topologySpecMap); + void deleteJobState(String dagId, Dag.DagNode<JobExecutionPlan> dagNode); + void addJobState(String dagId, Dag.DagNode<JobExecutionPlan> dagNode); + + /** + * defines what to do when a job (dag node) finishes + * @param dagNode dag node that finished + * @return next set of DagNodes to run + * @throws IOException + */ + Map<String, Set<Dag.DagNode<JobExecutionPlan>>> onJobFinish(Dag.DagNode<JobExecutionPlan> dagNode) throws IOException; + void removeDagActionFromStore(DagActionStore.DagAction dagAction) throws IOException; + void handleJobStatusEvent(JobStatusEvent jobStatusEvent); + void handleKillFlowEvent(KillFlowEvent killFlowEvent); + void handleResumeFlowEvent(ResumeFlowEvent resumeFlowEvent) throws IOException; + Dag<JobExecutionPlan> getDag(String dagId); + boolean containsDag(String dagId); + Map<String, Dag<JobExecutionPlan>> getResumingDags(); + List<Dag.DagNode<JobExecutionPlan>> getJobs(String dagId) throws IOException; + List<Dag.DagNode<JobExecutionPlan>> getAllJobs() throws IOException; + Map<String, Long> getDagToSLA(); + Set<String> getFailedDagIds(); + DagStateStore getFailedDagStateStore(); + DagStateStore getDagStateStore(); + void setActive() throws IOException; + void addDag(String dagId, Dag<JobExecutionPlan> dag); Review Comment: Yes, in this PR dag procs are calling `DagManagement` and `DagManagement` is just forwarding the requests to `DagManagementStateStore`. Should I let dag procs directly hold a handle of `DagManagementStateStore`? -- 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]
