@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(PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
long startPosition,
MetricsSource metrics)
Create an entry stream over the given queue at the given start position
|
WALEntryStream(PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue,
org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.conf.Configuration conf,
MetricsSource metrics)
Create an entry stream over the given queue
|
public WALEntryStream(PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, MetricsSource metrics) throws IOException
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 metricsIOException
public WALEntryStream(PriorityBlockingQueue<org.apache.hadoop.fs.Path> logQueue, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.conf.Configuration conf, long startPosition, MetricsSource metrics) throws IOException
logQueue
- the queue of WAL pathsconf
- the Configuration
to use to create WAL.Reader
for this streamstartPosition
- the position in the first WAL to start reading atmetrics
- the replication metricsIOException
public boolean hasNext()
hasNext
in interface Iterator<WAL.Entry>
WAL.Entry
WALEntryStream.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 Closeable
close
in interface AutoCloseable
IOException
public long getPosition()
public org.apache.hadoop.fs.Path getCurrentPath()
Path
of the current WALpublic void reset() throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.