kerneltime commented on code in PR #3853:
URL: https://github.com/apache/ozone/pull/3853#discussion_r1009054043


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneConfigUtil.java:
##########
@@ -124,4 +128,35 @@ public static ReplicationConfig 
resolveReplicationConfigPreference(
     }
     return replicationConfig;
   }
+
+  /**
+   * Limits or cap the client config value to server supported config value,
+   * if client config value crosses the server supported config value.
+   * @param clientConfValue - the client config value to be capped
+   * @param clientConfName - the client config name
+   * @param serverConfName - the server config name
+   * @param serverConfValue - the server config value
+   * @return the capped config value
+   */
+  public static long limitValue(long clientConfValue, String clientConfName,
+                                String serverConfName, long serverConfValue) {
+    long limitVal = clientConfValue;
+    if (clientConfValue > serverConfValue) {
+      LOG.warn("{} config value is greater than server config {} " +

Review Comment:
   A badly configured client can flood the server logs, it is ok for the server 
to cap the limit and not warn any one. If any thing we can collect a metric for 
how many times this is occuring.



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

Reply via email to