activateVolume(tempVolumeMap, sd, storageType, ref); LOG.info("Added volume - " + location + ", StorageType: " + storageType);
private void addVolume(Storage.StorageDirectory sd) throws IOException { final StorageLocation storageLocation = sd.getStorageLocation(); // If IOException raises from FsVolumeImpl() or getVolumeMap(), there is // nothing needed to be rolled back to make various data structures, e.g., // storageMap and asyncDiskService, consistent. FsVolumeImpl fsVolume = new FsVolumeImplBuilder() .setDataset(this) .setStorageID(sd.getStorageUuid()) .setStorageDirectory(sd) .setFileIoProvider(datanode.getFileIoProvider()) .setConf(this.conf) .build(); FsVolumeReference ref = fsVolume.obtainReference(); ReplicaMap tempVolumeMap = new ReplicaMap(datasetLock); fsVolume.getVolumeMap(tempVolumeMap, ramDiskReplicaTracker); activateVolume(tempVolumeMap, sd, storageLocation.getStorageType(), ref); LOG.info("Added volume - " + storageLocation + ", StorageType: " + storageLocation.getStorageType()); }