private long doCopy(Mapper.Context context, FileStatus sourceFileStatus, S3UploadDescriptor uploadDescriptor) throws IOException { LOG.debug("Copying {} to {}", sourceFileStatus.getPath(), uploadDescriptor.getTargetPath()); final Path sourcePath = sourceFileStatus.getPath(); Transfer transfer = startTransfer(context, uploadDescriptor); transfer.addProgressListener(new UploadProgressListener(context, description)); try { AmazonClientException e = transfer.waitForException(); if (e != null) { throw new IOException(e); } } catch (InterruptedException e) { throw new RuntimeException("Unable to upload file " + sourcePath, e); } return transfer.getProgress().getBytesTransferred(); }
private long doCopy(Mapper.Context context, FileStatus sourceFileStatus, S3UploadDescriptor uploadDescriptor) throws IOException { LOG.debug("Copying {} to {}", sourceFileStatus.getPath(), uploadDescriptor.getTargetPath()); final Path sourcePath = sourceFileStatus.getPath(); Transfer transfer = startTransfer(context, uploadDescriptor); transfer.addProgressListener(new UploadProgressListener(context, description)); try { AmazonClientException e = transfer.waitForException(); if (e != null) { throw new IOException(e); } } catch (InterruptedException e) { throw new RuntimeException("Unable to upload file " + sourcePath, e); } return transfer.getProgress().getBytesTransferred(); }