Allon Mureinik has posted comments on this change.
Change subject: engine: Display correct and user friendly size of iso files
......................................................................
Patch Set 1:
(5 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/IsoDomainListSyncronizer.java
Line 545
Line 546
Line 547
Line 548
Line 549
why remove the javadoc instead of fixing it?
Line 539: }
Line 540:
Line 541: private static boolean refreshIsoFileListMetaData(final Guid
repoStorageDomainId,
Line 542: final
RepoFileMetaDataDAO repoFileMetaDataDao,
Line 543: final
Map<String, Map<String, String>> isoDomainList,
This is now a map - might as well rename the param too.
Line 544: final
ImageFileType imageType) {
Line 545: Lock syncObject = getSyncObject(repoStorageDomainId,
imageType);
Line 546: try {
Line 547: syncObject.lock();
Line 573:
Line 574: private static long retrieveIsoFileSize(Map.Entry<String,
Map<String, String>> isoFile) {
Line 575: // old VDSM versions don't provide the metadata for iso files
therefore engine
Line 576: // cannot determine the correct size of the iso file.
Line 577: if (isoFile.getValue().isEmpty() ||
!isoFile.getValue().containsKey("size")) {
checking isoFile.getValue().isEmpty() is redundant.
If it's empty, it doesn't contain the key "size" anyway.
Also - why check containsKey and then get, instead of just using get("size")
and checking it's not null?
Line 578: return 0;
Line 579: } else {
Line 580: return Long.valueOf(isoFile.getValue().get("size"));
Line 581: }
Line 575: // old VDSM versions don't provide the metadata for iso files
therefore engine
Line 576: // cannot determine the correct size of the iso file.
Line 577: if (isoFile.getValue().isEmpty() ||
!isoFile.getValue().containsKey("size")) {
Line 578: return 0;
Line 579: } else {
I'd unwrap the else block, but that's just me.
Line 580: return Long.valueOf(isoFile.getValue().get("size"));
Line 581: }
Line 582: }
Line 583:
Line 633: .getResourceManager()
Line 634: .RunVdsCommand(VDSCommandType.GetIsoList,
Line 635: new
IrsBaseVDSCommandParameters(repoStoragePoolId));
Line 636: @SuppressWarnings("unchecked")
Line 637: Map isoDomainList = (Map)
returnValue.getReturnValue();
what about generics?
Line 638: if (returnValue.getSucceeded() && isoDomainList !=
null) {
Line 639: log.debugFormat("The refresh process from VDSM,
for Iso files succeeded.");
Line 640: // Set the Iso domain file list fetched from VDSM
into the DB.
Line 641: refreshIsoSucceeded =
--
To view, visit http://gerrit.ovirt.org/19549
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I77bd99beb8138524b25f0afdcce0815ad8664f0f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches