blob: 25233815450292c73d433858629720379fdd564b [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 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FileLock (Storm 2.4.0 API)</title>
<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="FileLock (Storm 2.4.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9,"i3":10,"i4":10,"i5":10,"i6":9,"i7":10,"i8":9,"i9":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static 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/FileLock.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/storm/hdfs/spout/DirLock.html" title="class in org.apache.storm.hdfs.spout"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/storm/hdfs/spout/FileLock.html" target="_top">Frames</a></li>
<li><a href="FileLock.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><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&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>Field&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.storm.hdfs.spout</div>
<h2 title="Class FileLock" class="title">Class FileLock</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.storm.hdfs.spout.FileLock</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">FileLock</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"><p>Facility to synchronize access to HDFS files. Thread gains exclusive access to a file by acquiring a FileLock object. The lock itself is represented as file on HDFS. Relies on atomic file creation. Owning thread must heartbeat periodically on the lock to prevent the lock from being deemed as stale (i.e. lock whose owning thread have died).</p></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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>static <a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html" title="class in org.apache.storm.hdfs.spout">FileLock</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#acquireOldestExpiredLock-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-int-java.lang.String-">acquireOldestExpiredLock</a></span>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFilesDir,
int&nbsp;locktimeoutSec,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;spoutId)</code>
<div class="block">Finds a oldest expired lock file (using modification timestamp), then takes ownership of the lock file.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#getLastEntry-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-">getLastEntry</a></span>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFile)</code>
<div class="block">returns the last log entry.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#getLastEntryIfStale-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-long-">getLastEntryIfStale</a></span>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFile,
long&nbsp;olderThan)</code>
<div class="block">checks if lockFile is older than &lsquo;olderThan&rsquo; UTC time by examining the modification time on file and (if necessary) the timestamp in last log entry in the file.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#getLastLogEntry--">getLastLogEntry</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>org.apache.hadoop.fs.Path</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#getLockFile--">getLockFile</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#heartbeat-java.lang.String-">heartbeat</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;fileOffset)</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/storm/hdfs/common/HdfsUtils.Pair.html" title="class in org.apache.storm.hdfs.common">HdfsUtils.Pair</a>&lt;org.apache.hadoop.fs.Path,<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#locateOldestExpiredLock-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-int-">locateOldestExpiredLock</a></span>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFilesDir,
int&nbsp;locktimeoutSec)</code>
<div class="block">Finds oldest expired lock file (using modification timestamp), then takes ownership of the lock file.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#release--">release</a></span>()</code>
<div class="block">Release lock by deleting file.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html" title="class in org.apache.storm.hdfs.spout">FileLock</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#takeOwnership-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.storm.hdfs.spout.FileLock.LogEntry-java.lang.String-">takeOwnership</a></span>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFile,
<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&nbsp;lastEntry,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;spoutId)</code>
<div class="block">Takes ownership of the lock file if possible.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html" title="class in org.apache.storm.hdfs.spout">FileLock</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html#tryLock-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.Path-java.lang.String-">tryLock</a></span>(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;fileToLock,
org.apache.hadoop.fs.Path&nbsp;lockDirPath,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;spoutId)</code>
<div class="block">returns lock on file or null if file is already locked.</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">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="tryLock-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.hadoop.fs.Path-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tryLock</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html" title="class in org.apache.storm.hdfs.spout">FileLock</a>&nbsp;tryLock(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;fileToLock,
org.apache.hadoop.fs.Path&nbsp;lockDirPath,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;spoutId)
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></pre>
<div class="block"><p>returns lock on file or null if file is already locked. throws if unexpected problem</p></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></dd>
</dl>
</li>
</ul>
<a name="getLastEntryIfStale-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLastEntryIfStale</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&nbsp;getLastEntryIfStale(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFile,
long&nbsp;olderThan)
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></pre>
<div class="block"><p>checks if lockFile is older than &lsquo;olderThan&rsquo; UTC time by examining the modification time on file and (if necessary) the timestamp in last log entry in the file. If its stale, then returns the last log entry, else returns null.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>olderThan</code> - time (millis) in UTC.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the last entry in the file if its too old. null if last entry is not too old</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></dd>
</dl>
</li>
</ul>
<a name="getLastEntry-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLastEntry</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&nbsp;getLastEntry(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFile)
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></pre>
<div class="block"><p>returns the last log entry.</p></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></dd>
</dl>
</li>
</ul>
<a name="takeOwnership-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-org.apache.storm.hdfs.spout.FileLock.LogEntry-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>takeOwnership</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html" title="class in org.apache.storm.hdfs.spout">FileLock</a>&nbsp;takeOwnership(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFile,
<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&nbsp;lastEntry,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;spoutId)
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></pre>
<div class="block"><p>Takes ownership of the lock file if possible.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lastEntry</code> - last entry in the lock file. this param is an optimization. we dont scan the lock file again to find its last entry here since its already been done once by the logic used to check if the lock file is stale. so this value comes from that earlier scan.</dd>
<dd><code>spoutId</code> - spout id</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>null if lock File is not recoverable</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> - if unable to acquire</dd>
</dl>
</li>
</ul>
<a name="acquireOldestExpiredLock-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-int-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>acquireOldestExpiredLock</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.html" title="class in org.apache.storm.hdfs.spout">FileLock</a>&nbsp;acquireOldestExpiredLock(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFilesDir,
int&nbsp;locktimeoutSec,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;spoutId)
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></pre>
<div class="block"><p>Finds a oldest expired lock file (using modification timestamp), then takes ownership of the lock file. Impt: Assumes access to lockFilesDir has been externally synchronized such that only one thread accessing the same thread</p></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></dd>
</dl>
</li>
</ul>
<a name="locateOldestExpiredLock-org.apache.hadoop.fs.FileSystem-org.apache.hadoop.fs.Path-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>locateOldestExpiredLock</h4>
<pre>public static&nbsp;<a href="../../../../../org/apache/storm/hdfs/common/HdfsUtils.Pair.html" title="class in org.apache.storm.hdfs.common">HdfsUtils.Pair</a>&lt;org.apache.hadoop.fs.Path,<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&gt;&nbsp;locateOldestExpiredLock(org.apache.hadoop.fs.FileSystem&nbsp;fs,
org.apache.hadoop.fs.Path&nbsp;lockFilesDir,
int&nbsp;locktimeoutSec)
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></pre>
<div class="block"><p>Finds oldest expired lock file (using modification timestamp), then takes ownership of the lock file. Impt: Assumes access to lockFilesDir has been externally synchronized such that only one thread accessing the same thread</p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Pair&lt;lock file path, last entry in lock file&gt; .. if expired lock file found</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></dd>
</dl>
</li>
</ul>
<a name="heartbeat-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>heartbeat</h4>
<pre>public&nbsp;void&nbsp;heartbeat(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;fileOffset)
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></pre>
<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></dd>
</dl>
</li>
</ul>
<a name="release--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>release</h4>
<pre>public&nbsp;void&nbsp;release()
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></pre>
<div class="block"><p>Release lock by deleting file.</p></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> - if lock file could not be deleted</dd>
</dl>
</li>
</ul>
<a name="getLastLogEntry--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLastLogEntry</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout">FileLock.LogEntry</a>&nbsp;getLastLogEntry()</pre>
</li>
</ul>
<a name="getLockFile--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getLockFile</h4>
<pre>public&nbsp;org.apache.hadoop.fs.Path&nbsp;getLockFile()</pre>
</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/FileLock.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 class="aboutLanguage"><script type="text/javascript" src="../../../../../highlight.pack.js"></script>
<script type="text/javascript"><!--
hljs.initHighlightingOnLoad();
//--></script></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/storm/hdfs/spout/DirLock.html" title="class in org.apache.storm.hdfs.spout"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/storm/hdfs/spout/FileLock.LogEntry.html" title="class in org.apache.storm.hdfs.spout"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/storm/hdfs/spout/FileLock.html" target="_top">Frames</a></li>
<li><a href="FileLock.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><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&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>Field&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; 2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>