CalvinKirs commented on code in PR #2301:
URL: 
https://github.com/apache/incubator-seatunnel/pull/2301#discussion_r935159402


##########
seatunnel-engine/seatunnel-engine-client/src/main/java/org/apache/seatunnel/engine/client/JobConfigParser.java:
##########
@@ -211,43 +230,57 @@ private void initRelationMap(List<? extends Config> 
sourceConfigs, List<? extend
      * |
      * Sink
      */
-    private List<Action> sampleAnalyze(List<? extends Config> sourceConfigs,
-                                       List<? extends Config> transformConfigs,
-                                       List<? extends Config> sinkConfigs) {
-        SeaTunnelSource seaTunnelSource = 
ConnectorInstanceLoader.loadSourceInstance(sourceConfigs.get(0));
+    private void sampleAnalyze(List<? extends Config> sourceConfigs,
+                               List<? extends Config> transformConfigs,
+                               List<? extends Config> sinkConfigs) {
+        ImmutablePair<SeaTunnelSource, List<URL>> pair =
+            ConnectorInstanceLoader.loadSourceInstance(sourceConfigs.get(0));
         SourceAction sourceAction =
-            new SourceAction(idGenerator.getNextId(), 
seaTunnelSource.getPluginName(), seaTunnelSource);
+            createSourceAction(idGenerator.getNextId(), 
pair.getLeft().getPluginName(), pair.getLeft(),
+                pair.getRight());
         
sourceAction.setParallelism(getSourceParallelism(sourceConfigs.get(0)));
+
+        ImmutablePair<SeaTunnelSink<SeaTunnelRow, Serializable, Serializable, 
Serializable>, List<URL>>
+            sinkListImmutablePair;
+
         if (transformConfigs.size() != 0) {

Review Comment:
   using Collection.isEmpty() makes the code more readable and can be more 
performant. The time complexity of any isEmpty() method implementation should 
be O(1) whereas some implementations of size() can be O(n).



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