executor.submit(partUploader);
bytesUploaded.addAndGet(chunk.length);
}
executor.sleepTillEmpty();
if (partNum != partETags.size())
throw new BackupRestoreException("Number of parts(" + partNum + ") does not match the uploaded parts(" + partETags.size() + ")");
new S3PartUploader(s3Client, part, partETags).completeUpload();
if (logger.isDebugEnabled())
{
final S3ResponseMetadata responseMetadata = s3Client.getCachedResponseMetadata(initRequest);
final String requestId = responseMetadata.getRequestId(); // "x-amz-request-id" header
final String hostId = responseMetadata.getHostId(); // "x-amz-id-2" header
logger.debug("S3 AWS x-amz-request-id[" + requestId + "], and x-amz-id-2[" + hostId + "]");
}
}
catch (Exception e)
{
new S3PartUploader(s3Client, part, partETags).abortUpload();
throw new BackupRestoreException("Error uploading file " + path.getFileName(), e);
} finally {
IOUtils.closeQuietly(in);
}
}