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 db3d47dfcdb9..d96c53ee1dc4 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 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 735dfca55900..a35ef67c5ae2 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; @@ -696,7 +695,7 @@ private List> getTableEntries(String startKey, TableIterator> tableIterator, Function valueFunction, int size) throws IOException { List> 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) { @@ -1548,14 +1547,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 omKeyInfoCacheValue - = keyTable.getCacheValue(new CacheKey(key)); - return omKeyInfoCacheValue != null - && omKeyInfoCacheValue.getCacheValue() == null; + refreshPipeline(Collections.singletonList(key)); } /** @@ -2047,23 +2039,6 @@ private void slimLocationVersion(OmKeyInfo... keyInfos) { } } - @Override - public Table.KeyValue getPendingDeletionDir() - throws IOException { - // TODO: Make the return type as OmDirectoryInfo after adding - // volumeId and bucketId to OmDirectoryInfo - try (TableIterator> - deletedDirItr = metadataManager.getDeletedDirTable().iterator()) { - if (deletedDirItr.hasNext()) { - Table.KeyValue keyValue = deletedDirItr.next(); - if (keyValue != null) { - return keyValue; - } - } - } - return null; - } - @Override public TableIterator> getDeletedDirEntries( String volume, String bucket) throws IOException {