Skip to content

Commit

Permalink
HADOOP-19043. Code review; print stream which doesn't make closed/ope…
Browse files Browse the repository at this point in the history
…n assert.

Change-Id: I35ba5f0b6cba67967dc945326944cb2cf942c2e8
  • Loading branch information
steveloughran committed Jan 21, 2024
1 parent e69a8b8 commit 68f5c8d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -477,21 +477,21 @@ private static void assertS3StreamClosed(final FSDataInputStream in) {
if (wrapped instanceof S3AInputStream) {
S3AInputStream s3ain = (S3AInputStream) wrapped;
Assertions.assertThat(s3ain.isObjectStreamOpen())
.describedAs("stream is open")
.describedAs("stream is open: %s", s3ain)
.isFalse();
}
}

/**
* Assert that the inner S3 Stream is open.
* Assert that the inner S3 Stream is closed.
* @param in input stream
*/
private static void assertS3StreamOpen(final FSDataInputStream in) {
final InputStream wrapped = in.getWrappedStream();
if (wrapped instanceof S3AInputStream) {
S3AInputStream s3ain = (S3AInputStream) wrapped;
Assertions.assertThat(s3ain.isObjectStreamOpen())
.describedAs("stream is closed")
.describedAs("stream is closed: %s", s3ain)
.isTrue();
}
}
Expand Down

0 comments on commit 68f5c8d

Please sign in to comment.