if (errors.get() > maxRetries) {
activeParts.remove(part); // remove part from the bounded-queue without blocking
latch.countDown();
return;
}
final CommonSwiftAsyncClient client = ablobstore.getContext().unwrap(SwiftApiMetadata.CONTEXT_TOKEN).getAsyncApi();
Payload chunkedPart = slicer.slice(payload, offset, size);
logger.debug(String.format("async uploading part %s of %s to container %s", part, key, container));
final long start = System.currentTimeMillis();
String blobPartName = blob.getMetadata().getName() + PART_SEPARATOR +
String.valueOf(part);
Blob blobPart = ablobstore.blobBuilder(blobPartName).payload(chunkedPart).
contentDisposition(blobPartName).build();
final ListenableFuture<String> futureETag = client.putObject(container, blob2Object.apply(blobPart));
futureETag.addListener(new Runnable() {
@Override
public void run() {
try {
etags.put(part, futureETag.get());