Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-6381

Unnecessary synchronized object in BucketingSink

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: filesystem-connector
    • Labels:
      None

      Description

      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, as follows.

       private void handleRestoredRollingSinkState(RollingSink.BucketState restoredState) {
           ...
          synchronized (restoredState.pendingFilesPerCheckpoint) {
      			restoredState.pendingFilesPerCheckpoint.clear();
      		}
           ...
      }

      and

      private void handleRestoredBucketState(State<T> restoredState) {       
          ...
          synchronized (bucketState.pendingFilesPerCheckpoint) {
      	     	        bucketState.pendingFilesPerCheckpoint.clear();
      		}
       } 

      Hi, Kostas Kloudas. Is there any other stuff shoud add here ? Would you mind have a more thorough look in this class ?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mingleizhang zhangminglei
                Reporter:
                mingleizhang zhangminglei
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: