You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2022/03/24 16:17:13 UTC

[GitHub] [gobblin] arjun4084346 commented on a change in pull request #3484: [GOBBLIN-1627] provide option to convert datanodes names

arjun4084346 commented on a change in pull request #3484:
URL: https://github.com/apache/gobblin/pull/3484#discussion_r834490212



##########
File path: gobblin-service/src/main/java/org/apache/gobblin/service/modules/flowgraph/pathfinder/AbstractPathFinder.java
##########
@@ -77,18 +79,20 @@
   protected Long flowExecutionId;
   protected FlowSpec flowSpec;
   protected Config flowConfig;
+  protected Config sysConfig;
 
-  AbstractPathFinder(FlowGraph flowGraph, FlowSpec flowSpec)
+  AbstractPathFinder(FlowGraph flowGraph, FlowSpec flowSpec, Config config)
       throws ReflectiveOperationException {
     this.flowGraph = flowGraph;
     this.flowSpec = flowSpec;
     this.flowExecutionId = FlowUtils.getOrCreateFlowExecutionId(flowSpec);
     this.flowConfig = flowSpec.getConfig().withValue(ConfigurationKeys.FLOW_EXECUTION_ID_KEY, ConfigValueFactory.fromAnyRef(flowExecutionId));
+    this.sysConfig = config;
 
     //Get src/dest DataNodes from the flow config
-    String srcNodeId = ConfigUtils.getString(flowConfig, ServiceConfigKeys.FLOW_SOURCE_IDENTIFIER_KEY, "");
+    String srcNodeId = getDataNode(flowConfig, ServiceConfigKeys.FLOW_SOURCE_IDENTIFIER_KEY, this.sysConfig);
+    List<String> destNodeIds = getDataNodes(flowConfig, ServiceConfigKeys.FLOW_DESTINATION_IDENTIFIER_KEY, this.sysConfig);

Review comment:
       Good catch. Yes it can throw a RuntimeException, but because instance init is called everytime a flow is compiled and it is eventually caught; and will not stop the service. I can catch it sooner and throw a PathFinderException also.... what do you say?
   I actually prefer passing a Config, or State, or Properties, so it can be used for future use cases and we do not need to change the method signature again. opinion?
   




-- 
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: dev-unsubscribe@gobblin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org