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

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

                Author: ASF GitHub Bot
            Created on: 16/Sep/22 20:07
            Start Date: 16/Sep/22 20:07
    Worklog Time Spent: 10m 
      Work Description: arjun4084346 commented on code in PR #3558:
URL: https://github.com/apache/gobblin/pull/3558#discussion_r973350295


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/DagActionStore.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * 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.runtime.api;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.Collection;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+
+
+public interface DagActionStore {
+  enum DagActionValue {
+    KILL,
+    RESUME
+  }
+
+  @Getter
+  @EqualsAndHashCode
+  class DagAction {
+    String flowGroup;
+    String flowName;
+    String flowExecutionId;
+    DagActionValue dagActionValue;
+    public DagAction(String flowGroup, String flowName, String 
flowExecutionId, DagActionValue dagActionValue) {
+      this.flowGroup = flowGroup;
+      this.flowName = flowName;
+      this.flowExecutionId = flowExecutionId;
+      this.dagActionValue = dagActionValue;
+    }
+  }
+
+
+  /**
+   * Check if an action exists in dagAction store by flow group, flow name and 
flow execution id.
+   * @param flowGroup flow group for the dag action
+   * @param flowName flow name for the dag action
+   * @param flowExecutionId flow execution for the dag action
+   * @throws IOException
+   */
+  boolean exists(String flowGroup, String flowName, String flowExecutionId) 
throws IOException, SQLException;
+
+  /**
+   * Persist the dag action in {@link DagActionStore} for durability
+   * @param flowGroup flow group for the dag action
+   * @param flowName flow name for the dag action
+   * @param flowExecutionId flow execution for the dag action
+   * @param dagActionValue the value of the dag action
+   * @throws IOException
+   */
+  void addDagAction(String flowGroup, String flowName, String flowExecutionId, 
DagActionValue dagActionValue) throws IOException;
+
+  /**
+   * delete the dag action from {@link DagActionStore}
+   * @param flowGroup flow group for the dag action
+   * @param flowName flow name for the dag action
+   * @param flowExecutionId flow execution for the dag action
+   * @throws IOException
+   */
+  boolean deleteDagAction(String flowGroup, String flowName, String 
flowExecutionId) throws IOException;

Review Comment:
   Ah ok, let's update the javadoc with `@returns` then.





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

    Worklog Id:     (was: 809640)
    Time Spent: 3h  (was: 2h 50m)

> Add DagActionStore to store the action to kill/resume one flow execution
> ------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1706
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1706
>             Project: Apache Gobblin
>          Issue Type: Improvement
>            Reporter: Zihan Li
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>




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

Reply via email to