/** * Returns an identifier which identifies the copy part by its part number * and the entity tag computed from the part's data. This information is * later needed to complete a multipart copy. * * @return An identifier which identifies the copy part by its part number * and the entity tag computed from the part's data. */ public PartETag getPartETag() { return new PartETag(partNumber, etag); }
/** * Returns an identifier which identifies the upload part by its part number * and the entity tag computed from the part's data. This information is * later needed to complete a multipart upload. * * @return An identifier which identifies the upload part by its part number * and the entity tag computed from the part's data. */ public PartETag getPartETag() { return new PartETag(partNumber, eTag); }
public MultipartState(String buf) { String[] fields = buf.split(SEPARATOR); _uploadId = fields[0]; _filePosition = Long.parseLong(fields[1]); _partETags = new ArrayList<>(); for (String part : fields[2].split(",")) { if (part != null && !part.isEmpty()) { String[] partFields = part.split("/"); _partETags.add(new PartETag(Integer.parseInt(partFields[0]), partFields[1])); } } _partSize = Long.parseLong(fields[3]); _storageClass = StorageClass.fromValue(fields[4]); _contentLength = Long.parseLong(fields[5]); _timestamp = Long.parseLong(fields[6]); }
final byte[] buffer = new byte[bb.getInt()]; bb.get(buffer); parts.add(new PartETag(partNum, new String(buffer, CHARSET)));
/** * Sets the list of part numbers and ETags that identify the individual * parts of the multipart upload to complete based on the specified results * from part uploads. * * @param uploadPartResults * The list of results from the individual part uploads in the * multipart upload to complete. * * @return This updated CompleteMultipartUploadRequest object. */ public CompleteMultipartUploadRequest withPartETags(UploadPartResult... uploadPartResults) { for (UploadPartResult result : uploadPartResults) { this.partETags.add(new PartETag(result.getPartNumber(), result.getETag())); } return this; }
/** * Sets the list of part numbers and ETags that identify the individual * parts of the multipart upload to complete based on the specified results * from part uploads. * * @param uploadPartResultsCollection * The list of results from the individual part uploads in the * multipart upload to complete. * * @return This updated CompleteMultipartUploadRequest object. */ public CompleteMultipartUploadRequest withPartETags(Collection<UploadPartResult> uploadPartResultsCollection) { for (UploadPartResult result : uploadPartResultsCollection) { this.partETags.add(new PartETag(result.getPartNumber(), result.getETag())); } return this; }
@Override public void run() { try { final UploadPartResult result = s3AccessHelper.uploadPart(objectName, uploadId, partNumber, file.getInputFile(), file.getPos()); future.complete(new PartETag(result.getPartNumber(), result.getETag())); file.release(); } catch (Throwable t) { future.completeExceptionally(t); } } }
/** * Submits a callable for each part to upload to our thread pool and records its corresponding Future. */ private void uploadPartsInParallel(UploadPartRequestFactory requestFactory, String uploadId) { Map<Integer,PartSummary> partNumbers = identifyExistingPartsForResume(uploadId); while (requestFactory.hasMoreRequests()) { if (threadPool.isShutdown()) throw new CancellationException("TransferManager has been shutdown"); UploadPartRequest request = requestFactory.getNextUploadPartRequest(); if (partNumbers.containsKey(request.getPartNumber())) { PartSummary summary = partNumbers.get(request.getPartNumber()); eTagsToSkip.add(new PartETag(request.getPartNumber(), summary .getETag())); transferProgress.updateProgress(summary.getSize()); continue; } futures.add(threadPool.submit(new UploadPartCallable(s3, request, shouldCalculatePartMd5()))); } }
@Mock private Void uploadPart() throws AmazonClientException, BackupRestoreException { ++partAttempts; if (partFailure) throw new BackupRestoreException("Test exception"); partETags.add(new PartETag(0, null)); return null; }
partETags.add(new PartETag(partResult.getPartNumber(), partResult.getETag()));
/** * Returns an identifier which identifies the upload part by its part number * and the entity tag computed from the part's data. This information is * later needed to complete a multipart upload. * * @return An identifier which identifies the upload part by its part number * and the entity tag computed from the part's data. */ public PartETag getPartETag() { return new PartETag(partNumber, eTag); }
/** * Returns an identifier which identifies the copy part by its part number * and the entity tag computed from the part's data. This information is * later needed to complete a multipart copy. * * @return An identifier which identifies the copy part by its part number * and the entity tag computed from the part's data. */ public PartETag getPartETag() { return new PartETag(partNumber, etag); }
partETags.add(new PartETag(partResult.getPartNumber(), partResult.getETag()));
/** * Sets the list of part numbers and ETags that identify the individual * parts of the multipart upload to complete based on the specified results * from part uploads. * * @param uploadPartResults The list of results from the individual part * uploads in the multipart upload to complete. * @return This updated CompleteMultipartUploadRequest object. */ public CompleteMultipartUploadRequest withPartETags(UploadPartResult... uploadPartResults) { for (final UploadPartResult result : uploadPartResults) { this.partETags.add(new PartETag(result.getPartNumber(), result.getETag())); } return this; }
/** * Sets the list of part numbers and ETags that identify the individual * parts of the multipart upload to complete based on the specified results * from part uploads. * * @param uploadPartResultsCollection The list of results from the * individual part uploads in the multipart upload to complete. * @return This updated CompleteMultipartUploadRequest object. */ public CompleteMultipartUploadRequest withPartETags( Collection<UploadPartResult> uploadPartResultsCollection) { for (final UploadPartResult result : uploadPartResultsCollection) { this.partETags.add(new PartETag(result.getPartNumber(), result.getETag())); } return this; }
/** * Queries all the PartETags of completed parts from the multipart upload * specified by the mainUploadId. The list of PartETags is used to complete * a multipart upload, so it's usually called after all partUpload tasks are * finished. * * @param mainUploadId The mainUploadId of a multipart upload task * @return A list of PartEtag of completed parts */ public List<PartETag> queryPartETagsOfUpload(int mainUploadId) { final List<PartETag> partETags = new ArrayList<PartETag>(); Cursor c = null; int partNum = 0; String eTag = null; try { c = transferDBBase.query(getPartUri(mainUploadId), null, null, null, null); while (c.moveToNext()) { partNum = c.getInt(c.getColumnIndexOrThrow(TransferTable.COLUMN_PART_NUM)); eTag = c.getString(c.getColumnIndexOrThrow(TransferTable.COLUMN_ETAG)); partETags.add(new PartETag(partNum, eTag)); } } finally { if (c != null) { c.close(); } } return partETags; }
/** * Submits a callable for each part to upload to our thread pool and records * its corresponding Future. */ private void uploadPartsInParallel(UploadPartRequestFactory requestFactory, String uploadId) { Map<Integer, PartSummary> partNumbers = identifyExistingPartsForResume(uploadId); while (requestFactory.hasMoreRequests()) { if (threadPool.isShutdown()) throw new CancellationException("TransferManager has been shutdown"); UploadPartRequest request = requestFactory.getNextUploadPartRequest(); if (partNumbers.containsKey(request.getPartNumber())) { PartSummary summary = partNumbers.get(request.getPartNumber()); eTagsToSkip.add(new PartETag(request.getPartNumber(), summary .getETag())); transferProgress.updateProgress(summary.getSize()); continue; } futures.add(threadPool.submit(new UploadPartCallable(s3, request))); } }
/** * Returns an identifier which identifies the upload part by its part number * and the entity tag computed from the part's data. This information is * later needed to complete a multipart upload. * * @return An identifier which identifies the upload part by its part number * and the entity tag computed from the part's data. */ public PartETag getPartETag() { return new PartETag(partNumber, eTag); }
partETags.add(new PartETag(partResult.getPartNumber(), partResult.getETag()));
partETags.add(new PartETag(1, "e6f34498060d371c4f39da1eaadceacb")); final CompleteMultipartUploadRequest cmur = new CompleteMultipartUploadRequest( "test-bucket123456", "multi-key", uploadId, partETags);