Class WALEntryStreamTestBase.WALEntryStreamWithRetries
java.lang.Object
org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase.WALEntryStreamWithRetries
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- WALEntryStreamTestBase
Test helper that waits until a non-null entry is available in the stream next or times out. A
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 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.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
org.apache.hadoop.hbase.replication.regionserver.WALEntryStream.HasNext
-
Field Summary
-
Constructor Summary
ConstructorDescriptionWALEntryStreamWithRetries
(org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceLogQueue logQueue, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, long startPosition, org.apache.hadoop.hbase.replication.regionserver.WALFileLengthProvider walFileLengthProvider, org.apache.hadoop.hbase.replication.regionserver.MetricsSource metrics, String walGroupId) -
Method Summary
-
Field Details
-
retry
-
-
Constructor Details
-
WALEntryStreamWithRetries
public WALEntryStreamWithRetries(org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceLogQueue logQueue, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, long startPosition, org.apache.hadoop.hbase.replication.regionserver.WALFileLengthProvider walFileLengthProvider, org.apache.hadoop.hbase.replication.regionserver.MetricsSource metrics, String walGroupId)
-
-
Method Details
-
enableRetry
-
disableRetry
-
hasNext
-
peek
public org.apache.hadoop.hbase.wal.WAL.Entry peek() -
next
public org.apache.hadoop.hbase.wal.WAL.Entry next() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getPosition
public long getPosition() -
getCurrentPath
public org.apache.hadoop.fs.Path getCurrentPath()
-