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

Arup Malakar edited comment on HCATALOG-370 at 7/27/12 1:30 AM:
----------------------------------------------------------------

Added better cleanup. 

Condition for cleanup:
1. The client shouldn't be used by any thread 
2. Must be beyond expiry time

If the above conditions are met any of the following action cleans up the client
1. close() being called by user
2. Item being evicted because of expiry time (this is triggered by any cache 
access)

The shutdown hook takes care of the cleaning the remaining clients if any.

Thanks Rajesh for reviewing it, as Rohini has mentioned we arrived at the same 
conclusion and the attached code reflects the same.
Updated code review: https://reviews.apache.org/r/6114/

                
      was (Author: amalakar):
    Added better cleanup. 

Condition for cleanup:
1. The client shouldn't be used by any thread 
2. Must be beyond expiry time

If the above conditions are met any of the following action cleans up the client
1. close() being called by user
2. Item being evicted because of expiry time (this is triggered by any cache 
access)

The shutdown hook takes care of the cleaning the remaining clients if any.
                  
> Create a HiveMetaStoreClient cache in hcatalog
> ----------------------------------------------
>
>                 Key: HCATALOG-370
>                 URL: https://issues.apache.org/jira/browse/HCATALOG-370
>             Project: HCatalog
>          Issue Type: Improvement
>          Components: client
>    Affects Versions: 0.4
>            Reporter: Rohini Palaniswamy
>            Assignee: Arup Malakar
>            Priority: Minor
>         Attachments: J370-patch1.diff, J370.patch
>
>
>   Hcat makes multiple calls to hivemetastore client and every time the 
> connection is setup and destroyed which is costly. It would be nice to have a 
> centralized cache, that has a connection per unique identifier (ugi,hcat 
> server uri and anything else mandatory). Instead of creating clients all over 
> the code, it can be retrieved from this cache. Connections in the cache can 
> be closed using WeakReference and ReferenceQueue or based on some time 
> interval. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to