virajjasani commented on a change in pull request #3332:
URL: https://github.com/apache/hbase/pull/3332#discussion_r641920706
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStream.java
##########
@@ -103,6 +106,27 @@
private static final NavigableMap<byte[], Integer> scopes = getScopes();
private final String fakeWalGroupId = "fake-wal-group-id";
+ /**
+ * Test helper that waits until a non-null entry is available in the stream
next or times out.
+ */
+ private static class WALEntryStreamWithRetries extends WALEntryStream {
+ // Class member to be able to set a non-final from within a lambda.
+ private Entry result;
+
+ public WALEntryStreamWithRetries(ReplicationSourceLogQueue logQueue,
Configuration conf,
+ long startPosition, WALFileLengthProvider walFileLengthProvider,
ServerName serverName,
+ MetricsSource metrics, String walGroupId) throws IOException {
+ super(logQueue, conf, startPosition, walFileLengthProvider, serverName,
metrics, walGroupId);
+ }
+
+ @Override
+ public Entry next() {
+ Waiter.waitFor(CONF, TEST_TIMEOUT_MS, (Waiter.Predicate<Exception>) ()
-> (result
+ = WALEntryStreamWithRetries.super.next()) != null);
Review comment:
nit:
```
Waiter.waitFor(CONF, TEST_TIMEOUT_MS, () -> (result =
WALEntryStreamWithRetries.super.next()) != null);
```
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStream.java
##########
@@ -103,6 +106,27 @@
private static final NavigableMap<byte[], Integer> scopes = getScopes();
private final String fakeWalGroupId = "fake-wal-group-id";
+ /**
+ * Test helper that waits until a non-null entry is available in the stream
next or times out.
+ */
+ private static class WALEntryStreamWithRetries extends WALEntryStream {
+ // Class member to be able to set a non-final from within a lambda.
+ private Entry result;
Review comment:
Nice
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]