ztzg commented on a change in pull request #934: ZOOKEEPER-3301:Enforce the 
quota limit
URL: https://github.com/apache/zookeeper/pull/934#discussion_r357055437
 
 

 ##########
 File path: 
zookeeper-server/src/main/java/org/apache/zookeeper/cli/DelQuotaCommand.java
 ##########
 @@ -129,7 +137,23 @@ public static boolean delQuota(ZooKeeper zk, String path,
             }
             // cut the tree till their is more than one child
             trimProcQuotas(zk, parentPath);
+        } else {
+            if (quota.getCount() > 0) {
+                strack.setCount(-1);
+            }
+            if (quota.getBytes() > 0) {
+                strack.setBytes(-1L);
+            }
+            if (quota.getCountHardLimit() > 0) {
+                strack.setCountHardLimit(-1);
+            }
+            if (quota.getByteHardLimit() > 0) {
+                strack.setByteHardLimit(-1L);
+            }
+
+            zk.setData(quotaPath, strack.toString().getBytes(), -1);
 
 Review comment:
   Same US-ASCII remark as above, but for 
[`getBytes`](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#getBytes-java.nio.charset.Charset-):
   
   ```java
   strack.toString().getBytes(US_ASCII)
   ```
   
   with, perhaps, a new `byte[] StatsTrack.toNodeData()` method which 
centralizes the conversion in one place?

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to