HBASE-25932 addendum: Add test comments. (#3344)

Signed-off-by Anoop Sam John <anoopsamjohn@apache.org>
This commit is contained in:
Bharath Vissapragada 2021-06-01 08:03:25 -07:00 committed by GitHub
parent b04c3c7786
commit 4fb0861214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -109,6 +109,13 @@ public class TestWALEntryStream {
/**
* Test helper that waits until a non-null entry is available in the stream next or times out.
* A {@link WALEntryStream} provides a streaming access to a queue of log files. Since the stream
* can be consumed as the file is being written, callers relying on {@link WALEntryStream#next()}
* may need to retry multiple times before an entry appended to the WAL is visible to the stream
* consumers. One such cause of delay is the close() of writer writing these log files. While the
* closure is in progress, the stream does not switch to the next log in the queue and next() may
* return null entries. This utility wraps these retries into a single next call and that makes
* the test code simpler.
*/
private static class WALEntryStreamWithRetries extends WALEntryStream {
// Class member to be able to set a non-final from within a lambda.