/** * Registers use of job-related BLOBs. * * <p>Using any other method to access BLOBs, e.g. {@link #getFile}, is only valid within * calls to <tt>registerJob(JobID)</tt> and {@link #releaseJob(JobID)}. * * @param jobId * ID of the job this blob belongs to * * @see #releaseJob(JobID) */ public void registerJob(JobID jobId) { checkNotNull(jobId); synchronized (jobRefCounters) { RefCount ref = jobRefCounters.get(jobId); if (ref == null) { ref = new RefCount(); jobRefCounters.put(jobId, ref); } else { // reset cleanup timeout ref.keepUntil = -1; } ++ref.references; } }
/** * Registers use of job-related BLOBs. * * <p>Using any other method to access BLOBs, e.g. {@link #getFile}, is only valid within * calls to <tt>registerJob(JobID)</tt> and {@link #releaseJob(JobID)}. * * @param jobId * ID of the job this blob belongs to * * @see #releaseJob(JobID) */ public void registerJob(JobID jobId) { checkNotNull(jobId); synchronized (jobRefCounters) { RefCount ref = jobRefCounters.get(jobId); if (ref == null) { ref = new RefCount(); jobRefCounters.put(jobId, ref); } else { // reset cleanup timeout ref.keepUntil = -1; } ++ref.references; } }
/** * Registers use of job-related BLOBs. * * <p>Using any other method to access BLOBs, e.g. {@link #getFile}, is only valid within * calls to <tt>registerJob(JobID)</tt> and {@link #releaseJob(JobID)}. * * @param jobId * ID of the job this blob belongs to * * @see #releaseJob(JobID) */ public void registerJob(JobID jobId) { checkNotNull(jobId); synchronized (jobRefCounters) { RefCount ref = jobRefCounters.get(jobId); if (ref == null) { ref = new RefCount(); jobRefCounters.put(jobId, ref); } else { // reset cleanup timeout ref.keepUntil = -1; } ++ref.references; } }