This is an automated email from the ASF dual-hosted git repository.
peterxcli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new c48fc269409 HDDS-13355. Remove unused class OzoneManagerLockUtil
(#8720)
c48fc269409 is described below
commit c48fc269409f6d2e7d4e202b55c0756353014de0
Author: Yu-Chuan Hung <[email protected]>
AuthorDate: Wed Jul 2 12:09:25 2025 +0800
HDDS-13355. Remove unused class OzoneManagerLockUtil (#8720)
---
.../hadoop/ozone/om/lock/OzoneManagerLockUtil.java | 96 ----------------------
1 file changed, 96 deletions(-)
diff --git
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLockUtil.java
b/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLockUtil.java
deleted file mode 100644
index d4378f40766..00000000000
---
a/hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/lock/OzoneManagerLockUtil.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.lock;
-
-import static org.apache.hadoop.ozone.OzoneConsts.OM_KEY_PREFIX;
-import static org.apache.hadoop.ozone.OzoneConsts.OM_PREFIX;
-import static org.apache.hadoop.ozone.OzoneConsts.OM_S3_PREFIX;
-import static org.apache.hadoop.ozone.OzoneConsts.OM_S3_SECRET;
-import static org.apache.hadoop.ozone.OzoneConsts.OM_SNAPSHOT_INDICATOR;
-import static org.apache.hadoop.ozone.OzoneConsts.OM_USER_PREFIX;
-
-/**
- * Utility class contains helper functions required for OM lock.
- */
-final class OzoneManagerLockUtil {
-
- private OzoneManagerLockUtil() {
- }
-
- /**
- * Generate resource lock name for the given resource name.
- *
- * @param resource
- * @param resourceName
- */
- public static String generateResourceLockName(
- OzoneManagerLock.LeveledResource resource, String resourceName) {
-
- if (resource == OzoneManagerLock.LeveledResource.S3_BUCKET_LOCK) {
- return OM_S3_PREFIX + resourceName;
- } else if (resource == OzoneManagerLock.LeveledResource.VOLUME_LOCK) {
- return OM_KEY_PREFIX + resourceName;
- } else if (resource == OzoneManagerLock.LeveledResource.USER_LOCK) {
- return OM_USER_PREFIX + resourceName;
- } else if (resource == OzoneManagerLock.LeveledResource.S3_SECRET_LOCK) {
- return OM_S3_SECRET + resourceName;
- } else if (resource == OzoneManagerLock.LeveledResource.PREFIX_LOCK) {
- return OM_PREFIX + resourceName;
- } else {
- // This is for developers who mistakenly call this method with resource
- // bucket type, as for bucket type we need bucket and volumeName.
- throw new IllegalArgumentException("Bucket resource type is passed, " +
- "to get BucketResourceLockName, use generateBucketLockName method");
- }
-
- }
-
- /**
- * Generate bucket lock name.
- * @param volumeName
- * @param bucketName
- */
- public static String generateBucketLockName(String volumeName,
- String bucketName) {
- return OM_KEY_PREFIX + volumeName + OM_KEY_PREFIX + bucketName;
- }
-
- /**
- * Generate snapshot lock name.
- * @param volumeName
- * @param bucketName
- */
- public static String generateSnapshotLockName(String volumeName,
- String bucketName, String snapshotName) {
- return generateBucketLockName(volumeName, bucketName) +
- OM_KEY_PREFIX + OM_SNAPSHOT_INDICATOR + OM_KEY_PREFIX + snapshotName;
- }
-
- /**
- * Generate key path lock name.
- * @param volumeName
- * @param bucketName
- * @param keyName
- */
- public static String generateKeyPathLockName(String volumeName,
- String bucketName,
- String keyName) {
- return OM_KEY_PREFIX + volumeName + OM_KEY_PREFIX + bucketName +
- OM_KEY_PREFIX + keyName;
- }
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]