|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hdfs.DFSInotifyEventInputStream
@InterfaceAudience.Public @InterfaceStability.Unstable public class DFSInotifyEventInputStream
Stream for reading inotify events. DFSInotifyEventInputStreams should not be shared among multiple threads.
Field Summary | |
---|---|
static org.slf4j.Logger |
LOG
|
Method Summary | |
---|---|
long |
getEventsBehindEstimate()
Return a estimate of how many events behind the NameNode's current state this stream is. |
Event |
poll()
Returns the next event in the stream or null if no new events are currently available. |
Event |
poll(long time,
TimeUnit tu)
Returns the next event in the stream, waiting up to the specified amount of time for a new event. |
Event |
take()
Returns the next event in the stream, waiting indefinitely if a new event is not immediately available. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static org.slf4j.Logger LOG
Method Detail |
---|
public Event 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 event in the
stream because the data for the event (and possibly some subsequent events)
has been deleted (generally because this stream is a very large number of
events behind the current state of the NameNode). It is safe to continue
reading from the stream after this exception is thrown -- the next
available event will be returned.public long getEventsBehindEstimate()
public Event poll(long time, TimeUnit tu) throws IOException, InterruptedException, MissingEventsException
time
- number of units of the given TimeUnit to waittu
- the desired TimeUnit
IOException
- see poll()
MissingEventsException
- see poll()
InterruptedException
- if the calling thread is interruptedpublic Event take() throws IOException, InterruptedException, MissingEventsException
IOException
- see poll()
MissingEventsException
- see
poll()
InterruptedException
- if the calling thread is interrupted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |