This is an automated email from the ASF dual-hosted git repository.

ivandika 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 12feb40b1e HDDS-12332. Remove dead code in KeyManagerImpl (#7892)
12feb40b1e is described below

commit 12feb40b1ebd3ffda330fb1b88982b91521f2ffc
Author: Peter Lee <[email protected]>
AuthorDate: Sun Feb 16 16:59:39 2025 +0800

    HDDS-12332. Remove dead code in KeyManagerImpl (#7892)
---
 .../org/apache/hadoop/ozone/om/KeyManager.java     | 28 ---------------------
 .../org/apache/hadoop/ozone/om/KeyManagerImpl.java | 29 ++--------------------
 2 files changed, 2 insertions(+), 55 deletions(-)

diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java
index db3d47dfcd..d96c53ee1d 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManager.java
@@ -225,34 +225,6 @@ OmMultipartUploadListParts listParts(String volumeName, 
String bucketName,
    */
   void refresh(OmKeyInfo key) throws IOException;
 
-  /**
-   * Assume OM has FS namespace like below, deleteDirTable stores absolute
-   * path name as existing KeyDeletionService expects full key name.
-   * For example, if user deletes directory 'd1' then the entry in OM DB looks
-   * like, DBKey = 1030/d3 and DBValue = KeyInfo with keyName "a/b2/d3"
-   *
-   *                   vol1
-   *                    |
-   *                  buck-1
-   *                    |
-   *                    a
-   *                    |
-   *      -----------------------------------
-   *     |             |                     |
-   *     b1            b2                    b3
-   *   -----       ---------               ----------
-   *   |    |      |    |   |             |    |     |
-   *  c1   c2     d1   d2  d3             e1   e2   e3
-   *                   |                  |
-   *               --------               |
-   *              |        |              |
-   *           d21.txt   d22.txt        e11.txt
-   *
-   * @return OmKeyInfo
-   * @throws IOException
-   */
-  Table.KeyValue<String, OmKeyInfo> getPendingDeletionDir() throws IOException;
-
   /**
    * Returns an iterator for pending deleted directories.
    * @throws IOException
diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
index ced0abae16..0ed1774655 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
@@ -22,7 +22,6 @@
 import java.time.Duration;
 import java.time.Instant;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
@@ -692,7 +691,7 @@ private <V, R> List<Table.KeyValue<String, R>> 
getTableEntries(String startKey,
           TableIterator<String, ? extends Table.KeyValue<String, V>> 
tableIterator,
           Function<V, R> valueFunction, int size) throws IOException {
     List<Table.KeyValue<String, R>> entries = new ArrayList<>();
-    /* Seek to the start key if it not null. The next key in queue is ensured 
to start with the bucket
+    /* Seek to the start key if it's not null. The next key in queue is 
ensured to start with the bucket
          prefix, {@link 
org.apache.hadoop.hdds.utils.db.Table#iterator(bucketPrefix)} would ensure this.
     */
     if (startKey != null) {
@@ -1544,14 +1543,7 @@ public OmKeyInfo lookupFile(OmKeyArgs args, String 
clientAddress)
   @Override
   public void refresh(OmKeyInfo key) throws IOException {
     Preconditions.checkNotNull(key, "Key info can not be null");
-    refreshPipeline(Arrays.asList(key));
-  }
-
-  public static boolean isKeyDeleted(String key, Table keyTable) {
-    CacheValue<OmKeyInfo> omKeyInfoCacheValue
-        = keyTable.getCacheValue(new CacheKey(key));
-    return omKeyInfoCacheValue != null
-        && omKeyInfoCacheValue.getCacheValue() == null;
+    refreshPipeline(Collections.singletonList(key));
   }
 
   /**
@@ -2043,23 +2035,6 @@ private void slimLocationVersion(OmKeyInfo... keyInfos) {
     }
   }
 
-  @Override
-  public Table.KeyValue<String, OmKeyInfo> getPendingDeletionDir()
-          throws IOException {
-    // TODO: Make the return type as OmDirectoryInfo after adding
-    //  volumeId and bucketId to OmDirectoryInfo
-    try (TableIterator<String, ? extends Table.KeyValue<String, OmKeyInfo>>
-             deletedDirItr = metadataManager.getDeletedDirTable().iterator()) {
-      if (deletedDirItr.hasNext()) {
-        Table.KeyValue<String, OmKeyInfo> keyValue = deletedDirItr.next();
-        if (keyValue != null) {
-          return keyValue;
-        }
-      }
-    }
-    return null;
-  }
-
   @Override
   public TableIterator<String, ? extends Table.KeyValue<String, OmKeyInfo>> 
getDeletedDirEntries(
       String volume, String bucket) throws IOException {


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

Reply via email to