protected static class WALEntryStreamTestBase.WALEntryStreamWithRetries extends Object
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.| Modifier and Type | Field and Description |
|---|---|
private org.apache.hadoop.hbase.wal.WAL.Entry |
result |
| Constructor and Description |
|---|
WALEntryStreamWithRetries(org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceLogQueue logQueue,
org.apache.hadoop.conf.Configuration conf,
long startPosition,
org.apache.hadoop.hbase.replication.regionserver.WALFileLengthProvider walFileLengthProvider,
org.apache.hadoop.hbase.ServerName serverName,
org.apache.hadoop.hbase.replication.regionserver.MetricsSource metrics,
String walGroupId) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
org.apache.hadoop.fs.Path |
getCurrentPath() |
long |
getPosition() |
boolean |
hasNext() |
org.apache.hadoop.hbase.wal.WAL.Entry |
next() |
org.apache.hadoop.hbase.wal.WAL.Entry |
peek() |
void |
reset() |
private org.apache.hadoop.hbase.wal.WAL.Entry result
public WALEntryStreamWithRetries(org.apache.hadoop.hbase.replication.regionserver.ReplicationSourceLogQueue logQueue, org.apache.hadoop.conf.Configuration conf, long startPosition, org.apache.hadoop.hbase.replication.regionserver.WALFileLengthProvider walFileLengthProvider, org.apache.hadoop.hbase.ServerName serverName, org.apache.hadoop.hbase.replication.regionserver.MetricsSource metrics, String walGroupId) throws IOException
IOExceptionpublic org.apache.hadoop.hbase.wal.WAL.Entry next()
public boolean hasNext() throws IOException
IOExceptionpublic org.apache.hadoop.hbase.wal.WAL.Entry peek() throws IOException
IOExceptionpublic void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic long getPosition()
public org.apache.hadoop.fs.Path getCurrentPath()
public void reset() throws IOException
IOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.