Collection<String> goodPaths = RootFiles.cleanupReplacement(fs, files, true);
for (String good : goodPaths) {
Path path = new Path(good);
String filename = path.getName();
FileRef ref = new FileRef(location.toString() + "/" + filename, path);
DataFileValue dfv = new DataFileValue(0, 0);
datafiles.put(ref, dfv);
}
} else {
Text rowName = extent.getMetadataEntry();
String tableId = extent.isMeta() ? RootTable.ID : MetadataTable.ID;
ScannerImpl mdScanner = new ScannerImpl(HdfsZooInstance.getInstance(), SystemCredentials.get(), tableId, Authorizations.EMPTY);
// Commented out because when no data file is present, each tablet will scan through metadata table and return nothing
// reduced batch size to improve performance
// changed here after endKeys were implemented from 10 to 1000
mdScanner.setBatchSize(1000);
// leave these in, again, now using endKey for safety
mdScanner.fetchColumnFamily(DataFileColumnFamily.NAME);
mdScanner.setRange(new Range(rowName));
for (Entry<Key,Value> entry : mdScanner) {
if (entry.getKey().compareRow(rowName) != 0) {
break;
}
FileRef ref = new FileRef(fs, entry.getKey());
datafiles.put(ref, new DataFileValue(entry.getValue().get()));
}
}
return datafiles;
}