Revert "Handle when total length is less than part length"

This reverts commit bc1f12b7bd.
This commit is contained in:
Andrew Gaul 2016-06-02 07:21:48 -07:00
parent bc1f12b7bd
commit d983d8d0a7
2 changed files with 1 additions and 7 deletions

View File

@ -43,7 +43,6 @@ public final class MultipartUploadSlicingAlgorithm {
@VisibleForTesting
static final int DEFAULT_MAGNITUDE_BASE = 100;
// TODO: these are not injected
@Inject(optional = true)
@Named("jclouds.mpu.parts.size")
@VisibleForTesting
@ -109,11 +108,6 @@ public final class MultipartUploadSlicingAlgorithm {
unitPartSize = minimumPartSize; // take the minimum part size
parts = (int)(length / unitPartSize);
}
if (parts == 0) {
partSize = length;
unitPartSize = length;
parts = 1;
}
if (parts > maximumNumberOfParts) { // if still splits in too many parts
parts = maximumNumberOfParts - 1; // limit them. do not care about not
// covering

View File

@ -639,7 +639,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
blobStore.getMinimumMultipartPartSize(), blobStore.getMaximumMultipartPartSize(),
blobStore.getMaximumNumberOfParts());
// make sure that we are creating multiple parts
assertThat(algorithm.calculateChunkSize(length)).isLessThanOrEqualTo(length);
assertThat(algorithm.calculateChunkSize(length)).isLessThan(length);
ByteSource byteSource = TestUtils.randomByteSource().slice(0, length);
Payload payload = new ByteSourcePayload(byteSource);
HashCode hashCode = byteSource.hash(Hashing.md5());