void executeOneIteration(
final String containerName,
ListContainerOptions listOptions, final Semaphore semaphore,
final Set<ListenableFuture<Void>> outstandingFutures,
final AtomicBoolean deleteFailure, final boolean blocking) {
ListContainerOptions options = listOptions.clone();
String message = getMessage(containerName, listOptions);
if (options.isRecursive()) {
message += " recursively";
}
logger.debug(message);
PageSet<? extends StorageMetadata> listing = getListing(containerName,
options, semaphore, outstandingFutures, deleteFailure);
while (listing != null && !listing.isEmpty()) {
try {
// Remove blobs and now-empty subdirectories.
deleteBlobsAndEmptyDirs(containerName, options, listing, semaphore,
deleteFailure, outstandingFutures);
} catch (TimeoutException te) {
logger.debug("TimeoutException while deleting blobs: {}",
te.getMessage());
cancelOutstandingFutures(outstandingFutures);
deleteFailure.set(true);
}
String marker = listing.getNextMarker();
if (marker != null) {
logger.debug("%s with marker %s", message, marker);
options = options.afterMarker(marker);
listing = getListing(containerName, options, semaphore,
outstandingFutures, deleteFailure);
} else {
break;
}