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

   ### What changes were proposed in this pull request?
   
   This pull request focuses on simplifying and refactoring the logic for 
checking if a catalog or metalake is "in use" within the `CatalogManager` and 
`MetalakeManager` classes. The changes remove redundant code, streamline 
property handling, and modernize some Java syntax.
   
   **Refactoring and simplification of "in use" checks:**
   
   * The public `metalakeInUse` method in `MetalakeManager` has been removed, 
and a new private version is introduced, encapsulating this logic within the 
class. All catalog "in use" checks in `CatalogManager` now directly use a 
simplified `getCatalogInUseValue` method, eliminating the need to check the 
metalake's status separately. 
[[1]](diffhunk://#diff-e832fac4117c11b82db050ffdfbbc772f4db6d27700bd0646b1b02fe9aaeb2abL565-R563)
 
[[2]](diffhunk://#diff-e832fac4117c11b82db050ffdfbbc772f4db6d27700bd0646b1b02fe9aaeb2abL605-R603)
 
[[3]](diffhunk://#diff-e832fac4117c11b82db050ffdfbbc772f4db6d27700bd0646b1b02fe9aaeb2abL743-R741)
 
[[4]](diffhunk://#diff-e832fac4117c11b82db050ffdfbbc772f4db6d27700bd0646b1b02fe9aaeb2abL867-L872)
 
[[5]](diffhunk://#diff-21ed56786d4199a9ebee9969aae3195dff5037135c738ff4b8ba2072fa72d6a0L108-L131)
 
[[6]](diffhunk://#diff-21ed56786d4199a9ebee9969aae3195dff5037135c738ff4b8ba2072fa72d6a0R435-R458)
   
   **Code cleanup and modernization:**
   
   * Unused imports such as `PropertyEntry` and the static import for 
`metalakeInUse` have been removed from `CatalogManager.java`. 
[[1]](diffhunk://#diff-e832fac4117c11b82db050ffdfbbc772f4db6d27700bd0646b1b02fe9aaeb2abL28)
 
[[2]](diffhunk://#diff-e832fac4117c11b82db050ffdfbbc772f4db6d27700bd0646b1b02fe9aaeb2abL79)
   * The `getHiddenPropertyNames` method has been removed from 
`CatalogManager`, as it is no longer needed.
   * Java pattern matching for `instanceof` is now used in 
`getCatalogAlterProperty` for more concise and modern code.
   
   ### Why are the changes needed?
   
   For better performance.
   
   Fix: #9562
   
   ### Does this PR introduce _any_ user-facing change?
   
   N/A
   
   ### How was this patch tested?
   
   Test locally and existing CIs
   


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