gharris1727 commented on code in PR #13771:
URL: https://github.com/apache/kafka/pull/13771#discussion_r1212147724


##########
connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java:
##########
@@ -356,25 +357,16 @@ public static String prunedName(PluginDesc<?> plugin) {
      * Verify whether a given plugin's alias matches another alias in a 
collection of plugins.
      *
      * @param alias the plugin descriptor to test for alias matching.
-     * @param plugins the collection of plugins to test against.
+     * @param aliases the collection of plugins to test against.
      * @param <U> the plugin type.
      * @return false if a match was found in the collection, otherwise true.
      */
     public static <U> boolean isAliasUnique(
             PluginDesc<U> alias,
-            Collection<PluginDesc<U>> plugins
+            Map<String, String> aliases
     ) {
-        boolean matched = false;
-        for (PluginDesc<U> plugin : plugins) {
-            if (simpleName(alias).equals(simpleName(plugin))
-                    || prunedName(alias).equals(prunedName(plugin))) {
-                if (matched) {
-                    return false;
-                }
-                matched = true;
-            }
-        }
-        return true;
+        // TODO: Mark alias collision and disable ambiguous aliases completely.

Review Comment:
   Oh sorry let me clarify, it can produce ambiguous aliases if different 
plugin types have the same aliases.
   
   Here's an ambiguous alias that can happen on trunk:
   ```
   plugin-1
       package.SomethingConnector
   plugin-2
       package.SomethingConverter
   ```
   
   In this situation, if the iteration scans `plugin-1` first, `Something` will 
be aliased to `package.SomethingConnector`.
   If the iteration scans `plugin-2` first, `Something` will be aliased to 
`package.SomethingConverter`.
   
   I see that the proposed implementation is actually worse than trunk, which 
I'll need to improve. I'm still interested if you think that the ambiguity on 
trunk should be changed or preserved.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to