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

Amareshwari Sriramadasu commented on LENS-298:
----------------------------------------------

Some thoughts on implementation for first cut:
* When Lens Server starts, it would load jars 
<lens.server.namespace.resource.dir>/<namespace-name>/ for each name space and 
create class loader for each name space. <lens.server.namespace.resource.dir> 
can be file:///, which says the directory should be a location on the same 
machine.
* When user does switch namespace, the namespace classloader gets loaded in 
thread context, if no additional session jars are loaded.
* If session has additional jars loaded, a new classloader gets created merging 
session jars and namespace jars and gets loaded.
* Passing the jars to underlying drivers can be initiated lazily on first 
explain or execute call. 
** All the namespace jars and session jars will be added to underlying drivers.
** On switch namespace, old hive session can be invalidated and new hive 
session is created(lazily) and be loaded with new namespace jars.
* When namespace jars are altered, the old classloader can be invalidated and 
new classloader is created by loading jars.
** All new sessions pick up new classloader.
** Some options for refreshing old sessions
*** Update the classloaders in all open sessions with new namespace's 
classloader.
*** Switch namespace to the same namespace should refresh the jars - but 
requires a user action.

In this process we will have to come up with permgen space required for lens 
server for a supported number of concurrent sessions and namespaces.

> Provide a way to add static jars at cube/db level
> -------------------------------------------------
>
>                 Key: LENS-298
>                 URL: https://issues.apache.org/jira/browse/LENS-298
>             Project: Apache Lens
>          Issue Type: Improvement
>          Components: cube, server
>            Reporter: Amareshwari Sriramadasu
>             Fix For: 2.1
>
>
> Static cube related jars can be loaded in system classpath of lens whenever a 
> cube/db is accessed. These jars would be the jars required to load serde, 
> storage of the underlying tables in db. Right now, these are getting loaded 
> are session auxiliary jars, we need to separate session auxiliary jars with 
> cube related jars.
> This however need to be done as an extension where it should be possible to 
> drop jars in some ext/ folder and they are considered, as opposed to bundling 
> this as part of the lens system.
> System should degrade to requiring the jars in session, if the required jars 
> are missing in ext/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to