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

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

Github user tillrohrmann commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4238#discussion_r133497146
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/blob/BlobCache.java ---
    @@ -341,8 +424,39 @@ public int getPort() {
                return serverAddress.getPort();
        }
     
    +   /**
    +    * Cleans up BLOBs which are not referenced anymore.
    +    */
    +   @Override
    +   public void run() {
    +           synchronized (jobRefCounters) {
    +                   Iterator<Map.Entry<JobID, RefCount>> entryIter = 
jobRefCounters.entrySet().iterator();
    +
    +                   while (entryIter.hasNext()) {
    +                           Map.Entry<JobID, RefCount> entry = 
entryIter.next();
    +                           RefCount ref = entry.getValue();
    +
    +                           if (ref.references <= 0 && ref.keepUntil > 0 && 
System.currentTimeMillis() >= ref.keepUntil) {
    --- End diff --
    
    We could store the current time so that we don't retrieve it for every 
entry.


> move BLOB ref-counting from LibraryCacheManager to BlobCache
> ------------------------------------------------------------
>
>                 Key: FLINK-7057
>                 URL: https://issues.apache.org/jira/browse/FLINK-7057
>             Project: Flink
>          Issue Type: Sub-task
>          Components: Distributed Coordination, Network
>    Affects Versions: 1.4.0
>            Reporter: Nico Kruber
>            Assignee: Nico Kruber
>
> Currently, the {{LibraryCacheManager}} is doing some ref-counting for JAR 
> files managed by it. Instead, we want the {{BlobCache}} to do that itself for 
> all job-related BLOBs. Also, we do not want to operate on a per-{{BlobKey}} 
> level but rather per job. Therefore, the cleanup process should be adapted, 
> too.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to