This is an automated email from the ASF dual-hosted git repository.

zhouky pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new ccea1bda3 [MINOR] Fix integer overflow in expression
ccea1bda3 is described below

commit ccea1bda395107cc1460577e0f2d952b6ca1e35e
Author: xleoken <[email protected]>
AuthorDate: Sat Sep 30 21:43:47 2023 +0800

    [MINOR] Fix integer overflow in expression
    
    ### What changes were proposed in this pull request?
    
    Fix integer overflow in expression, the `64 * 1024 * 1024 * 1024` result is 
`0` not a long value.
    
    ### Why are the changes needed?
    
    ### Does this PR introduce _any_ user-facing change?
    
    ### How was this patch tested?
    
    Closes #1951 from xleoken/patch.
    
    Authored-by: xleoken <[email protected]>
    Signed-off-by: zky.zhoukeyong <[email protected]>
---
 .../clustermeta/ha/MasterStateMachineSuiteJ.java       | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git 
a/master/src/test/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MasterStateMachineSuiteJ.java
 
b/master/src/test/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MasterStateMachineSuiteJ.java
index bcf067826..5de184638 100644
--- 
a/master/src/test/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MasterStateMachineSuiteJ.java
+++ 
b/master/src/test/java/org/apache/celeborn/service/deploy/master/clustermeta/ha/MasterStateMachineSuiteJ.java
@@ -208,9 +208,9 @@ public class MasterStateMachineSuiteJ extends 
RatisBaseSuiteJ {
     File tmpFile = File.createTempFile("tef", "test" + 
System.currentTimeMillis());
 
     Map<String, DiskInfo> disks1 = new HashMap<>();
-    disks1.put("disk1", new DiskInfo("disk1", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
-    disks1.put("disk2", new DiskInfo("disk2", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
-    disks1.put("disk3", new DiskInfo("disk3", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
+    disks1.put("disk1", new DiskInfo("disk1", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
+    disks1.put("disk2", new DiskInfo("disk2", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
+    disks1.put("disk3", new DiskInfo("disk3", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
     Map<UserIdentifier, ResourceConsumption> userResourceConsumption1 =
         JavaUtils.newConcurrentHashMap();
     userResourceConsumption1.put(
@@ -221,9 +221,9 @@ public class MasterStateMachineSuiteJ extends 
RatisBaseSuiteJ {
         new UserIdentifier("tenant1", "name3"), new ResourceConsumption(3000, 
3, 3000, 3));
 
     Map<String, DiskInfo> disks2 = new HashMap<>();
-    disks2.put("disk1", new DiskInfo("disk1", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
-    disks2.put("disk2", new DiskInfo("disk2", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
-    disks2.put("disk3", new DiskInfo("disk3", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
+    disks2.put("disk1", new DiskInfo("disk1", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
+    disks2.put("disk2", new DiskInfo("disk2", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
+    disks2.put("disk3", new DiskInfo("disk3", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
     Map<UserIdentifier, ResourceConsumption> userResourceConsumption2 =
         JavaUtils.newConcurrentHashMap();
     userResourceConsumption2.put(
@@ -234,9 +234,9 @@ public class MasterStateMachineSuiteJ extends 
RatisBaseSuiteJ {
         new UserIdentifier("tenant2", "name3"), new ResourceConsumption(3000, 
3, 3000, 3));
 
     Map<String, DiskInfo> disks3 = new HashMap<>();
-    disks3.put("disk1", new DiskInfo("disk1", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
-    disks3.put("disk2", new DiskInfo("disk2", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
-    disks3.put("disk3", new DiskInfo("disk3", 64 * 1024 * 1024 * 1024, 100, 
100, 0));
+    disks3.put("disk1", new DiskInfo("disk1", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
+    disks3.put("disk2", new DiskInfo("disk2", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
+    disks3.put("disk3", new DiskInfo("disk3", 64 * 1024 * 1024 * 1024L, 100, 
100, 0));
     Map<UserIdentifier, ResourceConsumption> userResourceConsumption3 =
         JavaUtils.newConcurrentHashMap();
     userResourceConsumption3.put(

Reply via email to