Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -696,7 +695,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) {
Expand Down Expand Up @@ -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<OmKeyInfo> omKeyInfoCacheValue
= keyTable.getCacheValue(new CacheKey(key));
return omKeyInfoCacheValue != null
&& omKeyInfoCacheValue.getCacheValue() == null;
refreshPipeline(Collections.singletonList(key));
}

/**
Expand Down Expand Up @@ -2047,23 +2039,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 {
Expand Down