anmolbabu has posted comments on this change.
Change subject: gluster : In the task tab, size of rebalanced files is shown
with units
......................................................................
Patch Set 19:
(5 comments)
Sorry,I had missed these comments will incorporate them right now.
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusEntity.java
Line 73: .append(statusSummary.getFilesMoved())
Line 74: .append(", failed: ")
Line 75: .append(statusSummary.getFilesFailed())
Line 76: .append(", Total size moved: ")
Line 77:
.append((formatSize.format(sizeMoved.getValue())).toString().concat("
").concat(sizeMoved.getUnit().toString()));
Done
Line 78: return builder.toString();
Line 79: }
Line 80:
Line 81: public Date getStopTime() {
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/SizeConverter.java
Line 11: public static final long BYTES_IN_KB = 1024L;
Line 12: public static final long BYTES_IN_MB = 1024L * 1024L;
Line 13: public static final long BYTES_IN_GB = 1024L * 1024L * 1024L;
Line 14:
Line 15: public static Map<Long, SizeUnit> weightToUnit = new TreeMap<Long,
SizeUnit>(new CompareUnits());
Done
Line 16:
Line 17: public static enum SizeUnit {
Line 18: BYTES(1),
Line 19: KB(2),
Line 43: }
Line 44:
Line 45: public static Size autoConvert(long size, SizeUnit inUnit) {
Line 46:
Line 47: for (long i = weightToUnit.size(); i >=
inUnit.getUnitWeight(); i--) {
Done
Line 48: if (size / Math.pow(CONVERT_FACTOR, i - 1) >= 1) {
Line 49: return new
SizeConverter.Size(SizeConverter.SizeUnit.getUnit(i),
SizeConverter.convert(size,
Line 50: inUnit,
Line 51: SizeUnit.getUnit(i)).doubleValue());
Line 44:
Line 45: public static Size autoConvert(long size, SizeUnit inUnit) {
Line 46:
Line 47: for (long i = weightToUnit.size(); i >=
inUnit.getUnitWeight(); i--) {
Line 48: if (size / Math.pow(CONVERT_FACTOR, i - 1) >= 1) {
Done
Line 49: return new
SizeConverter.Size(SizeConverter.SizeUnit.getUnit(i),
SizeConverter.convert(size,
Line 50: inUnit,
Line 51: SizeUnit.getUnit(i)).doubleValue());
Line 52: }
Line 79: this.value = value;
Line 80: }
Line 81: }
Line 82:
Line 83: static class CompareUnits implements Comparator<Long> {
Done
Line 84:
Line 85: @Override
Line 86: public int compare(Long unit1Weight, Long unit2Weight) {
Line 87: return unit1Weight.compareTo(unit2Weight);
--
To view, visit http://gerrit.ovirt.org/20511
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iea6c90a098bfddfb616bc2b8ce58c9d0bb567f66
Gerrit-PatchSet: 19
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Shubhendu Tripathi <[email protected]>
Gerrit-Reviewer: anmolbabu <[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