// Acquire semaphore so that we only have a fixed number of outstanding partitions being processed asynchronously
// NOTE: there must not be any calls that throw in the space between acquiring the semaphore and setting the Future
// callback to release it. Otherwise, we will need a try-finally block around this section.
semaphore.acquire();
ListenableFuture<Void> partitionFuture = new AsyncRecursiveWalker(fs, suspendingExecutor, hadoopApiStats).beginWalk(path, new FileStatusCallback()
{
@Override
public void process(FileStatus file, BlockLocation[] blockLocations)
{
try {