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


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmLCRule.java:
##########
@@ -0,0 +1,239 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+
+/**
+ * A class that encapsulates lifecycle rule.
+ */
+public class OmLCRule {
+
+  public static final int LC_ID_LENGTH = 48;
+  // Ref: 
https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html#intro-lifecycle-rule-id
+  public static final int LC_ID_MAX_LENGTH = 255;
+
+  private String id;
+  private String prefix;
+  private boolean enabled;
+  private boolean isPrefixEnable;
+  private boolean isTagEnable;
+  // List of actions for this rule
+  private List<OmLCAction> actions;
+  private OmLCFilter filter;
+
+  OmLCRule(String id, String prefix, boolean enabled,
+      List<OmLCAction> actions, OmLCFilter filter) {

Review Comment:
   XML format doesn't support single prefix without filter anymore.  See 
https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html
 . 
   
   For Json format, 
https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-lifecycle-configuration.html
  
   
   looks like single prefix is deprecated. 
   
   ```
   Prefix -> (string)
   
       Prefix identifying one or more objects to which the rule applies. This 
is no longer used; use Filter instead.
   ```
   
   Shall we need to support this deprecated field? 
   



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