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


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmLifecycleUtils.java:
##########
@@ -0,0 +1,131 @@
+/*
+ * 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 static org.apache.hadoop.ozone.OzoneConsts.OZONE_URI_DELIMITER;
+import static org.apache.hadoop.ozone.om.helpers.OzoneFSUtils.isValidKeyPath;
+import static org.apache.hadoop.ozone.om.helpers.OzoneFSUtils.normalizePrefix;
+
+import java.nio.charset.StandardCharsets;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.ozone.om.exceptions.OMException;
+
+/**
+ * Utility class for Ozone Lifecycle.
+ */
+public final class OmLifecycleUtils {
+
+  // Ref: 
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html
+  public static final int MAX_PREFIX_LENGTH = 1024;
+
+  // Ref: 
https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html
+  public static final int MAX_TAG_KEY_LENGTH = 128;
+  public static final int MAX_TAG_VALUE_LENGTH = 256;
+
+  private OmLifecycleUtils() {
+  }
+
+  /**
+   * Check if the prefix is a Trash path.
+   *
+   * @param prefix the prefix to check
+   * @throws OMException if the prefix is a trash path
+   */
+  public static void validateTrashPrefix(String prefix) throws OMException {
+    if (org.apache.commons.lang3.StringUtils.isEmpty(prefix)) {

Review Comment:
   Can we import the StringUtils? 



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