LongerDude opened a new pull request, #9412:
URL: https://github.com/apache/gravitino/pull/9412

   
   ### What changes were proposed in this pull request?
   
   This PR adds a default value of 1 for integer divisons that result in 0 at 
the level generateEventListenerConfigs methods.
   
   the fix uses parseInt to parse into an int primitive instead of Integer 
object since were storing into int, and Math.max(1, totalCapacity / 
sinks.size()) to guarantee a minimum queue capacitypersink of 1.
   
   ### Why are the changes needed?
   
   Previously, integer division operations in generateEventListenerConfigs 
could result in a value of 0 capacityPerSink, when the total capacity is less 
than the number of sinks. this violates EventListenerConfig explicit rule that 
enforces a capacity being larger than 0. which leads to an initialization 
failure when the configuration is loaded.
   
   Fix: #9305
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, this is purely internal
   
   ### How was this patch tested?
   
   Added unit test and ran the following:
   ./gradlew :common:compileJava
   ./gradlew :common:test
   ./gradlew :lineage:test
   
   


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

Reply via email to