public class BlobCacheSizeTracker extends Object
LinkedHashMap to maintain the LRU order for the files in the
cache. When new files are intended to be put into cache, checkLimit is called to query
the files should be removed. This tracker maintains a lock to avoid concurrent modification. To
avoid the inconsistency, make sure that hold the READ/WRITE lock in PermanentBlobCache
first and then hold the lock here.| 限定符和类型 | 字段和说明 |
|---|---|
protected long |
sizeLimit |
| 构造器和说明 |
|---|
BlobCacheSizeTracker(long sizeLimit) |
| 限定符和类型 | 方法和说明 |
|---|---|
List<org.apache.flink.api.java.tuple.Tuple2<org.apache.flink.api.common.JobID,BlobKey>> |
checkLimit(long size)
Check the size limit and return the BLOBs to delete.
|
void |
track(org.apache.flink.api.common.JobID jobId,
BlobKey blobKey,
long size)
Register the BLOB to the tracker.
|
void |
untrack(org.apache.flink.api.java.tuple.Tuple2<org.apache.flink.api.common.JobID,BlobKey> key)
Remove the BLOB from the tracker.
|
void |
untrackAll(org.apache.flink.api.common.JobID jobId)
Unregister all the tracked BLOBs related to the given job.
|
void |
update(org.apache.flink.api.common.JobID jobId,
BlobKey blobKey)
Update the least used index for the BLOBs so that the tracker can easily find out the least
recently used BLOBs.
|
public List<org.apache.flink.api.java.tuple.Tuple2<org.apache.flink.api.common.JobID,BlobKey>> checkLimit(long size)
size - size of the BLOB intended to put into the cachepublic void track(org.apache.flink.api.common.JobID jobId,
BlobKey blobKey,
long size)
public void untrack(org.apache.flink.api.java.tuple.Tuple2<org.apache.flink.api.common.JobID,BlobKey> key)
public void update(org.apache.flink.api.common.JobID jobId,
BlobKey blobKey)
public void untrackAll(org.apache.flink.api.common.JobID jobId)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.