int[] fileKeys = diskUnits[diskUnits.length - 1].getFileKey();
// count the total of each file's size
long total = 0;
for (int fileKey : fileKeys) {
FileInfo fileInfo = fileMap.get(fileKey);
if (fileInfo != null) {
total += fileInfo.getSize();
}
}
// add up
size.add(total);
DeviceId deviceId =
new DeviceId(findDevice(devices, vdisk.getControllerKey()), vdisk);
sizeDetail.put(deviceId, new DiskSize(total));
}
}
// add vmsn file size which is always on data storage
FileInfo fileInfo = fileMap.get(snapshotLayout.getDataKey());
if (fileInfo != null) {
size.add(fileInfo.getSize());
vmsnFileSize = new DiskSize(fileInfo.getSize());
}
return;
}
}
// no matching file layout for this snapshot?