new UncachingTask(key, revocationMs), revocationPollingMs, TimeUnit.MILLISECONDS); } else { LOG.debug("{} has been scheduled for immediate uncaching.", key); uncachingExecutor.execute(new UncachingTask(key, 0));
@Override public void run() { Value value; if (shouldDefer()) { deferredUncachingExecutor.schedule( this, revocationPollingMs, TimeUnit.MILLISECONDS); return; } synchronized (FsDatasetCache.this) { value = mappableBlockMap.get(key); } Preconditions.checkNotNull(value); Preconditions.checkArgument(value.state == State.UNCACHING); IOUtils.closeQuietly(value.mappableBlock); synchronized (FsDatasetCache.this) { mappableBlockMap.remove(key); } long newUsedBytes = release(value.mappableBlock.getLength()); numBlocksCached.addAndGet(-1); dataset.datanode.getMetrics().incrBlocksUncached(1); if (revocationTimeMs != 0) { LOG.debug("Uncaching of {} completed. usedBytes = {}", key, newUsedBytes); } else { LOG.debug("Deferred uncaching of {} completed. usedBytes = {}", key, newUsedBytes); } } }
key, DurationFormatUtils.formatDurationHMS(revocationPollingMs)); deferredUncachingExecutor.schedule( new UncachingTask(key, revocationMs), revocationPollingMs, TimeUnit.MILLISECONDS); } else { LOG.debug("{} has been scheduled for immediate uncaching.", key); uncachingExecutor.execute(new UncachingTask(key, 0));
key, DurationFormatUtils.formatDurationHMS(revocationPollingMs)); deferredUncachingExecutor.schedule( new UncachingTask(key, revocationMs), revocationPollingMs, TimeUnit.MILLISECONDS); } else { LOG.debug("{} has been scheduled for immediate uncaching.", key); uncachingExecutor.execute(new UncachingTask(key, 0));
@Override public void run() { Value value; if (shouldDefer()) { deferredUncachingExecutor.schedule( this, revocationPollingMs, TimeUnit.MILLISECONDS); return; } synchronized (FsDatasetCache.this) { value = mappableBlockMap.get(key); } Preconditions.checkNotNull(value); Preconditions.checkArgument(value.state == State.UNCACHING); IOUtils.closeQuietly(value.mappableBlock); synchronized (FsDatasetCache.this) { mappableBlockMap.remove(key); } long newUsedBytes = usedBytesCount.release(value.mappableBlock.getLength()); numBlocksCached.addAndGet(-1); dataset.datanode.getMetrics().incrBlocksUncached(1); if (revocationTimeMs != 0) { LOG.debug("Uncaching of {} completed. usedBytes = {}", key, newUsedBytes); } else { LOG.debug("Deferred uncaching of {} completed. usedBytes = {}", key, newUsedBytes); } } }
@Override public void run() { Value value; if (shouldDefer()) { deferredUncachingExecutor.schedule( this, revocationPollingMs, TimeUnit.MILLISECONDS); return; } synchronized (FsDatasetCache.this) { value = mappableBlockMap.get(key); } Preconditions.checkNotNull(value); Preconditions.checkArgument(value.state == State.UNCACHING); IOUtils.closeQuietly(value.mappableBlock); synchronized (FsDatasetCache.this) { mappableBlockMap.remove(key); } long newUsedBytes = usedBytesCount.release(value.mappableBlock.getLength()); numBlocksCached.addAndGet(-1); dataset.datanode.getMetrics().incrBlocksUncached(1); if (revocationTimeMs != 0) { LOG.debug("Uncaching of {} completed. usedBytes = {}", key, newUsedBytes); } else { LOG.debug("Deferred uncaching of {} completed. usedBytes = {}", key, newUsedBytes); } } }