[
https://issues.apache.org/jira/browse/GOBBLIN-1706?focusedWorklogId=809653&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-809653
]
ASF GitHub Bot logged work on GOBBLIN-1706:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 16/Sep/22 20:48
Start Date: 16/Sep/22 20:48
Worklog Time Spent: 10m
Work Description: arjun4084346 commented on code in PR #3558:
URL: https://github.com/apache/gobblin/pull/3558#discussion_r973382310
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/restli/GobblinServiceFlowExecutionResourceHandlerWithWarmStandby.java:
##########
@@ -0,0 +1,77 @@
+/*
+ * 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.restli;
+
+import com.google.common.base.Optional;
+import com.google.common.eventbus.EventBus;
+import com.google.inject.Inject;
+import com.linkedin.restli.common.ComplexResourceKey;
+import com.linkedin.restli.common.EmptyRecord;
+import com.linkedin.restli.common.HttpStatus;
+import com.linkedin.restli.server.RestLiServiceException;
+import com.linkedin.restli.server.UpdateResponse;
+import java.io.IOException;
+import javax.inject.Named;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.gobblin.runtime.api.DagActionStore;
+import org.apache.gobblin.runtime.util.InjectionNames;
+import org.apache.gobblin.service.FlowExecutionResourceLocalHandler;
+import org.apache.gobblin.service.modules.core.GobblinServiceManager;
+import org.apache.helix.HelixManager;
+
+@Slf4j
+public class GobblinServiceFlowExecutionResourceHandlerWithWarmStandby extends
GobblinServiceFlowExecutionResourceHandler{
+ private DagActionStore dagActionStore;
+ @Inject
+ public
GobblinServiceFlowExecutionResourceHandlerWithWarmStandby(FlowExecutionResourceLocalHandler
handler,
+ @Named(GobblinServiceManager.SERVICE_EVENT_BUS_NAME) EventBus eventBus,
+ Optional<HelixManager> manager, @Named(InjectionNames.FORCE_LEADER)
boolean forceLeader, DagActionStore dagActionStore) {
+ super(handler, eventBus, manager, forceLeader);
+ this.dagActionStore = dagActionStore;
+ }
+
+
+ @Override
+ public void
resume(ComplexResourceKey<org.apache.gobblin.service.FlowStatusId, EmptyRecord>
key) {
+ String flowGroup = key.getKey().getFlowGroup();
+ String flowName = key.getKey().getFlowName();
+ Long flowExecutionId = key.getKey().getFlowExecutionId();
+ try {
+ this.dagActionStore.addDagAction(flowGroup, flowName,
flowExecutionId.toString(), DagActionStore.DagActionValue.RESUME);
+ } catch (IOException e) {
+ log.warn(String.format("Failed to add execution resume action for flow %s
%s %s to dag action store due to", flowGroup, flowName, flowExecutionId), e);
+ throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR,
e.getMessage());
Review Comment:
in case, kill is already present and user submitted this resume request, it
will be considered user's mistake, in that case we should set error code to 4xx
Issue Time Tracking
-------------------
Worklog Id: (was: 809653)
Time Spent: 3h 20m (was: 3h 10m)
> 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 20m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)