Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.
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 @@ -34,9 +34,9 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.concurrent.NotThreadSafe;

/**
Expand Down Expand Up @@ -77,11 +77,11 @@ class FakeStorageRpc extends StorageRpcTestBase {
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");

// fullname -> metadata
Map<String, StorageObject> metadata = new HashMap<>();
Map<String, StorageObject> metadata = new ConcurrentHashMap<>();
// fullname -> contents
Map<String, byte[]> contents = new HashMap<>();
Map<String, byte[]> contents = new ConcurrentHashMap<>();
// fullname -> future contents that will be visible on close.
Map<String, byte[]> futureContents = new HashMap<>();
Map<String, byte[]> futureContents = new ConcurrentHashMap<>();

private final boolean throwIfOption;

Expand All @@ -92,8 +92,8 @@ public FakeStorageRpc(boolean throwIfOption) {

// remove all files
void reset() {
metadata = new HashMap<>();
contents = new HashMap<>();
metadata = new ConcurrentHashMap<>();
contents = new ConcurrentHashMap<>();
}

@Override
Expand Down Expand Up @@ -149,7 +149,7 @@ public Tuple<String, Iterable<StorageObject>> list(String bucket, Map<Option, ?>
final String prefix = preprefix;

List<StorageObject> values = new ArrayList<>();
Map<String, StorageObject> folders = new HashMap<>();
Map<String, StorageObject> folders = new ConcurrentHashMap<>();
for (StorageObject so : metadata.values()) {
if (!so.getBucket().equals(bucket) || !so.getName().startsWith(prefix)) {
continue;
Expand Down