Skip to content

Commit

Permalink
JCLOUDS-1635: Add COOL and COLD to Tier
Browse files Browse the repository at this point in the history
The former replaces INFREQUENT.  References gaul/s3proxy#625.
  • Loading branch information
gaul committed Apr 20, 2024
1 parent e1f34bb commit da1bc06
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public interface ObjectMetadata extends Comparable<ObjectMetadata> {

public enum StorageClass {
STANDARD(Tier.STANDARD),
STANDARD_IA(Tier.INFREQUENT),
ONEZONE_IA(Tier.INFREQUENT),
STANDARD_IA(Tier.COOL),
ONEZONE_IA(Tier.COOL),
INTELLIGENT_TIERING(Tier.STANDARD),
REDUCED_REDUNDANCY(Tier.STANDARD),
GLACIER(Tier.ARCHIVE),
GLACIER_IR(Tier.ARCHIVE),
GLACIER_IR(Tier.COLD),
DEEP_ARCHIVE(Tier.ARCHIVE);

private final Tier tier;
Expand All @@ -53,6 +53,8 @@ public static StorageClass fromTier(Tier tier) {
switch (tier) {
case STANDARD: return StorageClass.STANDARD;
case INFREQUENT: return StorageClass.STANDARD_IA;
case COOL: return StorageClass.STANDARD_IA;
case COLD: return StorageClass.GLACIER_IR;
case ARCHIVE: return StorageClass.DEEP_ARCHIVE;
}
throw new IllegalArgumentException("invalid tier: " + tier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
public enum Tier {
/** Optimize for access speed. */
STANDARD,
/** Balance access speed against storage cost. */
INFREQUENT,
/** @deprecated see COOL. */
@Deprecated INFREQUENT,
/** Slower access speed and reduced storage costs. */
COOL,
/** Even slower access speed and further reduced storage costs. */
COLD,
/**
* Optimize for storage cost. Some providers may require a separate call to
* set the blob to STANDARD tier before access.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

public enum AccessTier {
HOT(Tier.STANDARD),
COOL(Tier.INFREQUENT),
COLD(Tier.INFREQUENT),
COOL(Tier.COOL),
COLD(Tier.COLD),
ARCHIVE(Tier.ARCHIVE);

private final Tier tier;
Expand All @@ -52,6 +52,8 @@ public static AccessTier fromTier(Tier tier) {
switch (tier) {
case STANDARD: return AccessTier.HOT;
case INFREQUENT: return AccessTier.COOL;
case COOL: return AccessTier.COOL;
case COLD: return AccessTier.COLD;
case ARCHIVE: return AccessTier.ARCHIVE;
}
throw new IllegalArgumentException("invalid tier: " + tier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ public static Location fromValue(String location) {

public enum StorageClass {
ARCHIVE(Tier.ARCHIVE),
COLDLINE(Tier.ARCHIVE),
COLDLINE(Tier.COLD),
DURABLE_REDUCED_AVAILABILITY(Tier.STANDARD),
MULTI_REGIONAL(Tier.STANDARD),
REGIONAL(Tier.STANDARD),
NEARLINE(Tier.INFREQUENT),
NEARLINE(Tier.COOL),
STANDARD(Tier.STANDARD);

private final Tier tier;
Expand All @@ -122,6 +122,8 @@ public static StorageClass fromTier(Tier tier) {
switch (tier) {
case STANDARD: return StorageClass.STANDARD;
case INFREQUENT: return StorageClass.NEARLINE;
case COOL: return StorageClass.NEARLINE;
case COLD: return StorageClass.COLDLINE;
case ARCHIVE: return StorageClass.ARCHIVE;
}
throw new IllegalArgumentException("invalid tier: " + tier);
Expand Down

0 comments on commit da1bc06

Please sign in to comment.