void setLazyPersistVolume(FsVolumeImpl volume) { Preconditions.checkState(!volume.isTransientStorage()); this.lazyPersistVolume = volume; }
@Override public void releaseLockedMemory(long bytesToRelease) { if (isTransientStorage()) { dataset.releaseLockedMemory(bytesToRelease, false); } }
private boolean ramDiskConfigured() { for (FsVolumeImpl v: volumes.getVolumes()){ if (v.isTransientStorage()) { return true; } } return false; }
/** * Get next volume. * * @param blockSize free space needed on the volume * @return next volume to store the block in. */ FsVolumeReference getNextTransientVolume(long blockSize) throws IOException { // Get a snapshot of currently available volumes. final List<FsVolumeImpl> curVolumes = getVolumes(); final List<FsVolumeImpl> list = new ArrayList<>(curVolumes.size()); for(FsVolumeImpl v : curVolumes) { if (v.isTransientStorage()) { list.add(v); } } return chooseVolume(list, blockSize, null); }
void onBlockFileDeletion(String bpid, long value) { decDfsUsedAndNumBlocks(bpid, value, true); if (isTransientStorage()) { dataset.releaseLockedMemory(value, true); } }
return; if (volume.isTransientStorage()) { LOG.warn("Caching not supported on block with id " + blockId + " since the volume is backed by RAM.");
private void setupAsyncLazyPersistThread(final FsVolumeImpl v) { // Skip transient volumes if (v.isTransientStorage()) { return; } boolean ramDiskConfigured = ramDiskConfigured(); // Add thread for DISK volume if RamDisk is configured if (ramDiskConfigured && asyncLazyPersistService != null && !asyncLazyPersistService.queryVolume(v)) { asyncLazyPersistService.addVolume(v); } // Remove thread for DISK volume if RamDisk is not configured if (!ramDiskConfigured && asyncLazyPersistService != null && asyncLazyPersistService.queryVolume(v)) { asyncLazyPersistService.removeVolume(v); } }
if (v.isTransientStorage()) { RamDiskReplica replicaInfo = ramDiskReplicaTracker.getReplica(bpid, invalidBlks[i].getBlockId());
void setLazyPersistVolume(FsVolumeImpl volume) { Preconditions.checkState(!volume.isTransientStorage()); this.lazyPersistVolume = volume; }
private boolean ramDiskConfigured() { for (FsVolumeImpl v: getVolumes()){ if (v.isTransientStorage()) { return true; } } return false; }
void setLazyPersistVolume(FsVolumeImpl volume) { Preconditions.checkState(!volume.isTransientStorage()); this.lazyPersistVolume = volume; }
if (v.isTransientStorage()) { releaseLockedMemory( replicaInfo.getOriginalBytesReserved()
private boolean ramDiskConfigured() { for (FsVolumeImpl v: getVolumes()){ if (v.isTransientStorage()) { return true; } } return false; }
if (allowLazyPersist && !v.isTransientStorage()) { datanode.getMetrics().incrRamDiskBlocksWriteFallback();
/** * Get next volume. * * @param blockSize free space needed on the volume * @return next volume to store the block in. */ FsVolumeReference getNextTransientVolume(long blockSize) throws IOException { // Get a snapshot of currently available volumes. final List<FsVolumeImpl> curVolumes = getVolumes(); final List<FsVolumeImpl> list = new ArrayList<>(curVolumes.size()); for(FsVolumeImpl v : curVolumes) { if (v.isTransientStorage()) { list.add(v); } } return chooseVolume(list, blockSize); }
/** * Get next volume. * * @param blockSize free space needed on the volume * @return next volume to store the block in. */ FsVolumeReference getNextTransientVolume(long blockSize) throws IOException { // Get a snapshot of currently available volumes. final List<FsVolumeImpl> curVolumes = getVolumes(); final List<FsVolumeImpl> list = new ArrayList<>(curVolumes.size()); for(FsVolumeImpl v : curVolumes) { if (v.isTransientStorage()) { list.add(v); } } return chooseVolume(list, blockSize); }
private boolean transientFreeSpaceBelowThreshold() throws IOException { long free = 0; long capacity = 0; float percentFree = 0.0f; // Don't worry about fragmentation for now. We don't expect more than one // transient volume per DN. for (FsVolumeImpl v : getVolumes()) { try (FsVolumeReference ref = v.obtainReference()) { if (v.isTransientStorage()) { capacity += v.getCapacity(); free += v.getAvailable(); } } catch (ClosedChannelException e) { // ignore. } } if (capacity == 0) { return false; } percentFree = (float) ((double)free * 100 / capacity); return (percentFree < lowWatermarkFreeSpacePercentage) || (free < lowWatermarkFreeSpaceBytes); }
private boolean transientFreeSpaceBelowThreshold() throws IOException { long free = 0; long capacity = 0; float percentFree = 0.0f; // Don't worry about fragmentation for now. We don't expect more than one // transient volume per DN. for (FsVolumeImpl v : getVolumes()) { try (FsVolumeReference ref = v.obtainReference()) { if (v.isTransientStorage()) { capacity += v.getCapacity(); free += v.getAvailable(); } } catch (ClosedChannelException e) { // ignore. } } if (capacity == 0) { return false; } percentFree = (float) ((double)free * 100 / capacity); return (percentFree < lowWatermarkFreeSpacePercentage) || (free < lowWatermarkFreeSpaceBytes); }
private void setupAsyncLazyPersistThread(final FsVolumeImpl v) { // Skip transient volumes if (v.isTransientStorage()) { return; } boolean ramDiskConfigured = ramDiskConfigured(); // Add thread for DISK volume if RamDisk is configured if (ramDiskConfigured && !asyncLazyPersistService.queryVolume(v.getCurrentDir())) { asyncLazyPersistService.addVolume(v.getCurrentDir()); } // Remove thread for DISK volume if RamDisk is not configured if (!ramDiskConfigured && asyncLazyPersistService.queryVolume(v.getCurrentDir())) { asyncLazyPersistService.removeVolume(v.getCurrentDir()); } }
private void setupAsyncLazyPersistThread(final FsVolumeImpl v) { // Skip transient volumes if (v.isTransientStorage()) { return; } boolean ramDiskConfigured = ramDiskConfigured(); // Add thread for DISK volume if RamDisk is configured if (ramDiskConfigured && !asyncLazyPersistService.queryVolume(v.getCurrentDir())) { asyncLazyPersistService.addVolume(v.getCurrentDir()); } // Remove thread for DISK volume if RamDisk is not configured if (!ramDiskConfigured && asyncLazyPersistService.queryVolume(v.getCurrentDir())) { asyncLazyPersistService.removeVolume(v.getCurrentDir()); } }