[ 
https://issues.apache.org/jira/browse/LENS-279?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Himanshu Gahlaut updated LENS-279:
----------------------------------
    Description: Currently writeExternal method of various lens classes writes 
to an ObjectOutputStream for persisting state of objects. These writeExternal 
method calls are triggered from a code block in LensServices class which is a 
synchronized code block. All write methods are coming within synchronized 
blocks in all classes. write method can take long time due to slowness in 
filesystem and that can block other synchronized methods in these classes, 
which come under query execution flow. This locking and slowness in filesystem 
can decrease the performance of query execution flow. An improved approach can 
be to make a copy of the entire state to be persisted with synchronization and 
then write to file system in a non synchronized code block. This would result 
in locking a lighter portion of code (in memory copy) instead of creating locks 
around relatively heavier portion of code (writes to filesystem).   (was: 
Currently writeExternal method of various lens classes writes to an 
ObjectOutputStream for persisting state of objects. These writeExternal method 
calls are triggered from a code block in LensServices class which is a 
synchronized code block. All write methods are coming within synchronized 
blocks in all classes. writeExternal method can take long time due to slowness 
in filesystem and that can block other synchronized methods in these classes, 
which come under query execution flow. This locking and slowness in filesystem 
can decrease the performance of query execution flow. An improved approach can 
be to make a copy of the entire state to be persisted with synchronization and 
then write to file system in a non synchronized code block. This would result 
in locking a lighter portion of code (in memory copy) instead of creating locks 
around relatively heavier portion of code (writes to filesystem). )

> Redesigning lens server state persistence with respect to synchronization
> -------------------------------------------------------------------------
>
>                 Key: LENS-279
>                 URL: https://issues.apache.org/jira/browse/LENS-279
>             Project: Apache Lens
>          Issue Type: Improvement
>            Reporter: Himanshu Gahlaut
>
> Currently writeExternal method of various lens classes writes to an 
> ObjectOutputStream for persisting state of objects. These writeExternal 
> method calls are triggered from a code block in LensServices class which is a 
> synchronized code block. All write methods are coming within synchronized 
> blocks in all classes. write method can take long time due to slowness in 
> filesystem and that can block other synchronized methods in these classes, 
> which come under query execution flow. This locking and slowness in 
> filesystem can decrease the performance of query execution flow. An improved 
> approach can be to make a copy of the entire state to be persisted with 
> synchronization and then write to file system in a non synchronized code 
> block. This would result in locking a lighter portion of code (in memory 
> copy) instead of creating locks around relatively heavier portion of code 
> (writes to filesystem). 



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

Reply via email to