private TransferManagerConfiguration resolveConfiguration() { TransferManagerConfiguration configuration = new TransferManagerConfiguration(); if (this.minimumUploadPartSize != null) { configuration.setMinimumUploadPartSize(minimumUploadPartSize); } if (this.multipartCopyPartSize != null) { configuration.setMultipartCopyPartSize(multipartCopyPartSize); } if (this.multipartCopyThreshold != null) { configuration.setMultipartCopyThreshold(multipartCopyThreshold); } if (this.multipartUploadThreshold != null) { configuration.setMultipartUploadThreshold(multipartUploadThreshold); } if (this.disableParallelDownloads != null) { configuration.setDisableParallelDownloads(disableParallelDownloads); } return configuration; }
/** * Captures the state of the upload. */ private void captureUploadStateIfPossible() { if (origReq.getSSECustomerKey() == null) { persistableUpload = new PersistableUpload(origReq.getBucketName(), origReq.getKey(), origReq.getFile() .getAbsolutePath(), multipartUploadId, configuration.getMinimumUploadPartSize(), configuration.getMultipartUploadThreshold()); notifyPersistableTransferAvailability(); } }
/** * Resumes an upload operation. This upload operation uses the same * configuration {@link TransferManagerConfiguration} as the original * upload. Any data already uploaded will be skipped, and only the remaining * will be uploaded to Amazon S3. * * @param persistableUpload * the upload to resume. * @return A new <code>Upload</code> object to use to check the state of the * upload, listen for progress notifications, and otherwise manage * the upload. * * @throws AmazonClientException * If any errors are encountered in the client while making the * request or handling the response. * @throws AmazonServiceException * If any errors occurred in Amazon S3 while processing the * request. */ public Upload resumeUpload(PersistableUpload persistableUpload) { assertParameterNotNull(persistableUpload, "PauseUpload is mandatory to resume a upload."); configuration.setMinimumUploadPartSize(persistableUpload.getPartSize()); configuration.setMultipartUploadThreshold(persistableUpload .getMutlipartUploadThreshold()); return doUpload(new PutObjectRequest(persistableUpload.getBucketName(), persistableUpload.getKey(), new File(persistableUpload.getFile())), null, null, persistableUpload); }
TransferManagerConfiguration transferConfiguration = new TransferManagerConfiguration(); transferConfiguration.setMinimumUploadPartSize(partSize); transferConfiguration.setMultipartUploadThreshold(partSizeThreshold);
protected void init(Region region) { transferManager = new TransferManager(this); TransferManagerConfiguration configuration = new TransferManagerConfiguration(); configuration.setMultipartUploadThreshold(100 * Constants.KB); transferManager.setConfiguration(configuration); this.setRegion(region); }
TransferManagerConfiguration tmConfig = new TransferManagerConfiguration(); tmConfig.setMinimumUploadPartSize(50 * MB); s3TransferManager = new TransferManager(s3); //uses separate pool, for multipart zip upload s3TransferManager.setConfiguration(tmConfig);
TransferManagerConfiguration transferConfiguration = new TransferManagerConfiguration(); transferConfiguration.setMultipartCopyPartSize(partSize);
this.s3 = s3; this.executorService = executorService; this.configuration = new TransferManagerConfiguration(); this.shutDownThreadPools = shutDownThreadPools; this.isImmutable = false;
setMultipartUploadThreshold((long) multipartUploadThreshold);
/** * Returns the optimal part size, in bytes, for each individual part upload * in a multipart upload. * * @param putObjectRequest * The request containing all the details of the upload. * @param configuration * Configuration values to use when calculating size. * * @return The optimal part size, in bytes, for each individual part upload * in a multipart upload. */ public static long calculateOptimalPartSize(PutObjectRequest putObjectRequest, TransferManagerConfiguration configuration) { double contentLength = TransferManagerUtils.getContentLength(putObjectRequest); double optimalPartSize = (double)contentLength / (double)MAXIMUM_UPLOAD_PARTS; // round up so we don't push the upload over the maximum number of parts optimalPartSize = Math.ceil(optimalPartSize); return (long)Math.max(optimalPartSize, configuration.getMinimumUploadPartSize()); }
threadPoolExecutor.allowCoreThreadTimeOut(true); TransferManagerConfiguration transferConfiguration = new TransferManagerConfiguration(); transferConfiguration.setMinimumUploadPartSize(partSize); transferConfiguration.setMultipartUploadThreshold(multiPartThreshold);
/** * Resumes an upload operation. This upload operation uses the same * configuration {@link TransferManagerConfiguration} as the original * upload. Any data already uploaded will be skipped, and only the remaining * will be uploaded to Amazon S3. * * @param persistableUpload * the upload to resume. * @return A new <code>Upload</code> object to use to check the state of the * upload, listen for progress notifications, and otherwise manage * the upload. * * @throws AmazonClientException * If any errors are encountered in the client while making the * request or handling the response. * @throws AmazonServiceException * If any errors occurred in Amazon S3 while processing the * request. */ public Upload resumeUpload(PersistableUpload persistableUpload) { assertParameterNotNull(persistableUpload, "PauseUpload is mandatory to resume a upload."); configuration.setMinimumUploadPartSize(persistableUpload.getPartSize()); configuration.setMultipartUploadThreshold(persistableUpload .getMutlipartUploadThreshold()); return doUpload(new PutObjectRequest(persistableUpload.getBucketName(), persistableUpload.getKey(), new File(persistableUpload.getFile())), null, null, persistableUpload); }
this.s3 = s3; this.executorService = executorService; this.configuration = new TransferManagerConfiguration(); this.shutDownThreadPools = shutDownThreadPools; this.isImmutable = false;
setMultipartUploadThreshold((long) multipartUploadThreshold);
/** * Returns the optimal part size, in bytes, for each individual part upload * in a multipart upload. * * @param putObjectRequest * The request containing all the details of the upload. * @param configuration * Configuration values to use when calculating size. * * @return The optimal part size, in bytes, for each individual part upload * in a multipart upload. */ public static long calculateOptimalPartSize(PutObjectRequest putObjectRequest, TransferManagerConfiguration configuration) { double contentLength = TransferManagerUtils.getContentLength(putObjectRequest); double optimalPartSize = (double)contentLength / (double)MAXIMUM_UPLOAD_PARTS; // round up so we don't push the upload over the maximum number of parts optimalPartSize = Math.ceil(optimalPartSize); return (long)Math.max(optimalPartSize, configuration.getMinimumUploadPartSize()); }
private TransferManagerConfiguration resolveConfiguration() { TransferManagerConfiguration configuration = new TransferManagerConfiguration(); if (this.minimumUploadPartSize != null) { configuration.setMinimumUploadPartSize(minimumUploadPartSize); } if (this.multipartCopyPartSize != null) { configuration.setMultipartCopyPartSize(multipartCopyPartSize); } if (this.multipartCopyThreshold != null) { configuration.setMultipartCopyThreshold(multipartCopyThreshold); } if (this.multipartUploadThreshold != null) { configuration.setMultipartUploadThreshold(multipartUploadThreshold); } if (this.disableParallelDownloads != null) { configuration.setDisableParallelDownloads(disableParallelDownloads); } return configuration; }
File srcfile = local.pathToFile(src); TransferManagerConfiguration transferConfiguration = new TransferManagerConfiguration(); transferConfiguration.setMinimumUploadPartSize(partSize); transferConfiguration.setMultipartUploadThreshold(partSizeThreshold);
transferConfig.setMultipartUploadThreshold(minFileSize); transferConfig.setMinimumUploadPartSize(minPartSize);
= new TransferManagerConfiguration().getMinimumUploadPartSize() ;
/** * Captures the state of the upload. */ private void captureUploadStateIfPossible() { if (origReq.getSSECustomerKey() == null) { persistableUpload = new PersistableUpload(origReq.getBucketName(), origReq.getKey(), origReq.getFile() .getAbsolutePath(), multipartUploadId, configuration.getMinimumUploadPartSize(), configuration.getMultipartUploadThreshold()); notifyPersistableTransferAvailability(); } }