hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joydeep Sen Sarma (JIRA)" <>
Subject [jira] Commented: (HIVE-574) Hive should use ClassLoader from hadoop Configuration
Date Fri, 26 Jun 2009 00:12:07 GMT


Joydeep Sen Sarma commented on HIVE-574:

hi zheng - i would prefer to add a getClassByName to JavaUtils (replace getClassLoader) and
then use the Session Configuration object's getclassbyname (SessionState.get().getConf())
 if it's available - or else default to thread classloader or else finally default to current

i feel very uncomfortable that right now we are sometimes using the conf classloader and sometimes
using the thread classloader. it's sheer chance that all the uses of JavaUtils.getClassLoader()
are happening within the same thread as the thread that adds jar files (or the main thread
of the ExecDriver). This can change anytime tomorrow.

> Hive should use ClassLoader from hadoop Configuration
> -----------------------------------------------------
>                 Key: HIVE-574
>                 URL:
>             Project: Hadoop Hive
>          Issue Type: Bug
>    Affects Versions: 0.3.0, 0.3.1
>            Reporter: Zheng Shao
>            Assignee: Zheng Shao
>         Attachments: HIVE-574.1.patch, HIVE-574.2.patch, HIVE-574.3.patch
> See HIVE-338.
> Hive should always use the getClassByName method from hadoop Configuration, so that we
choose the correct ClassLoader. Examples include all plug-in interfaces, including UDF/GenericUDF/UDAF,
SerDe, and FileFormats. Basically the following code snippet shows the idea:
> {code}
> package org.apache.hadoop.conf;
> public class Configuration implements Iterable<Map.Entry<String,String>>
>    ...
>   /**
>    * Load a class by name.
>    * 
>    * @param name the class name.
>    * @return the class object.
>    * @throws ClassNotFoundException if the class is not found.
>    */
>   public Class<?> getClassByName(String name) throws ClassNotFoundException {
>     return Class.forName(name, true, classLoader);
>   }
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message