Allon Mureinik has posted comments on this change.

Change subject: engine: Remove redundant constant IrsBrokerCommand.BYTES_TO_GB
......................................................................


Patch Set 1:

(5 comments)

....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java
Line 114:         if (size == null) {
Line 115:             size = IrsBrokerCommand.AssignLongValue(xlun, "capacity");
Line 116:         }
Line 117:         if (size != null) {
Line 118:             lun.setDeviceSize((int) (size / 
SizeConverter.BYTES_IN_GB));
Why not call SizeConverter.convert(size, BYTES, GB) ?
Line 119:         }
Line 120:         if (xlun.containsKey("vendorID")) {
Line 121:             lun.setVendorName(xlun.get("vendorID").toString());
Line 122:         }


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetStorageDomainStatsVDSCommand.java
Line 49:                             .toString(), true));
Line 50:                 }
Line 51:             }
Line 52:             Long size = IrsBrokerCommand.AssignLongValue(xmlRpcStruct, 
"diskfree");
Line 53:             domain.setAvailableDiskSize((size == null) ? null : (int) 
(size / SizeConverter.BYTES_IN_GB));
Why not call SizeConverter.convert(size, BYTES, GB) ?
Line 54:             size = IrsBrokerCommand.AssignLongValue(xmlRpcStruct, 
"disktotal");
Line 55:             domain.setUsedDiskSize((size == null || 
domain.getAvailableDiskSize() == null) ? null :
Line 56:                     (int) (size / SizeConverter.BYTES_IN_GB) - 
domain.getAvailableDiskSize());
Line 57:             if (xmlRpcStruct.containsKey("alerts")) {


Line 52:             Long size = IrsBrokerCommand.AssignLongValue(xmlRpcStruct, 
"diskfree");
Line 53:             domain.setAvailableDiskSize((size == null) ? null : (int) 
(size / SizeConverter.BYTES_IN_GB));
Line 54:             size = IrsBrokerCommand.AssignLongValue(xmlRpcStruct, 
"disktotal");
Line 55:             domain.setUsedDiskSize((size == null || 
domain.getAvailableDiskSize() == null) ? null :
Line 56:                     (int) (size / SizeConverter.BYTES_IN_GB) - 
domain.getAvailableDiskSize());
Why not call SizeConverter.convert(size, BYTES, GB) ?
Line 57:             if (xmlRpcStruct.containsKey("alerts")) {
Line 58:                 Object[] rawAlerts = (Object[]) 
xmlRpcStruct.get("alerts");
Line 59:                 Set<VdcBllErrors> alerts = new 
HashSet<VdcBllErrors>(rawAlerts.length);
Line 60: 


....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetVGListVDSCommand.java
Line 43:             }
Line 44:             sDomain.setStorage(vg.get("vgUUID").toString());
Line 45:             Long size = IrsBrokerCommand.AssignLongValue(vg, "vgfree");
Line 46:             if (size != null) {
Line 47:                 sDomain.setAvailableDiskSize((int) (size / 
SizeConverter.BYTES_IN_GB));
Why not call SizeConverter.convert(size, BYTES, GB) ?
Line 48:             }
Line 49:             size = IrsBrokerCommand.AssignLongValue(vg, "vgsize");
Line 50:             if (size != null && sDomain.getAvailableDiskSize() != 
null) {
Line 51:                 sDomain.setUsedDiskSize((int) (size / 
SizeConverter.BYTES_IN_GB)


Line 47:                 sDomain.setAvailableDiskSize((int) (size / 
SizeConverter.BYTES_IN_GB));
Line 48:             }
Line 49:             size = IrsBrokerCommand.AssignLongValue(vg, "vgsize");
Line 50:             if (size != null && sDomain.getAvailableDiskSize() != 
null) {
Line 51:                 sDomain.setUsedDiskSize((int) (size / 
SizeConverter.BYTES_IN_GB)
Why not call SizeConverter.convert(size, BYTES, GB) ?
Line 52:                         - sDomain.getAvailableDiskSize());
Line 53:             }
Line 54:             if (vg.containsKey("vgtype")) {
Line 55:                 
sDomain.setStorageType(EnumUtils.valueOf(StorageType.class, 
vg.get("vgtype").toString(), true));


-- 
To view, visit http://gerrit.ovirt.org/21314
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0a3cede172aebab1182dca0ceec901be8553e6ae
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[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

Reply via email to