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

ASF GitHub Bot commented on FLINK-6381:
---------------------------------------

GitHub user zhangminglei opened a pull request:

    https://github.com/apache/flink/pull/3820

    [FLINK-6381] [connector] Unnecessary synchronizing object in Bucketin…

    Currently there are two places should not employ the synchronized to 
describe ```pendingFilesPerCheckpoint```, as it is only restored state object 
for checkpoint and no sharing of the data-structure between different threads

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zhangminglei/flink flink-6381

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3820.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3820
    
----
commit ba9be98844d81ddec7cd8aae95457f2e3e3f6acb
Author: zhangminglei <[email protected]>
Date:   2017-05-04T07:11:20Z

    [FLINK-6381] [connector] Unnecessary synchronizing object in BucketingSink.

----


> Unnecessary synchronizing object in BucketingSink
> -------------------------------------------------
>
>                 Key: FLINK-6381
>                 URL: https://issues.apache.org/jira/browse/FLINK-6381
>             Project: Flink
>          Issue Type: Improvement
>          Components: filesystem-connector
>            Reporter: mingleizhang
>            Assignee: mingleizhang
>
> It seems that currently there are two places should not employ the 
> {{synchronized}} to describe {{pendingFilesPerCheckpoint}}, as it is only 
> restored state object for checkpoint and no sharing of the data-structure 
> between different threads. Codes in  {{BucketingSink}} are as follows. {code} 
> private void handleRestoredRollingSinkState(RollingSink.BucketState 
> restoredState) {
>      ...
>     synchronized (restoredState.pendingFilesPerCheckpoint) {
>                       restoredState.pendingFilesPerCheckpoint.clear();
>               }
>      ...
> }{code} and {code}private void handleRestoredBucketState(State<T> 
> restoredState) {       
>     ...
>     synchronized (bucketState.pendingFilesPerCheckpoint) {
>                       bucketState.pendingFilesPerCheckpoint.clear();
>               }
>  } {code}
> Hi, [~kkl0u]. Is there any other stuff shoud add here ? Would you mind have a 
> more thorough look in this class ? Thanks go out to you. I am very appreciate 
> it.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to