#19 Sequentialisierung der Verarbeitung (#21)

Dateien werden erst gelesen, wenn sie verarbeitet werden. Ergebnisse von vorherigen Läufen werden nicht mehr Speicher gehalten bis alle Dateien verarbeitet sind
This commit is contained in:
apenski 2019-02-07 15:29:31 +01:00 committed by GitHub
parent 7992024451
commit 066974886b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 28 deletions

View file

@ -28,10 +28,15 @@ import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.cli.*;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.lang3.StringUtils;
import lombok.extern.slf4j.Slf4j;
@ -151,9 +156,12 @@ public class CommandLineApplication {
final Collection<Path> targets = determineTestTargets(cmd);
start = System.currentTimeMillis();
final List<Input> input = targets.stream().map(InputFactory::read).collect(Collectors.toList());
boolean result = check.checkInput(input);
log.info("Processing {} object(s) completed in {}ms", input.size(), System.currentTimeMillis() - start);
for (Path p : targets) {
final Input input = InputFactory.read(p);
check.checkInput(input);
}
boolean result = check.printAndEvaluate();
log.info("Processing {} object(s) completed in {}ms", targets.size(), System.currentTimeMillis() - start);
return result ? 0 : 1;
} catch (Exception e) {