Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle accelerate and dual-stack aws endpoints #900

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 @@ -20,38 +20,24 @@
import java.util.concurrent.ConcurrentHashMap;

/** A singleton bucket/region cache map. */
enum BucketRegionCache {
enum AwsRegionCache {
INSTANCE;
private final Map<String, String> regionMap = new ConcurrentHashMap<>();

/** Returns AWS region for given bucket name. */
public String region(String bucketName) {
if (bucketName == null) {
return "us-east-1";
}

String region = this.regionMap.get(bucketName);
if (region == null) {
return "us-east-1";
} else {
return region;
}
}

/** Sets bucket name and its region to BucketRegionCache. */
/** Sets bucket name and its region. */
public void set(String bucketName, String region) {
this.regionMap.put(bucketName, region);
}

/** Removes region cache of the bucket if any. */
/** Gets region of bucket name. */
public String get(String bucketName) {
return this.regionMap.get(bucketName);
}

/** Removes bucket name and its region. */
public void remove(String bucketName) {
if (bucketName != null) {
this.regionMap.remove(bucketName);
}
}

/** Returns true if given bucket name is in the map else false. */
public boolean exists(String bucketName) {
return this.regionMap.get(bucketName) != null;
}
}
70 changes: 0 additions & 70 deletions api/src/main/java/io/minio/AwsS3Endpoints.java

This file was deleted.

Loading