summaryrefslogtreecommitdiffstats
path: root/container-core
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2022-06-14 13:51:57 +0200
committerjonmv <venstad@gmail.com>2022-06-14 13:51:57 +0200
commit4dfe98dad3aab5c3d77605b67bc758be770bd93e (patch)
treeae1cab80cd95b785bc6222a5e83bfe103d20bc80 /container-core
parente0e3ff465fcec5bb6a7253da2cd6df82f9701066 (diff)
Add some comments, cleanup
Diffstat (limited to 'container-core')
-rw-r--r--container-core/src/main/java/com/yahoo/container/handler/LogReader.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/LogReader.java b/container-core/src/main/java/com/yahoo/container/handler/LogReader.java
index 250e3c8b607..2d60dc3f37b 100644
--- a/container-core/src/main/java/com/yahoo/container/handler/LogReader.java
+++ b/container-core/src/main/java/com/yahoo/container/handler/LogReader.java
@@ -104,14 +104,15 @@ class LogReader {
try {
in = Files.newInputStream(log);
}
- catch (NoSuchFileException e) {
+ catch (NoSuchFileException e) { // File may have been compressed since we found it.
if ( ! zipped)
try {
- in = Files.newInputStream(Paths.get(log.toString() + ".gz"));
+ in = Files.newInputStream(Paths.get(log + ".gz"));
zipped = true;
}
catch (NoSuchFileException ignored) { }
}
+
this.reader = new BufferedReader(new InputStreamReader(zipped ? new GZIPInputStream(in) : in, UTF_8));
this.from = from;
this.to = to;
@@ -252,6 +253,7 @@ class LogReader {
.toInstant()
.plus(Duration.ofSeconds(1));
}
+ // TODO: accept .zst files when the io.airlift library supports streamed input.
throw new IllegalArgumentException("Unrecognized file pattern for file at '" + path + "'");
}