ruanwenjun commented on a change in pull request #5676:
URL: https://github.com/apache/dolphinscheduler/pull/5676#discussion_r659573438



##########
File path: 
dolphinscheduler-spi/src/main/java/org/apache/dolphinscheduler/spi/plugin/DolphinPluginDiscovery.java
##########
@@ -83,6 +83,7 @@ private DolphinPluginDiscovery() {
 
         return listClasses(file.toPath()).stream()
                 .filter(name -> classInterfaces(name, 
classLoader).contains(DolphinSchedulerPlugin.class.getName()))
+                .map(plugin -> plugin.replace(File.separatorChar, '.'))

Review comment:
       @kyoty Sorry, I apologize for my previous review, I re-look at the code 
here.
   The method `discoverPluginsFromArtifact` is aim to get the plugin class name.
   In the below lines, there might two steps.
   ```java
   return listClasses(file.toPath()).stream()
                   .filter(name -> classInterfaces(name, 
classLoader).contains(DolphinSchedulerPlugin.class.getName()))
                   .collect(Collectors.toSet());
   ```
   First, `listClasses`, this method is aim to return the class in the file 
path. 
   Second, `filter`, this method is aim to filter the plugin class.
   And currently this cannot work well in windows.
   
   In the `listClasses` method, it will use `javaName` to transform file name 
to class name, as discuss previous, this method cannot work well in windows. We 
need to modify the `javaName` method.
   
![image](https://user-images.githubusercontent.com/22415594/123602099-fbd1f880-d82a-11eb-9bc1-eb21053d53f2.png)
   
   When you modify the method `javaName`, it also doesn't work in windows, 
because the `classInterfaces` also use the `javaName` method. The problem is 
that the `reader.getSuperName()` is always return 'xx/xx/xx', independent of OS 
file splitter.
   
![image](https://user-images.githubusercontent.com/22415594/123602555-70a53280-d82b-11eb-8f19-1793aece9e21.png)
   
   I am not sure if I am expressing myself clearly.
   




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