ChenSammi commented on code in PR #8275:
URL: https://github.com/apache/ozone/pull/8275#discussion_r2058080432


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmLCExpiration.java:
##########
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.om.helpers;
+
+import java.time.ZoneOffset;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
+import net.jcip.annotations.Immutable;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+
+/**
+ * A class that encapsulates lifecycle rule expiration action.
+ * This class extends OmLCAction and represents the expiration
+ * action type in lifecycle configuration.
+ */
+@Immutable
+public final class OmLCExpiration implements OmLCAction {
+  private final int days;
+  private final String date;
+
+  private OmLCExpiration() {
+    throw new UnsupportedOperationException("Default constructor is not 
supported. Use Builder.");
+  }
+
+  private OmLCExpiration(Builder builder) {
+    this.days = builder.days;
+    this.date = builder.date;
+  }
+
+  public int getDays() {
+    return days;
+  }
+
+  public String getDate() {
+    return date;
+  }
+
+  @Override
+  public ActionType getActionType() {
+    return ActionType.EXPIRATION;
+  }
+
+  /**
+   * Validates the expiration configuration.
+   * - Days must be a positive number greater than zero
+   * - Either days or date should be specified, but not both or neither
+   * - The date value must conform to the ISO 8601 format
+   * - The date value must be in the future
+   * - The date value must be at midnight UTC (00:00:00Z)
+   *

Review Comment:
   Looks like most date value is TestOmLCExpiration is invalid. 
   Could you add the example date value here, which is be treated as valid, as 
a positive reference for users? 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to