pinot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5035: Adding backward compatible classname mapping from old plugins classname
Date Tue, 04 Feb 2020 23:10:39 GMT
Jackie-Jiang commented on a change in pull request #5035: Adding backward compatible classname
mapping from old plugins classname
URL: https://github.com/apache/incubator-pinot/pull/5035#discussion_r374975957
 
 

 ##########
 File path: pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginManager.java
 ##########
 @@ -171,9 +198,16 @@ private PluginClassLoader createClassLoader(Collection<URL> urlList)
{
    */
   public Class<?> loadClass(String pluginName, String className)
       throws ClassNotFoundException {
-    return _registry.get(new Plugin(pluginName)).loadClass(className, true);
+    // Backward compatible check.
+    return _registry.get(new Plugin(pluginName)).loadClass(loadClassWithBackwardCompatibleCheck(className),
true);
   }
 
+  public static String loadClassWithBackwardCompatibleCheck(String className) {
+    if (PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.containsKey(className)) {
 
 Review comment:
   Save a map lookup by doing:
   `return PLUGINS_BACKWARD_COMPATIBLE_CLASS_NAME_MAP.getOrDefault(className, className);`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


Mime
View raw message