@Override protected File getFileInternal(@Nullable JobID jobId, BlobKey blobKey) throws IOException { File file = super.getFileInternal(jobId, blobKey); readWriteLock.readLock().lock(); try { // regarding concurrent operations, it is not really important which timestamp makes // it into the map as they are close to each other anyway, also we can simply // overwrite old values as long as we are in the read (or write) lock blobExpiryTimes.put(Tuple2.of(jobId, (TransientBlobKey) blobKey), System.currentTimeMillis() + cleanupInterval); } finally { readWriteLock.readLock().unlock(); } return file; }
@Override protected File getFileInternal(@Nullable JobID jobId, BlobKey blobKey) throws IOException { File file = super.getFileInternal(jobId, blobKey); readWriteLock.readLock().lock(); try { // regarding concurrent operations, it is not really important which timestamp makes // it into the map as they are close to each other anyway, also we can simply // overwrite old values as long as we are in the read (or write) lock blobExpiryTimes.put(Tuple2.of(jobId, (TransientBlobKey) blobKey), System.currentTimeMillis() + cleanupInterval); } finally { readWriteLock.readLock().unlock(); } return file; }
@Override protected File getFileInternal(@Nullable JobID jobId, BlobKey blobKey) throws IOException { File file = super.getFileInternal(jobId, blobKey); readWriteLock.readLock().lock(); try { // regarding concurrent operations, it is not really important which timestamp makes // it into the map as they are close to each other anyway, also we can simply // overwrite old values as long as we are in the read (or write) lock blobExpiryTimes.put(Tuple2.of(jobId, (TransientBlobKey) blobKey), System.currentTimeMillis() + cleanupInterval); } finally { readWriteLock.readLock().unlock(); } return file; }