blob: 2d838b3dfbf626b70b44a1f10cce53c0cbed3d26 [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>LocallyCachedBlob (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="LocallyCachedBlob (Storm 2.4.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":6,"i2":6,"i3":6,"i4":10,"i5":6,"i6":10,"i7":10,"i8":10,"i9":6,"i10":6,"i11":6,"i12":9,"i13":10,"i14":6,"i15":10,"i16":10,"i17":10,"i18":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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/LocallyCachedBlob.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/localizer/LocalizedResourceRetentionSet.html" title="class in org.apache.storm.localizer"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/storm/localizer/LocallyCachedTopologyBlob.html" title="class in org.apache.storm.localizer"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/storm/localizer/LocallyCachedBlob.html" target="_top">Frames</a></li>
<li><a href="LocallyCachedBlob.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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.localizer</div>
<h2 title="Class LocallyCachedBlob" class="title">Class LocallyCachedBlob</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.localizer.LocallyCachedBlob</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../org/apache/storm/localizer/LocalizedResource.html" title="class in org.apache.storm.localizer">LocalizedResource</a>, <a href="../../../../org/apache/storm/localizer/LocallyCachedTopologyBlob.html" title="class in org.apache.storm.localizer">LocallyCachedTopologyBlob</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">LocallyCachedBlob</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>Represents a blob that is cached locally on disk by the supervisor.</p></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>protected long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#localUpdateTime">localUpdateTime</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#NOT_DOWNLOADED_VERSION">NOT_DOWNLOADED_VERSION</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#LocallyCachedBlob-java.lang.String-java.lang.String-org.apache.storm.metric.StormMetricsRegistry-">LocallyCachedBlob</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;blobDescription,
<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;blobKey,
<a href="../../../../org/apache/storm/metric/StormMetricsRegistry.html" title="class in org.apache.storm.metric">StormMetricsRegistry</a>&nbsp;metricsRegistry)</code>
<div class="block">Create a new LocallyCachedBlob.</div>
</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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#addReference-org.apache.storm.localizer.PortAndAssignment-org.apache.storm.localizer.BlobChangingCallback-">addReference</a></span>(<a href="../../../../org/apache/storm/localizer/PortAndAssignment.html" title="interface in org.apache.storm.localizer">PortAndAssignment</a>&nbsp;pna,
<a href="../../../../org/apache/storm/localizer/BlobChangingCallback.html" title="interface in org.apache.storm.localizer">BlobChangingCallback</a>&nbsp;cb)</code>
<div class="block">Mark that a given port and assignment are using this.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#cleanupOrphanedData--">cleanupOrphanedData</a></span>()</code>
<div class="block">Clean up any temporary files.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#commitNewVersion-long-">commitNewVersion</a></span>(long&nbsp;version)</code>
<div class="block">Commit the new version and make it available for the end user.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#completelyRemove--">completelyRemove</a></span>()</code>
<div class="block">Completely remove anything that is cached locally for this blob and all tracking files also stored for it.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected org.apache.storm.localizer.LocallyCachedBlob.DownloadMeta</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#fetch-org.apache.storm.blobstore.ClientBlobStore-java.lang.String-org.apache.storm.localizer.IOFunction-org.apache.storm.localizer.IOFunction-">fetch</a></span>(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;store,
<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;key,
<a href="../../../../org/apache/storm/localizer/IOFunction.html" title="interface in org.apache.storm.localizer">IOFunction</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&gt;&nbsp;pathSupplier,
<a href="../../../../org/apache/storm/localizer/IOFunction.html" title="interface in org.apache.storm.localizer">IOFunction</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&gt;&nbsp;outStreamSupplier)</code>
<div class="block">Helper function to download blob from blob store.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>abstract long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#fetchUnzipToTemp-org.apache.storm.blobstore.ClientBlobStore-">fetchUnzipToTemp</a></span>(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;store)</code>
<div class="block">Download the latest version to a temp location.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/storm/localizer/PortAndAssignment.html" title="interface in org.apache.storm.localizer">PortAndAssignment</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getDependencies--">getDependencies</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><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></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getKey--">getKey</a></span>()</code>
<div class="block">Get the key for this blob.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getLastUsed--">getLastUsed</a></span>()</code>
<div class="block">Get the last time that this used for LRU calculations.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>abstract long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getLocalVersion--">getLocalVersion</a></span>()</code>
<div class="block">Get the version of the blob cached locally.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>abstract long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getRemoteVersion-org.apache.storm.blobstore.ClientBlobStore-">getRemoteVersion</a></span>(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;store)</code>
<div class="block">Get the version of the blob in the blob store.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>abstract long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getSizeOnDisk--">getSizeOnDisk</a></span>()</code>
<div class="block">Get the amount of disk space that is used by this blob.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>protected static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#getSizeOnDisk-java.nio.file.Path-">getSizeOnDisk</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;p)</code>
<div class="block">Get the size of p in bytes.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#informReferencesAndCommitNewVersion-long-">informReferencesAndCommitNewVersion</a></span>(long&nbsp;newVersion)</code>
<div class="block">Inform all of the callbacks that a change is going to happen and then wait for them to all get back that it is OK to make that change.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#isFullyDownloaded--">isFullyDownloaded</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#isUsed--">isUsed</a></span>()</code>
<div class="block">Return true if this blob is actively being used, else false (meaning it can be deleted, but might not be).</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#removeReference-org.apache.storm.localizer.PortAndAssignment-">removeReference</a></span>(<a href="../../../../org/apache/storm/localizer/PortAndAssignment.html" title="interface in org.apache.storm.localizer">PortAndAssignment</a>&nbsp;pna)</code>
<div class="block">Removes a reservation for this blob from a given slot and assignemnt.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#touch--">touch</a></span>()</code>
<div class="block">Updates the last updated time.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/storm/localizer/LocallyCachedBlob.html#update-org.apache.storm.blobstore.ClientBlobStore-long-">update</a></span>(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;blobStore,
long&nbsp;remoteBlobstoreUpdateTime)</code>
<div class="block">Checks and downloads a blob locally as necessary.</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="NOT_DOWNLOADED_VERSION">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>NOT_DOWNLOADED_VERSION</h4>
<pre>public static final&nbsp;long NOT_DOWNLOADED_VERSION</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../constant-values.html#org.apache.storm.localizer.LocallyCachedBlob.NOT_DOWNLOADED_VERSION">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="localUpdateTime">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>localUpdateTime</h4>
<pre>protected&nbsp;long localUpdateTime</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="LocallyCachedBlob-java.lang.String-java.lang.String-org.apache.storm.metric.StormMetricsRegistry-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LocallyCachedBlob</h4>
<pre>protected&nbsp;LocallyCachedBlob(<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;blobDescription,
<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;blobKey,
<a href="../../../../org/apache/storm/metric/StormMetricsRegistry.html" title="class in org.apache.storm.metric">StormMetricsRegistry</a>&nbsp;metricsRegistry)</pre>
<div class="block"><p>Create a new LocallyCachedBlob.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>blobDescription</code> - a description of the blob this represents. Typically it should at least be the blob key, but ideally also include if it is an archive or not, what user or topology it is for, or if it is a storm.jar etc.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="fetch-org.apache.storm.blobstore.ClientBlobStore-java.lang.String-org.apache.storm.localizer.IOFunction-org.apache.storm.localizer.IOFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fetch</h4>
<pre>protected&nbsp;org.apache.storm.localizer.LocallyCachedBlob.DownloadMeta&nbsp;fetch(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;store,
<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;key,
<a href="../../../../org/apache/storm/localizer/IOFunction.html" title="interface in org.apache.storm.localizer">IOFunction</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang">Long</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&gt;&nbsp;pathSupplier,
<a href="../../../../org/apache/storm/localizer/IOFunction.html" title="interface in org.apache.storm.localizer">IOFunction</a>&lt;<a href="https://docs.oracle.com/javase/8/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a>&gt;&nbsp;outStreamSupplier)
throws <a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a>,
<a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a>,
<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>Helper function to download blob from blob store.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>store</code> - Blob store to fetch blobs from</dd>
<dd><code>key</code> - Key to retrieve blobs</dd>
<dd><code>pathSupplier</code> - A function that supplies the download destination of a blob. It guarantees the validity of path or 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"><code>IOException</code></a></dd>
<dd><code>outStreamSupplier</code> - A function that supplies the <a href="https://docs.oracle.com/javase/8/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><code>OutputStream</code></a> object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The metadata of the download session, including blob&rsquo;s version and download destination</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a></code> - Thrown if key to retrieve blob is invalid</dd>
<dd><code><a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a></code> - Thrown if the retrieval is not under security authorization</dd>
<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> - Thrown if any IO error occurs</dd>
</dl>
</li>
</ul>
<a name="getLocalVersion--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLocalVersion</h4>
<pre>public abstract&nbsp;long&nbsp;getLocalVersion()</pre>
<div class="block"><p>Get the version of the blob cached locally. If the version is unknown or it has not been downloaded NOT_DOWNLOADED_VERSION should be returned. PRECONDITION: this can only be called with a lock on this instance held.</p></div>
</li>
</ul>
<a name="getRemoteVersion-org.apache.storm.blobstore.ClientBlobStore-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRemoteVersion</h4>
<pre>public abstract&nbsp;long&nbsp;getRemoteVersion(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;store)
throws <a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a>,
<a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a></pre>
<div class="block"><p>Get the version of the blob in the blob store. PRECONDITION: this can only be called with a lock on this instance held.</p></div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a></code></dd>
<dd><code><a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a></code></dd>
</dl>
</li>
</ul>
<a name="fetchUnzipToTemp-org.apache.storm.blobstore.ClientBlobStore-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fetchUnzipToTemp</h4>
<pre>public abstract&nbsp;long&nbsp;fetchUnzipToTemp(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;store)
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/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a>,
<a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a></pre>
<div class="block"><p>Download the latest version to a temp location. This may also include unzipping some or all of the data to a temp location. PRECONDITION: this can only be called with a lock on this instance held.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>store</code> - the store to us to download the data.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the version that was downloaded.</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>
<dd><code><a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a></code></dd>
<dd><code><a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a></code></dd>
</dl>
</li>
</ul>
<a name="commitNewVersion-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commitNewVersion</h4>
<pre>protected abstract&nbsp;void&nbsp;commitNewVersion(long&nbsp;version)
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>Commit the new version and make it available for the end user. PRECONDITION: uncompressToTempLocationIfNeeded will have been called. PRECONDITION: this can only be called with a lock on this instance held.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>version</code> - the version of the blob to commit.</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="cleanupOrphanedData--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cleanupOrphanedData</h4>
<pre>public abstract&nbsp;void&nbsp;cleanupOrphanedData()
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>Clean up any temporary files. This will be called after updating a blob, either successfully or if an error has occured. The goal is to find any files that may be left over and remove them so space is not leaked. PRECONDITION: this can only be called with a lock on this instance held.</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="completelyRemove--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>completelyRemove</h4>
<pre>public abstract&nbsp;void&nbsp;completelyRemove()
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>Completely remove anything that is cached locally for this blob and all tracking files also stored for it. This will be called after the blob was determined to no longer be needed in the cache. PRECONDITION: this can only be called with a lock on this instance held.</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="getSizeOnDisk--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSizeOnDisk</h4>
<pre>public abstract&nbsp;long&nbsp;getSizeOnDisk()</pre>
<div class="block"><p>Get the amount of disk space that is used by this blob. If the blob is uncompressed it should be the sum of the space used by all of the uncompressed files. In general this will not be called with any locks held so it is a good idea to cache it and updated it when committing a new version.</p></div>
</li>
</ul>
<a name="getSizeOnDisk-java.nio.file.Path-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSizeOnDisk</h4>
<pre>protected static&nbsp;long&nbsp;getSizeOnDisk(<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file">Path</a>&nbsp;p)
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>Get the size of p in bytes.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>p</code> - the path to read.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the size of p in bytes.</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="touch--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>touch</h4>
<pre>protected&nbsp;void&nbsp;touch()</pre>
<div class="block"><p>Updates the last updated time. This should be called when references are added or removed.</p></div>
</li>
</ul>
<a name="getLastUsed--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLastUsed</h4>
<pre>public&nbsp;long&nbsp;getLastUsed()</pre>
<div class="block"><p>Get the last time that this used for LRU calculations.</p></div>
</li>
</ul>
<a name="isUsed--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isUsed</h4>
<pre>public&nbsp;boolean&nbsp;isUsed()</pre>
<div class="block"><p>Return true if this blob is actively being used, else false (meaning it can be deleted, but might not be).</p></div>
</li>
</ul>
<a name="addReference-org.apache.storm.localizer.PortAndAssignment-org.apache.storm.localizer.BlobChangingCallback-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addReference</h4>
<pre>public&nbsp;void&nbsp;addReference(<a href="../../../../org/apache/storm/localizer/PortAndAssignment.html" title="interface in org.apache.storm.localizer">PortAndAssignment</a>&nbsp;pna,
<a href="../../../../org/apache/storm/localizer/BlobChangingCallback.html" title="interface in org.apache.storm.localizer">BlobChangingCallback</a>&nbsp;cb)</pre>
<div class="block"><p>Mark that a given port and assignment are using this.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pna</code> - the slot and assignment that are using this blob.</dd>
<dd><code>cb</code> - an optional callback indicating that they want to know/synchronize when a blob is updated.</dd>
</dl>
</li>
</ul>
<a name="removeReference-org.apache.storm.localizer.PortAndAssignment-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeReference</h4>
<pre>public&nbsp;boolean&nbsp;removeReference(<a href="../../../../org/apache/storm/localizer/PortAndAssignment.html" title="interface in org.apache.storm.localizer">PortAndAssignment</a>&nbsp;pna)</pre>
<div class="block"><p>Removes a reservation for this blob from a given slot and assignemnt.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pna</code> - the slot + assignment that no longer needs this blob.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>false if a reference was failed to be removed</dd>
</dl>
</li>
</ul>
<a name="informReferencesAndCommitNewVersion-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>informReferencesAndCommitNewVersion</h4>
<pre>public&nbsp;void&nbsp;informReferencesAndCommitNewVersion(long&nbsp;newVersion)
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>Inform all of the callbacks that a change is going to happen and then wait for them to all get back that it is OK to make that change. Commit the new version once all callbacks are ready. Finally inform all callbacks that the commit is complete.</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="getKey--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKey</h4>
<pre>public&nbsp;<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;getKey()</pre>
<div class="block"><p>Get the key for this blob.</p></div>
</li>
</ul>
<a name="getDependencies--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDependencies</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/storm/localizer/PortAndAssignment.html" title="interface in org.apache.storm.localizer">PortAndAssignment</a>&gt;&nbsp;getDependencies()</pre>
</li>
</ul>
<a name="isFullyDownloaded--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isFullyDownloaded</h4>
<pre>public abstract&nbsp;boolean&nbsp;isFullyDownloaded()</pre>
</li>
</ul>
<a name="update-org.apache.storm.blobstore.ClientBlobStore-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update(<a href="../../../../org/apache/storm/blobstore/ClientBlobStore.html" title="class in org.apache.storm.blobstore">ClientBlobStore</a>&nbsp;blobStore,
long&nbsp;remoteBlobstoreUpdateTime)
throws <a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a>,
<a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a>,
<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 and downloads a blob locally as necessary.</p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>blobStore</code> - the client blobstore</dd>
<dd><code>remoteBlobstoreUpdateTime</code> - last update time of remote blobstore</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../org/apache/storm/generated/KeyNotFoundException.html" title="class in org.apache.storm.generated">KeyNotFoundException</a></code> - if the remote blob is missing</dd>
<dd><code><a href="../../../../org/apache/storm/generated/AuthorizationException.html" title="class in org.apache.storm.generated">AuthorizationException</a></code> - if authorization is failed</dd>
<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> - on errors</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/LocallyCachedBlob.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/localizer/LocalizedResourceRetentionSet.html" title="class in org.apache.storm.localizer"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/storm/localizer/LocallyCachedTopologyBlob.html" title="class in org.apache.storm.localizer"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/storm/localizer/LocallyCachedBlob.html" target="_top">Frames</a></li>
<li><a href="LocallyCachedBlob.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><a href="#constructor.summary">Constr</a>&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><a href="#constructor.detail">Constr</a>&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>