Shubhendu Tripathi has uploaded a new change for review. Change subject: gluster: Changed the type of numeric fields to long ......................................................................
gluster: Changed the type of numeric fields to long Changed the type fo numeric fields in class GlusterVolumeTaskStatusDetail. This is required because numeric fields in status might be holding bigger values and we need long to hold these values. Change-Id: I5c1ade59e328bfcc1440ba8ac410848d296a6a26 Signed-off-by: Shubhendu Tripathi <shtri...@redhat.com> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusDetail.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeTaskReturnForXmlRpc.java 2 files changed, 28 insertions(+), 24 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/09/19909/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusDetail.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusDetail.java index ed9b8ad..50d2847 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusDetail.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterVolumeTaskStatusDetail.java @@ -7,21 +7,21 @@ public class GlusterVolumeTaskStatusDetail implements Serializable { private static final long serialVersionUID = -1134758927239004416L; - private int filesMoved; + private long filesMoved; private long totalSizeMoved; - private int filesScanned; - private int filesFailed; - private int filesSkipped; - private int runTime; + private long filesScanned; + private long filesFailed; + private long filesSkipped; + private long runTime; private JobExecutionStatus status; public GlusterVolumeTaskStatusDetail() { } - public int getFilesMoved() { + public long getFilesMoved() { return filesMoved; } - public void setFilesMoved(int filesMoved) { + public void setFilesMoved(long filesMoved) { this.filesMoved = filesMoved; } public long getTotalSizeMoved() { @@ -30,28 +30,28 @@ public void setTotalSizeMoved(long size) { this.totalSizeMoved = size; } - public int getFilesScanned() { + public long getFilesScanned() { return filesScanned; } - public void setFilesScanned(int totalScannedCount) { + public void setFilesScanned(long totalScannedCount) { this.filesScanned = totalScannedCount; } - public int getFilesFailed() { + public long getFilesFailed() { return filesFailed; } - public void setFilesFailed(int failuresCount) { + public void setFilesFailed(long failuresCount) { this.filesFailed = failuresCount; } - public int getFilesSkipped() { + public long getFilesSkipped() { return filesSkipped; } - public void setFilesSkipped(int filesSkipped) { + public void setFilesSkipped(long filesSkipped) { this.filesSkipped = filesSkipped; } - public int getRunTime() { + public long getRunTime() { return runTime; } - public void setRunTime(int runTime) { + public void setRunTime(long runTime) { this.runTime = runTime; } public JobExecutionStatus getStatus() { diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeTaskReturnForXmlRpc.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeTaskReturnForXmlRpc.java index 586232a..5aa4b55 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeTaskReturnForXmlRpc.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeTaskReturnForXmlRpc.java @@ -6,6 +6,7 @@ import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusDetail; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity; import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusForHost; +import org.ovirt.engine.core.common.job.JobExecutionStatus; public class GlusterVolumeTaskReturnForXmlRpc extends GlusterTaskInfoReturnForXmlRpc { private static final String HOST_LIST = "hosts"; @@ -24,30 +25,33 @@ super(innerMap); if (innerMap.containsKey(HOST_LIST)) { - for (Object nodeStatus : (Object[])innerMap.get(HOST_LIST)) { - statusDetails.getHostwiseStatusDetails().add(getStatusForNode((Map<String, Object>)nodeStatus)); + for (Object nodeStatus : (Object[]) innerMap.get(HOST_LIST)) { + statusDetails.getHostwiseStatusDetails().add(getStatusForNode((Map<String, Object>) nodeStatus)); } } if (innerMap.containsKey(SUMMARY)) { - populateGlusterVolumeTaskStatusDetail(statusDetails.getStatusSummary(), (Map<String, Object>)innerMap.get(SUMMARY)); + populateGlusterVolumeTaskStatusDetail(statusDetails.getStatusSummary(), + (Map<String, Object>) innerMap.get(SUMMARY)); } } private GlusterVolumeTaskStatusForHost getStatusForNode(Map<String, Object> nodeStatus) { GlusterVolumeTaskStatusForHost rebalanceStatusForHost = new GlusterVolumeTaskStatusForHost(); - rebalanceStatusForHost.setHostName((String)nodeStatus.get(HOST_NAME)); + rebalanceStatusForHost.setHostName((String) nodeStatus.get(HOST_NAME)); populateGlusterVolumeTaskStatusDetail(rebalanceStatusForHost, nodeStatus); return rebalanceStatusForHost; } private void populateGlusterVolumeTaskStatusDetail(GlusterVolumeTaskStatusDetail detail, Map<String, Object> map) { - detail.setFilesScanned((Integer)map.get(FILES_SCANNED)); - detail.setFilesMoved((Integer)map.get(FILES_MOVED)); - detail.setFilesFailed((Integer)map.get(FILES_FAILED)); - detail.setTotalSizeMoved(((Integer)map.get(TOTAL_SIZE_MOVED)).longValue()); - detail.setStatus(GlusterAsyncTaskStatus.from((String)map.get(STATUS)).getJobExecutionStatus()); + detail.setFilesScanned(map.containsKey(FILES_SCANNED) ? Long.valueOf(map.get(FILES_SCANNED).toString()) : 0); + detail.setFilesMoved(map.containsKey(FILES_MOVED) ? Long.valueOf(map.get(FILES_MOVED).toString()) : 0); + detail.setFilesFailed(map.containsKey(FILES_FAILED) ? Long.valueOf(map.get(FILES_FAILED).toString()) : 0); + detail.setTotalSizeMoved(map.containsKey(TOTAL_SIZE_MOVED) ? Long.valueOf(map.get(TOTAL_SIZE_MOVED).toString()) + : 0); + detail.setStatus(map.containsKey(STATUS) ? GlusterAsyncTaskStatus.from((String) map.get(STATUS)) + .getJobExecutionStatus() : JobExecutionStatus.UNKNOWN); } public GlusterVolumeTaskStatusEntity getStatusDetails() { -- To view, visit http://gerrit.ovirt.org/19909 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c1ade59e328bfcc1440ba8ac410848d296a6a26 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shubhendu Tripathi <shtri...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches