KnightChess commented on code in PR #7304:
URL: https://github.com/apache/hudi/pull/7304#discussion_r1032725208
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieClusteringConfig.java:
##########
@@ -713,5 +713,48 @@ public static LayoutOptimizationStrategy fromValue(String
value) {
return enumValue;
}
+
+ public String getValue() {
+ return value;
+ }
+ }
+
+ public enum ClusteringOperator {
+
+ SCHEDULE("schedule"),
+
+ EXECUTE("execute"),
+
+ SCHEDULEANDEXECUTE("scheduleandexecute");
+
+ private static final Map<String, ClusteringOperator> VALUE_TO_ENUM_MAP =
+ TypeUtils.getValueToEnumMap(ClusteringOperator.class, e ->
e.value);
+
+ private final String value;
+
+ ClusteringOperator(String value) {
+ this.value = value;
+ }
+
+ @Nonnull
+ public static ClusteringOperator fromValue(String value) {
+ ClusteringOperator enumValue = VALUE_TO_ENUM_MAP.get(value);
+ if (enumValue == null) {
+ throw new HoodieException(String.format("Invalid value (%s)", value));
+ }
+ return enumValue;
+ }
+
+ public boolean isSchedule() {
Review Comment:
I don't think it is necessary, in developer perspective, I will add
annotation code, and in user perspective, there will be a use docs to desc each
enum value.
--
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]