You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Dave Marion (JIRA)" <ji...@apache.org> on 2012/09/20 03:57:07 UTC

[jira] [Commented] (ACCUMULO-708) Modify ClassLoader to support different applications / multi-tenancy

    [ https://issues.apache.org/jira/browse/ACCUMULO-708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459290#comment-13459290 ] 

Dave Marion commented on ACCUMULO-708:
--------------------------------------


I'm ready for folks to start reviewing what I have done. I have been working from https://github.com/dlmarion/ACCUMULO-708. One thing to note is that the unit tests are probably really functional tests as they require a running HDFS instance. To run the tests, you will need to modify the HDFS_URI variable in each test. Currently its using hdfs://localhost:8020/.

Here is the design:

  The new classloader creates the following structure:
{noformat}
               SystemClassLoader
                      |
                      |
                URLClassLoader
                      |
                      |
           AccumuloContextClassLoader  
                      |
                      |
    Map<String, AccumuloReloadingVFSClassLoader>

{noformat}
  The top two levels of the structure are the same as the current class loader. The differences are:

  AccumuloReloadingVFSClassLoader: This class contains an Apache Commons VFSClassLoader and implements FileListener to get callbacks from the Apache Commons VFS file system. The VFSClassLoader will load classes from a specific set of locations, and the AccumuloReloadingVFSClassLoader will recreate the VFSClassLoader member when a change is detected. This is similar to the current FileSystemAlterationMonitor mechanism in the current classloader.

  AccumuloContextClassLoader: This class maintains a map of context names to AccumuloReloadingVFSClassLoader objects. There is a default context, which is primed using the property default.context.classpath. Additional contexts can be named and the classpath for the context is user defined.

  This implementation uses Apache Commons VFS which allows the classpath to specify locations other than the local filesystem. I have created a read only hdfs file system provider to allow loading of classes from HDFS. I think this may allow the start package to be versioned separately from the rest of the Accumulo modules. The start package and its dependencies would need to be on the local filesystem, and the rest of the Accumulo distribution could be in HDFS (i.e. /accumulo/classpath).

                
> Modify ClassLoader to support different applications / multi-tenancy
> --------------------------------------------------------------------
>
>                 Key: ACCUMULO-708
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-708
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: start
>            Reporter: Dave Marion
>            Assignee: Dave Marion
>              Labels: classloader
>   Original Estimate: 24h
>          Time Spent: 15h
>  Remaining Estimate: 9h
>
> I'd like to expand the current classloader to support loading classes from HDFS and different application contexts. I'll be modifying the ticket as the idea matures.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira