You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gobblin.apache.org by su...@apache.org on 2020/04/13 03:07:24 UTC
[incubator-gobblin] branch master updated: [GOBBLIN-1113] Carry
forward requester list property when updating flowconfig
This is an automated email from the ASF dual-hosted git repository.
suvasude pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-gobblin.git
The following commit(s) were added to refs/heads/master by this push:
new b1e829a [GOBBLIN-1113] Carry forward requester list property when updating flowconfig
b1e829a is described below
commit b1e829a89927d1d37f93ac4bd83114368f4fad7e
Author: Jack Moseley <jm...@linkedin.com>
AuthorDate: Sun Apr 12 20:07:16 2020 -0700
[GOBBLIN-1113] Carry forward requester list property when updating flowconfig
Closes #2952 from jack-moseley/update-requester
---
.../src/test/java/org/apache/gobblin/service/FlowConfigTest.java | 2 ++
.../org/apache/gobblin/service/FlowConfigResourceLocalHandler.java | 6 +++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/test/java/org/apache/gobblin/service/FlowConfigTest.java b/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/test/java/org/apache/gobblin/service/FlowConfigTest.java
index f8d8ea8..697ed8d 100644
--- a/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/test/java/org/apache/gobblin/service/FlowConfigTest.java
+++ b/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-client/src/test/java/org/apache/gobblin/service/FlowConfigTest.java
@@ -20,6 +20,7 @@ package org.apache.gobblin.service;
import java.io.File;
import java.io.IOException;
import java.net.ServerSocket;
+import java.util.ArrayList;
import java.util.Map;
import org.apache.commons.io.FileUtils;
@@ -220,6 +221,7 @@ public class FlowConfigTest {
//Assert.assertEquals(flowConfig.getProperties().size(), 2);
Assert.assertEquals(retrievedFlowConfig.getProperties().get("param1"), "value1b");
Assert.assertEquals(retrievedFlowConfig.getProperties().get("param2"), "value2b");
+ Assert.assertEquals(retrievedFlowConfig.getProperties().get(RequesterService.REQUESTER_LIST), RequesterService.serialize(new ArrayList<>()));
}
@Test (dependsOnMethods = "testUpdate")
diff --git a/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java b/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java
index a7e4d04..0534887 100644
--- a/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java
+++ b/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/FlowConfigResourceLocalHandler.java
@@ -163,9 +163,13 @@ public class FlowConfigResourceLocalHandler implements FlowConfigsResourceHandle
throw new FlowConfigLoggedException(HttpStatus.S_400_BAD_REQUEST,
"flowName and flowGroup cannot be changed in update", null);
}
+
+ // Carry forward the requester list property since it is added at time of creation
+ FlowConfig originalFlowConfig = getFlowConfig(flowId);
+ flowConfig.getProperties().put(RequesterService.REQUESTER_LIST, originalFlowConfig.getProperties().get(RequesterService.REQUESTER_LIST));
+
if (isUnscheduleRequest(flowConfig)) {
// flow config is not changed if it is just a request to un-schedule
- FlowConfig originalFlowConfig = getFlowConfig(flowId);
originalFlowConfig.setSchedule(NEVER_RUN_CRON_SCHEDULE);
flowConfig = originalFlowConfig;
}