@InterfaceAudience.Public @InterfaceStability.Unstable public class DFSInotifyEventInputStream extends Object
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
long |
getTxidsBehindEstimate()
Return a estimate of how many transaction IDs behind the NameNode's
current state this stream is.
|
EventBatch |
poll()
Returns the next batch of events in the stream or null if no new
batches are currently available.
|
EventBatch |
poll(long time,
TimeUnit tu)
Returns the next event batch in the stream, waiting up to the specified
amount of time for a new batch.
|
EventBatch |
take()
Returns the next batch of events in the stream, waiting indefinitely if
a new batch is not immediately available.
|
public EventBatch poll() throws IOException, MissingEventsException
IOException
- because of network error or edit log
corruption. Also possible if JournalNodes are unresponsive in the
QJM setting (even one unresponsive JournalNode is enough in rare cases),
so catching this exception and retrying at least a few times is
recommended.MissingEventsException
- if we cannot return the next batch in the
stream because the data for the events (and possibly some subsequent
events) has been deleted (generally because this stream is a very large
number of transactions behind the current state of the NameNode). It is
safe to continue reading from the stream after this exception is thrown
The next available batch of events will be returned.public long getTxidsBehindEstimate()
public EventBatch poll(long time, TimeUnit tu) throws IOException, InterruptedException, MissingEventsException
time
- number of units of the given TimeUnit to waittu
- the desired TimeUnitIOException
- see poll()
MissingEventsException
- see poll()
InterruptedException
- if the calling thread is interruptedpublic EventBatch take() throws IOException, InterruptedException, MissingEventsException
IOException
- see poll()
MissingEventsException
- see
poll()
InterruptedException
- if the calling thread is interruptedCopyright © 2019 Apache Software Foundation. All rights reserved.