Darshan N has uploaded a new change for review.

Change subject: gluster:Datatype change for bytesRead & bytesWritten from int 
to long.
......................................................................

gluster:Datatype change for bytesRead & bytesWritten from int to long.

This patch changes the datatype of bytesRead and bytesWritten from int
to long to avoid the data overflow that may occur.

Change-Id: I13d58707ae87d71edab9fbe01eb58329cc1ce574
Bug-url: https://bugzilla.redhat.com/show_bug.cgi?id=1058203
Signed-off-by: ndarshan <dnara...@redhat.com>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterClientInfo.java
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M 
backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterBrickDetailMapperTest.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
4 files changed, 12 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/46/23746/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterClientInfo.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterClientInfo.java
index ac03e97..a05b029 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterClientInfo.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterClientInfo.java
@@ -14,9 +14,9 @@
 
     private int clientPort;
 
-    private int bytesRead;
+    private long bytesRead;
 
-    private int bytesWritten;
+    private long bytesWritten;
 
     public String getHostname() {
         return hostname;
@@ -34,19 +34,19 @@
         this.clientPort = clientPort;
     }
 
-    public int getBytesRead() {
+    public long getBytesRead() {
         return bytesRead;
     }
 
-    public void setBytesRead(int bytesRead) {
+    public void setBytesRead(long bytesRead) {
         this.bytesRead = bytesRead;
     }
 
-    public int getBytesWritten() {
+    public long getBytesWritten() {
         return bytesWritten;
     }
 
-    public void setBytesWritten(int bytesWritten) {
+    public void setBytesWritten(long bytesWritten) {
         this.bytesWritten = bytesWritten;
     }
 }
diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
index db86dcd..ea68811 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
@@ -3396,8 +3396,8 @@
     <xs:sequence>
       <xs:element name="host_name" type="xs:string" minOccurs="0" 
maxOccurs="1"/>
       <xs:element name="client_port" type="xs:int" minOccurs="0" 
maxOccurs="1"/>
-      <xs:element name="bytes_read" type="xs:int" minOccurs="0" maxOccurs="1"/>
-      <xs:element name="bytes_written" type="xs:int" minOccurs="0" 
maxOccurs="1"/>
+      <xs:element name="bytes_read" type="xs:long" minOccurs="0" 
maxOccurs="1"/>
+      <xs:element name="bytes_written" type="xs:long" minOccurs="0" 
maxOccurs="1"/>
     </xs:sequence>
   </xs:complexType>
 
diff --git 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterBrickDetailMapperTest.java
 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterBrickDetailMapperTest.java
index f705c7e..ffc06ee 100644
--- 
a/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterBrickDetailMapperTest.java
+++ 
b/backend/manager/modules/restapi/types/src/test/java/org/ovirt/engine/api/restapi/types/GlusterBrickDetailMapperTest.java
@@ -114,8 +114,8 @@
         ArrayList<GlusterClientInfo> list = new ArrayList<GlusterClientInfo>();
         for(int i=0; i < listSize ; i++) {
             GlusterClientInfo clientInfo = new GlusterClientInfo();
-            clientInfo.setBytesRead(RandomUtils.instance().nextInt());
-            clientInfo.setBytesWritten(RandomUtils.instance().nextInt());
+            clientInfo.setBytesRead(RandomUtils.instance().nextLong());
+            clientInfo.setBytesWritten(RandomUtils.instance().nextLong());
             clientInfo.setClientPort(RandomUtils.instance().nextInt());
             clientInfo.setHostname(RandomUtils.instance().nextString(7));
             list.add(clientInfo);
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
index 77d1e32..0839856 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/gluster/GlusterVolumeStatusReturnForXmlRpc.java
@@ -255,8 +255,8 @@
 
             clientInfo.setHostname(hostNameArr[0]);
             clientInfo.setClientPort(Integer.valueOf(hostNameArr[1]));
-            clientInfo.setBytesRead(Integer.valueOf((String) 
client.get(CLIENTS_BYTES_READ)));
-            clientInfo.setBytesWritten(Integer.valueOf((String) 
client.get(CLIENTS_BYTES_WRITE)));
+            clientInfo.setBytesRead(Long.valueOf((String) 
client.get(CLIENTS_BYTES_READ)));
+            clientInfo.setBytesWritten(Long.valueOf((String) 
client.get(CLIENTS_BYTES_WRITE)));
             clientInfoList.add(clientInfo);
         }
         return clientInfoList;


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13d58707ae87d71edab9fbe01eb58329cc1ce574
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Darshan N <dnara...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to