@Test void missingFileInDb() throws Exception { fileCopier.copy(); balanceFileParser.parse(); assertParsedFiles(); assertAccountBalances(); }
@Override public void parse() { Stopwatch stopwatch = Stopwatch.createStarted(); DateRangeFilter dateRangeFilter = mirrorDateRangePropertiesProcessor.getDateRangeFilter(parserProperties.getStreamType()); try { File balanceFilePath = parserProperties.getValidPath().toFile(); File[] balanceFiles = Objects.requireNonNullElseGet(balanceFilePath.listFiles(), () -> new File[] {}); Arrays.sort(balanceFiles, Collections.reverseOrder()); for (File balanceFile : balanceFiles) { if (ShutdownHelper.isStopping()) { throw new RuntimeException("Process is shutting down"); } parseBalanceFile(balanceFile, dateRangeFilter); } log.info("Completed processing {} balance files in {}", balanceFiles.length, stopwatch); } catch (Exception e) { log.error("Error processing balances files after {}", stopwatch, e); } }
BalanceFileParser extends FileWatcher { @Override public void parse() { Stopwatch stopwatch = Stopwatch.createStarted(); DateRangeFilter dateRangeFilter = mirrorDateRangePropertiesProcessor.getDateRangeFilter(parserProperties.getStreamType()); try { File balanceFilePath = parserProperties.getValidPath().toFile(); File[] balanceFiles = Objects.requireNonNullElseGet(balanceFilePath.listFiles(), () -> new File[] {}); Arrays.sort(balanceFiles, Collections.reverseOrder()); for (File balanceFile : balanceFiles) { if (ShutdownHelper.isStopping()) { throw new RuntimeException("Process is shutting down"); } parseBalanceFile(balanceFile, dateRangeFilter); } log.info("Completed processing {} balance files in {}", balanceFiles.length, stopwatch); } catch (Exception e) { log.error("Error processing balances files after {}", stopwatch, e); } } }
BalanceFileParser extends FileWatcher { @Override public void parse() { Stopwatch stopwatch = Stopwatch.createStarted(); DateRangeFilter dateRangeFilter = mirrorDateRangePropertiesProcessor.getDateRangeFilter(parserProperties.getStreamType()); try { File balanceFilePath = parserProperties.getValidPath().toFile(); File[] balanceFiles = Objects.requireNonNullElseGet(balanceFilePath.listFiles(), () -> new File[] {}); Arrays.sort(balanceFiles, Collections.reverseOrder()); for (File balanceFile : balanceFiles) { if (ShutdownHelper.isStopping()) { throw new RuntimeException("Process is shutting down"); } parseBalanceFile(balanceFile, dateRangeFilter); } log.info("Completed processing {} balance files in {}", balanceFiles.length, stopwatch); } catch (Exception e) { log.error("Error processing balances files after {}", stopwatch, e); } } BalanceFileParser(BalanceParserProperties parserProperties,
            MirrorDateRangePropertiesProcessor mirrorDateRangePropertiesProcessor,
            AccountBalancesFileLoader accountBalancesFileLoader); }
BalanceFileParser extends FileWatcher { @Override public void parse() { Stopwatch stopwatch = Stopwatch.createStarted(); DateRangeFilter dateRangeFilter = mirrorDateRangePropertiesProcessor.getDateRangeFilter(parserProperties.getStreamType()); try { File balanceFilePath = parserProperties.getValidPath().toFile(); File[] balanceFiles = Objects.requireNonNullElseGet(balanceFilePath.listFiles(), () -> new File[] {}); Arrays.sort(balanceFiles, Collections.reverseOrder()); for (File balanceFile : balanceFiles) { if (ShutdownHelper.isStopping()) { throw new RuntimeException("Process is shutting down"); } parseBalanceFile(balanceFile, dateRangeFilter); } log.info("Completed processing {} balance files in {}", balanceFiles.length, stopwatch); } catch (Exception e) { log.error("Error processing balances files after {}", stopwatch, e); } } BalanceFileParser(BalanceParserProperties parserProperties,
            MirrorDateRangePropertiesProcessor mirrorDateRangePropertiesProcessor,
            AccountBalancesFileLoader accountBalancesFileLoader); @Override void parse(); }
BalanceFileParser extends FileWatcher { @Override public void parse() { Stopwatch stopwatch = Stopwatch.createStarted(); DateRangeFilter dateRangeFilter = mirrorDateRangePropertiesProcessor.getDateRangeFilter(parserProperties.getStreamType()); try { File balanceFilePath = parserProperties.getValidPath().toFile(); File[] balanceFiles = Objects.requireNonNullElseGet(balanceFilePath.listFiles(), () -> new File[] {}); Arrays.sort(balanceFiles, Collections.reverseOrder()); for (File balanceFile : balanceFiles) { if (ShutdownHelper.isStopping()) { throw new RuntimeException("Process is shutting down"); } parseBalanceFile(balanceFile, dateRangeFilter); } log.info("Completed processing {} balance files in {}", balanceFiles.length, stopwatch); } catch (Exception e) { log.error("Error processing balances files after {}", stopwatch, e); } } BalanceFileParser(BalanceParserProperties parserProperties,
            MirrorDateRangePropertiesProcessor mirrorDateRangePropertiesProcessor,
            AccountBalancesFileLoader accountBalancesFileLoader); @Override void parse();  }