JCLOUDS-1337: Swift putBlob portable storage tiers

This commit is contained in:
Andrew Gaul 2017-10-23 21:00:04 -07:00
parent 3193aa68e8
commit c901bf3a0f
2 changed files with 10 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
import org.jclouds.blobstore.domain.MutableBlobMetadata;
import org.jclouds.blobstore.domain.StorageType;
import org.jclouds.blobstore.domain.Tier;
import org.jclouds.blobstore.domain.internal.MutableBlobMetadataImpl;
import org.jclouds.openstack.swift.v1.domain.Container;
import org.jclouds.openstack.swift.v1.domain.SwiftObject;
@ -59,6 +60,7 @@ public class ToBlobMetadata implements Function<SwiftObject, MutableBlobMetadata
to.setType(StorageType.BLOB);
}
to.setSize(from.getPayload().getContentMetadata().getContentLength());
to.setTier(Tier.STANDARD);
return to;
}

View File

@ -23,6 +23,8 @@ import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CRED
import java.util.Properties;
import org.jclouds.blobstore.domain.Blob;
import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.domain.Tier;
import org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest;
import org.testng.SkipException;
import org.testng.annotations.DataProvider;
@ -129,4 +131,10 @@ public class SwiftBlobIntegrationLiveTest extends BaseBlobIntegrationTest {
protected long getMinimumMultipartBlobSize() {
return 1;
}
@Override
protected void checkTier(BlobMetadata metadata, Tier expected) {
// Swift maps all tiers to STANDARD
assertThat(metadata.getTier()).isEqualTo(Tier.STANDARD);
}
}