Skip to content
Merged
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 @@ -891,7 +891,6 @@ public List<OmKeyInfo> listKeys(String volumeName, String bucketName,


TreeMap<String, OmKeyInfo> cacheKeyMap = new TreeMap<>();
Set<String> deletedKeySet = new TreeSet<>();
Iterator<Map.Entry<CacheKey<String>, CacheValue<OmKeyInfo>>> iterator =
keyTable.cacheIterator();

Expand All @@ -911,12 +910,10 @@ public List<OmKeyInfo> listKeys(String volumeName, String bucketName,
OmKeyInfo omKeyInfo = entry.getValue().getCacheValue();
// Making sure that entry in cache is not for delete key request.

if (omKeyInfo != null) {
if (key.startsWith(seekPrefix) && key.compareTo(seekKey) >= 0) {
cacheKeyMap.put(key, omKeyInfo);
}
} else {
deletedKeySet.add(key);
if (omKeyInfo != null
&& key.startsWith(seekPrefix)
&& key.compareTo(seekKey) >= 0) {
cacheKeyMap.put(key, omKeyInfo);
}
}

Expand All @@ -934,7 +931,9 @@ public List<OmKeyInfo> listKeys(String volumeName, String bucketName,

// Entry should not be marked for delete, consider only those
// entries.
if(!deletedKeySet.contains(kv.getKey())) {
CacheValue<OmKeyInfo> cacheValue =
keyTable.getCacheValue(new CacheKey<>(kv.getKey()));
if(cacheValue == null || cacheValue.getCacheValue() != null) {
cacheKeyMap.put(kv.getKey(), kv.getValue());
currentCount++;
}
Expand Down Expand Up @@ -965,7 +964,6 @@ public List<OmKeyInfo> listKeys(String volumeName, String bucketName,

// Clear map and set.
cacheKeyMap.clear();
deletedKeySet.clear();

return result;
}
Expand Down