Set<Path> processing = new HashSet<Path>();
ExecutorService threadPool = Executors.newFixedThreadPool(16);
System.out.printf("Scanning : %s %s\n", table, range);
VolumeManager fs = VolumeManagerImpl.get();
Connector connector = instance.getConnector(principal, token);
Scanner metadata = connector.createScanner(table, Authorizations.EMPTY);
metadata.setRange(range);
metadata.fetchColumnFamily(DataFileColumnFamily.NAME);
int count = 0;
AtomicInteger missing = new AtomicInteger(0);
AtomicReference<Exception> exceptionRef = new AtomicReference<Exception>(null);
BatchWriter writer = null;
if (fix)
writer = connector.createBatchWriter(MetadataTable.NAME, new BatchWriterConfig());
for (Entry<Key,Value> entry : metadata) {
if (exceptionRef.get() != null)
break;
count++;
Key key = entry.getKey();
Path map = fs.getFullPath(key);
synchronized (processing) {
while (processing.size() >= 64 || processing.contains(map))
processing.wait();