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

   What changes were proposed in this pull request?
   
   This PR aligns PolicyExecutionSpec with existing api policy-module 
value-object conventions (similar to TagValueSelector and content factories):
   
   Removed Copy-Mutators: Dropped all withXxx copy-mutator methods; objects now 
construct exclusively via PolicyExecutionSpec.of(...) or 
PolicyExecutionSpec.empty().
   
   Immediate Validation: Enforced shared peer constraints (minIntervalMs >= 0, 
non-blank option keys/values) directly inside the of(...) factory method, 
removing the deferred .validate() method.
   
   Immutable Collections: Stored option maps (jobOptions and updaterOptions) as 
Guava ImmutableMap and added the @Evolving annotation.
   
   DTO & Test Alignment: Updated DTO peer setters and unit tests 
(TestPolicyExecutionSpec, TestPolicyContents) to match the new strict factory 
validation and immutability requirements.
   
   Why are the changes needed?
   To enforce consistent value-object conventions, thread-safety, and fail-fast 
validation across the policy module (api).
   
   Prevents invalid states by ensuring validation occurs at construction time 
rather than via deferred validation calls.
   
   Part of umbrella epic #13760.
   
   Fixes #14227
   
   Does this PR introduce any user-facing change?
   No (internal API evolution under the @Evolving annotation).
   
   How was this patch tested?
   Updated existing unit tests in TestPolicyExecutionSpec and 
TestPolicyContents to validate fail-fast exception behavior on invalid 
parameters (e.g., negative minIntervalMs, blank keys/values).
   
   Verified local compilation and test suites across the api and common modules 
using Gradle.


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