if (shouldYield()) {
log.info("yielding to priority tasks");
return;
}
final ConfigEntry entry = configEntry();
final String comboId = entry.comboId();
final AmazonService service = entry.amazonService();
final List<String> repoList = RepoHelp.repoList(repoRegistry, comboId);
final Pattern defaultExclude = ConfigHelp.defaultExclude();
for (final String repoId : repoList) {
checkInterruption();
doSleep(scannerRepositorySleepTime());
final Repository repo = repoRegistry.getRepository(repoId);
final File root = RepoHelp.repoRoot(repo);
final CarrotListener listener = new CarrotListenerSupport() {
@Override
public void onBegin() {
log.info("##########################################");
log.info("repo scan init : {} {}", configId(), repoId);
}
@Override
public void onEnd() {
log.info("repo stats : processed={} published={}",
reporter.scanCount.count(),
reporter.amazonPublishedFileCount.count());
log.info("repo scan done : {} {}", configId(), repoId);
log.info("##########################################");
}
@Override
public boolean skipDirectory(final File directory) {
final String path = //
rootFullPath(relativePath(root, directory));
final boolean isExcluded = defaultExclude.matcher(path)
.matches();
return isExcluded;
}
@Override
public boolean skipFile(final File file) {
return false;
}
@Override
public void onFile(final File file) {
try {
checkInterruption();
reporter.scanCount.inc();
reporter.scanRate.mark();
reporter.repoFilePeek.add(file);
final String path = //
rootFullPath(relativePath(root, file));
if (entry.isExcluded(path)) {
reporter.amazonIgnoredFileCount.inc();
return;
}
final ResourceStoreRequest request = //