umustafi commented on code in PR #3984:
URL: https://github.com/apache/gobblin/pull/3984#discussion_r1650169783
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/FlowLaunchHandler.java:
##########
@@ -275,6 +276,27 @@ public static JobDataMap
updatePropsInJobDataMap(JobDataMap jobDataMap,
return jobDataMap;
}
+ public static JobDataMap deepCopyJobDataMap(JobDataMap original) {
+ JobDataMap copy = new JobDataMap();
+ for (Map.Entry<String, Object> entry : original.entrySet()) {
+ // Assuming all values stored in the JobDataMap are serializable
+ Object value = entry.getValue();
+ if(value instanceof Properties) {
+ value = deepCopyProperties((Properties) value);
+ }
+ copy.put(entry.getKey(), value);
Review Comment:
I tried to make deep copy with `new String()` for every key and value but it
does not pass the `Assert.assertNotSame(originalJobDataMap.get("key"),
newJobDataMap.get("key"));`. All the of the values are copied over unchanged.
Only one new key (`isReminder`) is added to the new `jobDataMap` and new
`Properties` obj created. As long as the objects themselves are different, the
original job schedules will not be affected by a new key in the reminder object.
--
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]