blob: 5b457d7cf6870983d97f4c59c7c5151722021092 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_292) on Tue Jun 15 06:05:32 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DFSInotifyEventInputStream (Apache Hadoop HDFS Client 3.3.1 API)</title>
<meta name="date" content="2021-06-15">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DFSInotifyEventInputStream (Apache Hadoop HDFS Client 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DFSInotifyEventInputStream.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/hadoop/hdfs/DFSClient.DFSDataInputStream.html" title="class in org.apache.hadoop.hdfs"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/hadoop/hdfs/DFSOpsCountStatistics.html" title="class in org.apache.hadoop.hdfs"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html" target="_top">Frames</a></li>
<li><a href="DFSInotifyEventInputStream.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.hadoop.hdfs</div>
<h2 title="Class DFSInotifyEventInputStream" class="title">Class DFSInotifyEventInputStream</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.hdfs.DFSInotifyEventInputStream</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>@InterfaceAudience.Public
@InterfaceStability.Unstable
public class <span class="typeNameLabel">DFSInotifyEventInputStream</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Stream for reading inotify events. DFSInotifyEventInputStreams should not
be shared among multiple threads.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static org.slf4j.Logger</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#LOG">LOG</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#getTxidsBehindEstimate--">getTxidsBehindEstimate</a></span>()</code>
<div class="block">Return a estimate of how many transaction IDs behind the NameNode's
current state this stream is.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/hadoop/hdfs/inotify/EventBatch.html" title="class in org.apache.hadoop.hdfs.inotify">EventBatch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#poll--">poll</a></span>()</code>
<div class="block">Returns the next batch of events in the stream or null if no new
batches are currently available.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/hadoop/hdfs/inotify/EventBatch.html" title="class in org.apache.hadoop.hdfs.inotify">EventBatch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#poll-long-java.util.concurrent.TimeUnit-">poll</a></span>(long&nbsp;time,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a>&nbsp;tu)</code>
<div class="block">Returns the next event batch in the stream, waiting up to the specified
amount of time for a new batch.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/hadoop/hdfs/inotify/EventBatch.html" title="class in org.apache.hadoop.hdfs.inotify">EventBatch</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#take--">take</a></span>()</code>
<div class="block">Returns the next batch of events in the stream, waiting indefinitely if
a new batch is not immediately available.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="LOG">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LOG</h4>
<pre>public static final&nbsp;org.slf4j.Logger LOG</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="poll--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>poll</h4>
<pre>public&nbsp;<a href="../../../../org/apache/hadoop/hdfs/inotify/EventBatch.html" title="class in org.apache.hadoop.hdfs.inotify">EventBatch</a>&nbsp;poll()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="../../../../org/apache/hadoop/hdfs/inotify/MissingEventsException.html" title="class in org.apache.hadoop.hdfs.inotify">MissingEventsException</a></pre>
<div class="block">Returns the next batch of events in the stream or null if no new
batches are currently available.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - 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.</dd>
<dd><code><a href="../../../../org/apache/hadoop/hdfs/inotify/MissingEventsException.html" title="class in org.apache.hadoop.hdfs.inotify">MissingEventsException</a></code> - 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.</dd>
</dl>
</li>
</ul>
<a name="getTxidsBehindEstimate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTxidsBehindEstimate</h4>
<pre>public&nbsp;long&nbsp;getTxidsBehindEstimate()</pre>
<div class="block">Return a estimate of how many transaction IDs behind the NameNode's
current state this stream is. Clients should periodically call this method
and check if its result is steadily increasing, which indicates that they
are falling behind (i.e. transaction are being generated faster than the
client is reading them). If a client falls too far behind events may be
deleted before the client can read them.
<p>
A return value of -1 indicates that an estimate could not be produced, and
should be ignored. The value returned by this method is really only useful
when compared to previous or subsequent returned values.</div>
</li>
</ul>
<a name="poll-long-java.util.concurrent.TimeUnit-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>poll</h4>
<pre>public&nbsp;<a href="../../../../org/apache/hadoop/hdfs/inotify/EventBatch.html" title="class in org.apache.hadoop.hdfs.inotify">EventBatch</a>&nbsp;poll(long&nbsp;time,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html?is-external=true" title="class or interface in java.util.concurrent">TimeUnit</a>&nbsp;tu)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a>,
<a href="../../../../org/apache/hadoop/hdfs/inotify/MissingEventsException.html" title="class in org.apache.hadoop.hdfs.inotify">MissingEventsException</a></pre>
<div class="block">Returns the next event batch in the stream, waiting up to the specified
amount of time for a new batch. Returns null if one is not available at the
end of the specified amount of time. The time before the method returns may
exceed the specified amount of time by up to the time required for an RPC
to the NameNode.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>time</code> - number of units of the given TimeUnit to wait</dd>
<dd><code>tu</code> - the desired TimeUnit</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - see <a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#poll--"><code>poll()</code></a></dd>
<dd><code><a href="../../../../org/apache/hadoop/hdfs/inotify/MissingEventsException.html" title="class in org.apache.hadoop.hdfs.inotify">MissingEventsException</a></code> - see <a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#poll--"><code>poll()</code></a></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - if the calling thread is interrupted</dd>
</dl>
</li>
</ul>
<a name="take--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>take</h4>
<pre>public&nbsp;<a href="../../../../org/apache/hadoop/hdfs/inotify/EventBatch.html" title="class in org.apache.hadoop.hdfs.inotify">EventBatch</a>&nbsp;take()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a>,
<a href="../../../../org/apache/hadoop/hdfs/inotify/MissingEventsException.html" title="class in org.apache.hadoop.hdfs.inotify">MissingEventsException</a></pre>
<div class="block">Returns the next batch of events in the stream, waiting indefinitely if
a new batch is not immediately available.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - see <a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#poll--"><code>poll()</code></a></dd>
<dd><code><a href="../../../../org/apache/hadoop/hdfs/inotify/MissingEventsException.html" title="class in org.apache.hadoop.hdfs.inotify">MissingEventsException</a></code> - see
<a href="../../../../org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html#poll--"><code>poll()</code></a></dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html?is-external=true" title="class or interface in java.lang">InterruptedException</a></code> - if the calling thread is interrupted</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DFSInotifyEventInputStream.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/hadoop/hdfs/DFSClient.DFSDataInputStream.html" title="class in org.apache.hadoop.hdfs"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/hadoop/hdfs/DFSOpsCountStatistics.html" title="class in org.apache.hadoop.hdfs"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/hadoop/hdfs/DFSInotifyEventInputStream.html" target="_top">Frames</a></li>
<li><a href="DFSInotifyEventInputStream.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2008&#x2013;2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>