You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by tillrohrmann <gi...@git.apache.org> on 2017/08/16 16:45:06 UTC

[GitHub] flink pull request #4238: [FLINK-7057][blob] move BLOB ref-counting from Lib...

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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---