@Test void directoryContainsNonHdrFiles() throws IOException { final Path otherFile = createFile(tempDir.resolve("other.txt")); final ResultsAggregator aggregator = new ResultsAggregator(tempDir, 1); aggregator.run(); assertArrayEquals(new File[]{ otherFile.toFile() }, tempDir.toFile().listFiles()); }
public void run() throws IOException { final Map<String, List<Path>> byPrefix = walk(directory) .filter((path) -> { if (!isRegularFile(path)) { return false; } final String fileName = path.getFileName().toString(); return fileName.endsWith(FILE_EXTENSION) && !fileName.endsWith(AGGREGATE_FILE_SUFFIX); }) .collect(groupingBy((file) -> { final String fileName = file.getFileName().toString(); return fileName.substring(0, fileName.lastIndexOf('-')); })); for (final Entry<String, List<Path>> e : byPrefix.entrySet()) { final Histogram aggregate = aggregateHistograms(e); final String filePrefix = e.getKey(); saveToFile(aggregate, directory.resolve(filePrefix + AGGREGATE_FILE_SUFFIX)); createReportFile(aggregate, directory.resolve(filePrefix + REPORT_FILE_SUFFIX)); } }
ResultsAggregator { public void run() throws IOException { final Map<String, List<Path>> byPrefix = walk(directory) .filter((path) -> { if (!isRegularFile(path)) { return false; } final String fileName = path.getFileName().toString(); return fileName.endsWith(FILE_EXTENSION) && !fileName.endsWith(AGGREGATE_FILE_SUFFIX); }) .collect(groupingBy((file) -> { final String fileName = file.getFileName().toString(); return fileName.substring(0, fileName.lastIndexOf('-')); })); for (final Entry<String, List<Path>> e : byPrefix.entrySet()) { final Histogram aggregate = aggregateHistograms(e); final String filePrefix = e.getKey(); saveToFile(aggregate, directory.resolve(filePrefix + AGGREGATE_FILE_SUFFIX)); createReportFile(aggregate, directory.resolve(filePrefix + REPORT_FILE_SUFFIX)); } } }
ResultsAggregator { public void run() throws IOException { final Map<String, List<Path>> byPrefix = walk(directory) .filter((path) -> { if (!isRegularFile(path)) { return false; } final String fileName = path.getFileName().toString(); return fileName.endsWith(FILE_EXTENSION) && !fileName.endsWith(AGGREGATE_FILE_SUFFIX); }) .collect(groupingBy((file) -> { final String fileName = file.getFileName().toString(); return fileName.substring(0, fileName.lastIndexOf('-')); })); for (final Entry<String, List<Path>> e : byPrefix.entrySet()) { final Histogram aggregate = aggregateHistograms(e); final String filePrefix = e.getKey(); saveToFile(aggregate, directory.resolve(filePrefix + AGGREGATE_FILE_SUFFIX)); createReportFile(aggregate, directory.resolve(filePrefix + REPORT_FILE_SUFFIX)); } } ResultsAggregator(final Path directory, final double reportOutputScalingRatio); }
ResultsAggregator { public void run() throws IOException { final Map<String, List<Path>> byPrefix = walk(directory) .filter((path) -> { if (!isRegularFile(path)) { return false; } final String fileName = path.getFileName().toString(); return fileName.endsWith(FILE_EXTENSION) && !fileName.endsWith(AGGREGATE_FILE_SUFFIX); }) .collect(groupingBy((file) -> { final String fileName = file.getFileName().toString(); return fileName.substring(0, fileName.lastIndexOf('-')); })); for (final Entry<String, List<Path>> e : byPrefix.entrySet()) { final Histogram aggregate = aggregateHistograms(e); final String filePrefix = e.getKey(); saveToFile(aggregate, directory.resolve(filePrefix + AGGREGATE_FILE_SUFFIX)); createReportFile(aggregate, directory.resolve(filePrefix + REPORT_FILE_SUFFIX)); } } ResultsAggregator(final Path directory, final double reportOutputScalingRatio); void run(); static void main(final String[] args); }
ResultsAggregator { public void run() throws IOException { final Map<String, List<Path>> byPrefix = walk(directory) .filter((path) -> { if (!isRegularFile(path)) { return false; } final String fileName = path.getFileName().toString(); return fileName.endsWith(FILE_EXTENSION) && !fileName.endsWith(AGGREGATE_FILE_SUFFIX); }) .collect(groupingBy((file) -> { final String fileName = file.getFileName().toString(); return fileName.substring(0, fileName.lastIndexOf('-')); })); for (final Entry<String, List<Path>> e : byPrefix.entrySet()) { final Histogram aggregate = aggregateHistograms(e); final String filePrefix = e.getKey(); saveToFile(aggregate, directory.resolve(filePrefix + AGGREGATE_FILE_SUFFIX)); createReportFile(aggregate, directory.resolve(filePrefix + REPORT_FILE_SUFFIX)); } } ResultsAggregator(final Path directory, final double reportOutputScalingRatio); void run(); static void main(final String[] args);  }