You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Amareshwari Sriramadasu (JIRA)" <ji...@apache.org> on 2016/06/10 05:54:20 UTC
[jira] [Commented] (LENS-1183) Optimize multiple acquire from same
thread
[ https://issues.apache.org/jira/browse/LENS-1183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15323919#comment-15323919 ]
Amareshwari Sriramadasu commented on LENS-1183:
-----------------------------------------------
Are we sure that all consecutive acquires are on same session? If so, then yes.
Even otherwise, i feel the callers have to be fixed not to acquire somany times. One such method - getUpdatedQueryContext is acquiring session and is called by many methods - sometimes in loop.
> Optimize multiple acquire from same thread
> ------------------------------------------
>
> Key: LENS-1183
> URL: https://issues.apache.org/jira/browse/LENS-1183
> Project: Apache Lens
> Issue Type: Improvement
> Components: server
> Reporter: Puneet Gupta
> Assignee: Rajat Khandelwal
>
> 1. In LensSessionImpl if acquireCount.incrementAndGet() >1 , no need to execute the proceeding 3 lines
> {code}
> public synchronized void acquire(boolean userAccess) {
> super.acquire(userAccess);
> acquireCount.incrementAndGet();
> // Update thread's class loader with current DBs class loader
> ClassLoader classLoader = getClassLoader(getCurrentDatabase());
> Thread.currentThread().setContextClassLoader(classLoader);
> SessionState.getSessionConf().setClassLoader(classLoader);
> setActive();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)