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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]