this.cache = checkNotNull(cache, "cache");
}
@Override
public Volume apply(Device input) {
VolumeBuilder builder = new VolumeBuilder();
builder.id(input.getId());
try {
DriveInfo drive = cache.getUnchecked(input.getDriveUuid());
builder.size(drive.getSize() / (float) (1024 * 1024));
} catch (NullPointerException e) {
logger.debug("drive %s not found", input.getDriveUuid());
} catch (UncheckedExecutionException e) {
logger.warn(e, "error finding drive %s: %s", input.getDriveUuid(), e.getMessage());
}
return new VolumeBuilder().durable(true).type(Volume.Type.NAS).build();
}