/** * Calculates the optimal part size of each part request if the copy * operation is carried out as multi-part copy. * * @param copyObjectRequest * the original request. * @param configuration * configuration containing the default part size. * @param contentLengthOfSource * content length of the Amazon S3 object. * @return the optimal part size for a copy part request. */ public static long calculateOptimalPartSizeForCopy( CopyObjectRequest copyObjectRequest, TransferManagerConfiguration configuration, long contentLengthOfSource) { double optimalPartSize = (double) contentLengthOfSource / (double) MAXIMUM_UPLOAD_PARTS; // round up so we don't push the copy over the maximum number of parts optimalPartSize = Math.ceil(optimalPartSize); return (long) Math.max(optimalPartSize, configuration.getMultipartCopyPartSize()); }
/** * Calculates the optimal part size of each part request if the copy * operation is carried out as multi-part copy. * * @param copyObjectRequest * the original request. * @param configuration * configuration containing the default part size. * @param contentLengthOfSource * content length of the Amazon S3 object. * @return the optimal part size for a copy part request. */ public static long calculateOptimalPartSizeForCopy( CopyObjectRequest copyObjectRequest, TransferManagerConfiguration configuration, long contentLengthOfSource) { double optimalPartSize = (double) contentLengthOfSource / (double) MAXIMUM_UPLOAD_PARTS; // round up so we don't push the copy over the maximum number of parts optimalPartSize = Math.ceil(optimalPartSize); return (long) Math.max(optimalPartSize, configuration.getMultipartCopyPartSize()); }