hudi-agent commented on code in PR #18997:
URL: https://github.com/apache/hudi/pull/18997#discussion_r3408820471
##########
hudi-common/src/main/java/org/apache/hudi/metadata/MetadataPartitionType.java:
##########
@@ -427,11 +429,15 @@ public static boolean
shouldDeletePartitionOnRestore(String partitionPath) {
&& partitionType != COLUMN_STATS;
}
+ // Cache values() once; it clones the constant array on every call, and
get(int) runs once per
+ // record materialized from the metadata table (RLI/SI/col-stats lookups,
MDT log merges).
+ private static final MetadataPartitionType[] ENUM_VALUES = values();
Review Comment:
🤖 nit: the conventional Java idiom for caching an enum's `values()` is just
`private static final MetadataPartitionType[] VALUES = values()` — the `ENUM_`
prefix is implicit given we're already inside the enum.
<sub><i>- AI-generated; verify before applying. React 👍/👎 to flag
quality.</i></sub>
--
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]