replicaInfo.getVolume().isTransientStorage()) { targetReference = volumes.getNextVolume( StorageType.DEFAULT, null, replicaInfo.getNumBytes()); targetVolume = (FsVolumeImpl) targetReference.getVolume();
volumeRef = volumes.getNextVolume(targetStorageType, targetStorageId, block.getNumBytes());
FsVolumeReference ref = volumes.getNextVolume(storageType, storageId, b .getNumBytes()); FsVolumeImpl v = (FsVolumeImpl) ref.getVolume();
ref = volumes.getNextVolume(storageType, storageId, b.getNumBytes());
@Test public void testGetNextVolumeWithClosedVolume() throws IOException { FsVolumeList volumeList = new FsVolumeList( Collections.<VolumeFailureInfo>emptyList(), blockScanner, blockChooser); List<FsVolumeImpl> volumes = new ArrayList<>(); for (int i = 0; i < 3; i++) { File curDir = new File(baseDir, "nextvolume-" + i); curDir.mkdirs(); FsVolumeImpl volume = new FsVolumeImpl(dataset, "storage-id", curDir, conf, StorageType.DEFAULT); volume.setCapacityForTesting(1024 * 1024 * 1024); volumes.add(volume); volumeList.addVolume(volume.obtainReference()); } // Close the second volume. volumes.get(1).closeAndWait(); for (int i = 0; i < 10; i++) { try (FsVolumeReference ref = volumeList.getNextVolume(StorageType.DEFAULT, 128)) { // volume No.2 will not be chosen. assertNotEquals(ref.getVolume(), volumes.get(1)); } } }
replicaInfo.getVolume().isTransientStorage()) { targetReference = volumes.getNextVolume( StorageType.DEFAULT, replicaInfo.getNumBytes()); targetVolume = (FsVolumeImpl) targetReference.getVolume();
volumeRef = volumes.getNextVolume(targetStorageType, block.getNumBytes());
volumeRef = volumes.getNextVolume(targetStorageType, block.getNumBytes());
FsVolumeReference ref = volumes.getNextVolume(storageType, b .getNumBytes()); FsVolumeImpl v = (FsVolumeImpl) ref.getVolume();
.getNextVolume(StorageType.DEFAULT, 0).getVolume(); ReplicaInfo replicaInfo = new FinalizedReplica( blocks[FINALIZED].getLocalBlock(), vol, vol.getCurrentDir().getParentFile());
datanode.getMetrics().incrRamDiskBlocksWrite(); } else { ref = volumes.getNextVolume(storageType, b.getNumBytes());
datanode.getMetrics().incrRamDiskBlocksWrite(); } else { ref = volumes.getNextVolume(storageType, b.getNumBytes());
FsVolumeReference ref = volumes.getNextVolume(storageType, b .getNumBytes()); FsVolumeImpl v = (FsVolumeImpl) ref.getVolume();
replicaInfo.getVolume().isTransientStorage()) { targetReference = volumes.getNextVolume( StorageType.DEFAULT, replicaInfo.getNumBytes()); targetVolume = (FsVolumeImpl) targetReference.getVolume();