diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2022-06-15 07:43:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-15 07:43:03 +0200 |
commit | 21952802fbb091a470a384c0287dbdbbb4bd3a85 (patch) | |
tree | 39fe1b9c8fced2e662eb5cd7d46f54f4951ddc2c /container-core | |
parent | 5950a0899723f12bdd628cc32c5b4f9567fee1b6 (diff) | |
parent | 4dfe98dad3aab5c3d77605b67bc758be770bd93e (diff) |
Merge pull request #23092 from vespa-engine/jonmv/read-zstd-logs
Add some comments, cleanup
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/handler/LogReader.java | 6 |
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 + "'"); } |