@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.| 限定符和类型 | 类和说明 |
|---|---|
static class |
WALEntryStream.WALEntryStreamRuntimeException |
| 构造器和说明 |
|---|
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
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
org.apache.hadoop.fs.Path |
getCurrentPath() |
long |
getPosition() |
boolean |
hasNext() |
Iterator<WAL.Entry> |
iterator() |
WAL.Entry |
next() |
void |
remove()
Not supported.
|
void |
reset()
Should be called if the stream is to be reused (i.e. used again after hasNext() has returned
false)
|
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 metricsIOExceptionpublic 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 metricsIOExceptionpublic boolean hasNext()
hasNext 在接口中 Iterator<WAL.Entry>WAL.EntryWALEntryStream.WALEntryStreamRuntimeException - if there was an Exception while readingpublic WAL.Entry next()
next 在接口中 Iterator<WAL.Entry>WALEntryStream.WALEntryStreamRuntimeException - if there was an IOExceptionNoSuchElementException - if no more entries in the stream.public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic long getPosition()
public org.apache.hadoop.fs.Path getCurrentPath()
Path of the current WALpublic void reset()
throws IOException
IOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.