@InterfaceAudience.Private @InterfaceStability.Evolving public class WALEntryStream extends Object implements Iterator<WAL.Entry>, Closeable, Iterable<WAL.Entry>
Path, and continually
iterates through all the WAL WAL.Entry in the queue. When it's done reading from a Path, it
dequeues it and starts reading from the next.| Modifier and Type | Class and Description |
|---|---|
static class |
WALEntryStream.WALEntryStreamRuntimeException |
| Constructor and Description |
|---|
WALEntryStream(ReplicationSourceLogQueue logQueue,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
long startPosition,
MetricsSource metrics,
String walGroupId)
Create an entry stream over the given queue at the given start position
|
WALEntryStream(ReplicationSourceLogQueue logQueue,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
MetricsSource metrics,
String walGroupId)
Create an entry stream over the given queue
|
public WALEntryStream(ReplicationSourceLogQueue logQueue, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, MetricsSource metrics, String walGroupId)
logQueue - the queue of WAL pathsfs - FileSystem to use to create WAL.Reader for this streamconf - Configuration to use to create WAL.Reader for this streammetrics - replication metricswalGroupId - wal prefixpublic WALEntryStream(ReplicationSourceLogQueue logQueue, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, long startPosition, MetricsSource metrics, String walGroupId)
logQueue - the queue of WAL pathsfs - FileSystem to use to create WAL.Reader for this streamconf - the Configuration to use to create WAL.Reader for this streamstartPosition - the position in the first WAL to start reading atmetrics - the replication metricswalGroupId - wal prefixpublic boolean hasNext()
hasNext in interface Iterator<WAL.Entry>WAL.EntryWALEntryStream.WALEntryStreamRuntimeException - if there was an Exception while readingpublic WAL.Entry next()
next in interface Iterator<WAL.Entry>WALEntryStream.WALEntryStreamRuntimeException - if there was an IOExceptionNoSuchElementException - if no more entries in the stream.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic long getPosition()
public org.apache.hadoop.fs.Path getCurrentPath()
Path of the current WALpublic void reset()
throws IOException
IOException - io exception while resetting the readerCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.