Will-Lo commented on code in PR #3819:
URL: https://github.com/apache/gobblin/pull/3819#discussion_r1381115387


##########
gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java:
##########
@@ -423,6 +423,17 @@ public boolean isScheduled() {
     return getConfig().hasPath(ConfigurationKeys.JOB_SCHEDULE_KEY);
   }
 
+  /**
+   * Create a new FlowSpec object with the added property defined by path and 
value parameters
+   * @param path key for new property
+   * @param value
+   */
+  public FlowSpec addProperty(String path, String value) {
+    Properties properties = this.getConfigAsProperties();
+    properties.setProperty(path, value);
+    return new 
Builder(this.getUri()).withConfigAsProperties(properties).build();

Review Comment:
   My concern here is mostly that it would create a decent amount of object 
churn, given the size of configs it should lead to an increase of jvm GC given 
that this would happen once per execution.
   
   That being said it might be an overoptimization to enforce such a rule until 
you instrument results on a high load, the alternative would be messy, need to 
add a way for compileSpec() to take in a flow execution ID and enforce using 
that ID instead of using the provided one in the flow config or from the system 
time, which would also lead to a bit of an anti-pattern of compiler expecting 
to use either the flow config's ID (that you provided here) or it's own 
generated ID.
   
   



-- 
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]

Reply via email to