diff options
author | Harald Musum <musum@yahooinc.com> | 2023-06-06 19:06:49 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-06-06 19:06:49 +0200 |
commit | 97ded27d6252e2092b59adf12cb229198c77b2f6 (patch) | |
tree | feb67bef5db20c514e4954f7b09b897d2af70f18 /container-search | |
parent | f2bf23e6beb8e5c7fb1de7c01a0e533002033b9f (diff) |
Make constructor public, used in system tests
Diffstat (limited to 'container-search')
-rw-r--r-- | container-search/src/main/java/com/yahoo/search/logging/Spooler.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/logging/Spooler.java b/container-search/src/main/java/com/yahoo/search/logging/Spooler.java index 862be3848f2..08cfec75fc2 100644 --- a/container-search/src/main/java/com/yahoo/search/logging/Spooler.java +++ b/container-search/src/main/java/com/yahoo/search/logging/Spooler.java @@ -65,7 +65,8 @@ public class Spooler { this(defaultSpoolPath, defaultMaxEntriesPerFile, clock, keepSuccessFiles, maxFailures); } - Spooler(Path spoolPath, int maxEntriesPerFile, Clock clock, boolean keepSuccessFiles, int maxFailures) { + // Note: Needs to be public, used in system tests + public Spooler(Path spoolPath, int maxEntriesPerFile, Clock clock, boolean keepSuccessFiles, int maxFailures) { this.spoolPath = spoolPath; this.maxEntriesPerFile = maxEntriesPerFile; this.clock = clock; @@ -109,14 +110,14 @@ public class Spooler { public void processFiles(List<File> files, Function<LoggerEntry, Boolean> transport) { for (File f : files) { log.log(Level.FINE, "Processing file " + f); - boolean succcess = false; + boolean success = false; try { List<String> lines = Files.readAllLines(f.toPath()); for (String line : lines) { LoggerEntry entry = LoggerEntry.deserialize(line); log.log(Level.FINE, "Read entry " + entry + " from " + f); - succcess = transport.apply(entry); - if (! succcess) { + success = transport.apply(entry); + if (! success) { throw new RuntimeException("Unable to process file " + f + ": unsuccessful call to transport() for " + entry); } } @@ -124,7 +125,7 @@ public class Spooler { } catch (Exception e) { handleFailure(f); } finally { - if (succcess && keepSuccessFiles) { + if (success && keepSuccessFiles) { moveProcessedFile(f, successesPath); } } |