bziobrowski commented on code in PR #14226:
URL: https://github.com/apache/pinot/pull/14226#discussion_r1810173481


##########
pinot-common/src/main/java/org/apache/pinot/common/metadata/ZKMetadataProvider.java:
##########
@@ -758,4 +768,81 @@ public static boolean 
getClusterTenantIsolationEnabled(ZkHelixPropertyStore<ZNRe
       return true;
     }
   }
+
+  public static boolean setApplicationQpsQuota(ZkHelixPropertyStore<ZNRecord> 
propertyStore, String applicationName,
+      Double value) {
+    final ZNRecord znRecord;
+    final String path = 
constructPropertyStorePathForControllerConfig(CLUSTER_APPLICATION_QUOTAS);
+
+    boolean doCreate;
+    if (!propertyStore.exists(path, AccessOption.PERSISTENT)) {
+      znRecord = new ZNRecord(CLUSTER_APPLICATION_QUOTAS);
+      doCreate = true;
+    } else {
+      znRecord = propertyStore.get(path, null, AccessOption.PERSISTENT);
+      doCreate = false;
+    }
+
+    Map<String, String> quotas = 
znRecord.getMapField(CLUSTER_APPLICATION_QUOTAS);
+    if (quotas == null) {
+      quotas = new HashMap<>();
+      znRecord.setMapField(CLUSTER_APPLICATION_QUOTAS, quotas);
+    }
+    quotas.put(applicationName, value != null ? value.toString() : null);
+
+    if (doCreate) {
+      return propertyStore.create(path, znRecord, AccessOption.PERSISTENT);
+    } else {
+      return propertyStore.set(path, znRecord, AccessOption.PERSISTENT);
+    }
+  }
+
+  public static void setApplicationQpsQuotas(ZkHelixPropertyStore<ZNRecord> 
propertyStore,

Review Comment:
   Removed.



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

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to