ravening commented on a change in pull request #3997:
URL: https://github.com/apache/cloudstack/pull/3997#discussion_r521409868



##########
File path: server/src/main/java/com/cloud/test/IPRangeConfig.java
##########
@@ -313,35 +313,35 @@ public static long getCidrSize(String pod, String zone) {
         return problemIPs;
     }
 
-    private Vector<String> deletePublicIPRange(TransactionLegacy txn, long 
startIP, long endIP, long vlanDbId) {
-        String deleteSql = "DELETE FROM `cloud`.`user_ip_address` WHERE 
public_ip_address = ? AND vlan_id = ?";
-        String isPublicIPAllocatedSelectSql = "SELECT * FROM 
`cloud`.`user_ip_address` WHERE public_ip_address = ? AND vlan_id = ?";
+    public Vector<String> deletePublicIPRange(TransactionLegacy txn, long 
startIP, long endIP, long vlanDbId) {
+        String deleteSql = "DELETE FROM `cloud`.`user_ip_address` WHERE 
public_ip_address = ? AND vlan_db_id = ?";
+        String isPublicIPAllocatedSelectSql = "SELECT * FROM 
`cloud`.`user_ip_address` WHERE public_ip_address = ? AND vlan_db_id = ?";
 
         Vector<String> problemIPs = new Vector<String>();
         Connection conn = null;
         try {
             conn = txn.getConnection();
         }
         catch (SQLException e) {
-            System.out.println("deletePublicIPRange. Exception: " 
+e.getMessage());
+            System.out.println("deletePublicIPRange. Exception: " + 
e.getMessage());
             return null;
         }
-        try(PreparedStatement stmt = conn.prepareStatement(deleteSql);
+        try (PreparedStatement stmt = conn.prepareStatement(deleteSql);
             PreparedStatement isAllocatedStmt = 
conn.prepareStatement(isPublicIPAllocatedSelectSql);) {
             while (startIP <= endIP) {
-                if (!isPublicIPAllocated(startIP, vlanDbId, isAllocatedStmt)) {
+                if (!isPublicIPAllocated(NetUtils.long2Ip(startIP), vlanDbId, 
isAllocatedStmt)) {

Review comment:
       > Good point! Allow me to explore. Will this be a blocker?
   
   Not a blocker but performance degradation




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to