blob: f166f6acad0c71446e13264ff299529676b9963e [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:12:51 GMT 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InMemorySCMStore (Apache Hadoop YARN SharedCacheManager 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="InMemorySCMStore (Apache Hadoop YARN SharedCacheManager 3.3.1 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":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/InMemorySCMStore.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>Prev&nbsp;Class</li>
<li><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html" target="_top">Frames</a></li>
<li><a href="InMemorySCMStore.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.classes.inherited.from.class.org.apache.hadoop.service.CompositeService">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.org.apache.hadoop.yarn.server.sharedcachemanager.store.SCMStore">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>Field&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.hadoop.yarn.server.sharedcachemanager.store</div>
<h2 title="Class InMemorySCMStore" class="title">Class InMemorySCMStore</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.service.AbstractService</li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.service.CompositeService</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">org.apache.hadoop.yarn.server.sharedcachemanager.store.SCMStore</a></li>
<li>
<ul class="inheritance">
<li>org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/AutoCloseable.html?is-external=true" title="class or interface in java.lang">AutoCloseable</a>, org.apache.hadoop.service.Service</dd>
</dl>
<hr>
<br>
<pre>@InterfaceAudience.Private
@InterfaceStability.Evolving
public class <span class="typeNameLabel">InMemorySCMStore</span>
extends <a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></pre>
<div class="block">A thread safe version of an in-memory SCM store. The thread safety is
implemented with two key pieces: (1) at the mapping level a ConcurrentHashMap
is used to allow concurrency to resources and their associated references,
and (2) a key level lock is used to ensure mutual exclusion between any
operation that accesses a resource with the same key. <br>
<br>
To ensure safe key-level locking, we use the original string key and intern
it weakly using hadoop's <code>StringInterner</code>. It avoids the pitfalls
of using built-in String interning. The interned strings are also weakly
referenced, so it can be garbage collected once it is done. And there is
little risk of keys being available for other parts of the code so they can
be used as locks accidentally. <br>
<br>
Resources in the in-memory store are evicted based on a time staleness
criteria. If a resource is not referenced (i.e. used) for a given period, it
is designated as a stale resource and is considered evictable.</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>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.hadoop.service.CompositeService">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;org.apache.hadoop.service.CompositeService</h3>
<code>org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHook</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.hadoop.service.Service">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;org.apache.hadoop.service.Service</h3>
<code>org.apache.hadoop.service.Service.STATE</code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.hadoop.yarn.server.sharedcachemanager.store.SCMStore">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.hadoop.yarn.server.sharedcachemanager.store.<a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></h3>
<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#appChecker">appChecker</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.hadoop.service.CompositeService">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.hadoop.service.CompositeService</h3>
<code>STOP_ONLY_STARTED_SERVICES</code></li>
</ul>
</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="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#InMemorySCMStore--">InMemorySCMStore</a></span>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#InMemorySCMStore-org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker-">InMemorySCMStore</a></span>(<a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/AppChecker.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager">AppChecker</a>&nbsp;appChecker)</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><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/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#addResource-java.lang.String-java.lang.String-">addResource</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;key,
<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;fileName)</code>
<div class="block">Adds the given resource to the store under the key and the filename.</div>
</td>
</tr>
<tr id="i1" 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/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#addResourceReference-java.lang.String-org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference-">addResourceReference</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;key,
<a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&nbsp;ref)</code>
<div class="block">Adds the provided resource reference to the cache resource under the key,
and updates the access time.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#cleanResourceReferences-java.lang.String-">cleanResourceReferences</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;key)</code>
<div class="block">Provides atomicity for the method.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<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/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#getResourceReferences-java.lang.String-">getResourceReferences</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;key)</code>
<div class="block">Returns the list of resource references currently registered under the
cache entry.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#isResourceEvictable-java.lang.String-org.apache.hadoop.fs.FileStatus-">isResourceEvictable</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;key,
org.apache.hadoop.fs.FileStatus&nbsp;file)</code>
<div class="block">Check if a specific resource is evictable according to the store's enabled
cache eviction policies.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#removeResource-java.lang.String-">removeResource</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;key)</code>
<div class="block">Removes the given resource from the store.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#removeResourceReference-java.lang.String-org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference-boolean-">removeResourceReference</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;key,
<a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&nbsp;ref,
boolean&nbsp;updateAccessTime)</code>
<div class="block">Removes the provided resource reference from the resource.</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/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#removeResourceReferences-java.lang.String-java.util.Collection-boolean-">removeResourceReferences</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;key,
<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/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&gt;&nbsp;refs,
boolean&nbsp;updateAccessTime)</code>
<div class="block">Removes the provided collection of resource references from the resource.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#serviceInit-org.apache.hadoop.conf.Configuration-">serviceInit</a></span>(org.apache.hadoop.conf.Configuration&nbsp;conf)</code>
<div class="block">The in-memory store bootstraps itself from the shared cache entries that
exist in HDFS.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#serviceStart--">serviceStart</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html#serviceStop--">serviceStop</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.yarn.server.sharedcachemanager.store.SCMStore">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.hadoop.yarn.server.sharedcachemanager.store.<a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></h3>
<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#createAppCheckerService-org.apache.hadoop.conf.Configuration-">createAppCheckerService</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.service.CompositeService">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.hadoop.service.CompositeService</h3>
<code>addIfService, addService, getServices, removeService</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.service.AbstractService">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.hadoop.service.AbstractService</h3>
<code>close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop</code></li>
</ul>
<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#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">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="InMemorySCMStore--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>InMemorySCMStore</h4>
<pre>public&nbsp;InMemorySCMStore()</pre>
</li>
</ul>
<a name="InMemorySCMStore-org.apache.hadoop.yarn.server.sharedcachemanager.AppChecker-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>InMemorySCMStore</h4>
<pre>public&nbsp;InMemorySCMStore(<a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/AppChecker.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager">AppChecker</a>&nbsp;appChecker)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="serviceInit-org.apache.hadoop.conf.Configuration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>serviceInit</h4>
<pre>protected&nbsp;void&nbsp;serviceInit(org.apache.hadoop.conf.Configuration&nbsp;conf)
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<div class="block">The in-memory store bootstraps itself from the shared cache entries that
exist in HDFS.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#serviceInit-org.apache.hadoop.conf.Configuration-">serviceInit</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd>
</dl>
</li>
</ul>
<a name="serviceStart--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>serviceStart</h4>
<pre>protected&nbsp;void&nbsp;serviceStart()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>serviceStart</code>&nbsp;in class&nbsp;<code>org.apache.hadoop.service.CompositeService</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd>
</dl>
</li>
</ul>
<a name="serviceStop--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>serviceStop</h4>
<pre>protected&nbsp;void&nbsp;serviceStop()
throws <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>serviceStop</code>&nbsp;in class&nbsp;<code>org.apache.hadoop.service.CompositeService</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true" title="class or interface in java.lang">Exception</a></code></dd>
</dl>
</li>
</ul>
<a name="addResource-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addResource</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;addResource(<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="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;fileName)</pre>
<div class="block">Adds the given resource to the store under the key and the filename. If the
entry is already found, it returns the existing filename. It represents the
state of the store at the time of this query. The entry may change or even
be removed once this method returns. The caller should be prepared to
handle that situation.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#addResource-java.lang.String-java.lang.String-">addResource</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dd><code>fileName</code> - the filename of the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the filename of the newly inserted resource or that of the existing
resource</dd>
</dl>
</li>
</ul>
<a name="addResourceReference-java.lang.String-org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addResourceReference</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;addResourceReference(<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/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&nbsp;ref)</pre>
<div class="block">Adds the provided resource reference to the cache resource under the key,
and updates the access time. If it returns a non-null value, the caller may
safely assume that the resource will not be removed at least until the app
in this resource reference has terminated.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#addResourceReference-java.lang.String-org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference-">addResourceReference</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dd><code>ref</code> - the <code>SharedCacheResourceReference</code> to add</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the filename of the resource, or null if the resource is not found</dd>
</dl>
</li>
</ul>
<a name="getResourceReferences-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getResourceReferences</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/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&gt;&nbsp;getResourceReferences(<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)</pre>
<div class="block">Returns the list of resource references currently registered under the
cache entry. If the list is empty, it returns an empty collection. The
returned collection is unmodifiable and a snapshot of the information at
the time of the query. The state may change after this query returns. The
caller should handle the situation that some or all of these resource
references are no longer relevant.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#getResourceReferences-java.lang.String-">getResourceReferences</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the collection that contains the resource references associated
with the resource; or an empty collection if no resource references
are registered under this resource</dd>
</dl>
</li>
</ul>
<a name="removeResourceReference-java.lang.String-org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeResourceReference</h4>
<pre>public&nbsp;boolean&nbsp;removeResourceReference(<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/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&nbsp;ref,
boolean&nbsp;updateAccessTime)</pre>
<div class="block">Removes the provided resource reference from the resource. If the resource
does not exist, nothing will be done.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#removeResourceReference-java.lang.String-org.apache.hadoop.yarn.server.sharedcachemanager.store.SharedCacheResourceReference-boolean-">removeResourceReference</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dd><code>ref</code> - the <code>SharedCacheResourceReference</code> to remove</dd>
<dd><code>updateAccessTime</code> - true if the call should update the access time for
the resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the reference was removed, false otherwise</dd>
</dl>
</li>
</ul>
<a name="removeResourceReferences-java.lang.String-java.util.Collection-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeResourceReferences</h4>
<pre>public&nbsp;void&nbsp;removeResourceReferences(<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="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/hadoop/yarn/server/sharedcachemanager/store/SharedCacheResourceReference.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SharedCacheResourceReference</a>&gt;&nbsp;refs,
boolean&nbsp;updateAccessTime)</pre>
<div class="block">Removes the provided collection of resource references from the resource.
If the resource does not exist, nothing will be done.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#removeResourceReferences-java.lang.String-java.util.Collection-boolean-">removeResourceReferences</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dd><code>refs</code> - the collection of <code>SharedCacheResourceReference</code>s to
remove</dd>
<dd><code>updateAccessTime</code> - true if the call should update the access time for
the resource</dd>
</dl>
</li>
</ul>
<a name="cleanResourceReferences-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cleanResourceReferences</h4>
<pre>public&nbsp;void&nbsp;cleanResourceReferences(<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)
throws org.apache.hadoop.yarn.exceptions.YarnException</pre>
<div class="block">Provides atomicity for the method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#cleanResourceReferences-java.lang.String-">cleanResourceReferences</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.apache.hadoop.yarn.exceptions.YarnException</code></dd>
</dl>
</li>
</ul>
<a name="removeResource-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeResource</h4>
<pre>public&nbsp;boolean&nbsp;removeResource(<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)</pre>
<div class="block">Removes the given resource from the store. Returns true if the resource is
found and removed or if the resource is not found. Returns false if it was
unable to remove the resource because the resource reference list was not
empty.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#removeResource-java.lang.String-">removeResource</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the resource was removed or did not exist, false if the
resource existed, contained at least one
<code>SharedCacheResourceReference</code> and was not removed.</dd>
</dl>
</li>
</ul>
<a name="isResourceEvictable-java.lang.String-org.apache.hadoop.fs.FileStatus-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isResourceEvictable</h4>
<pre>public&nbsp;boolean&nbsp;isResourceEvictable(<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,
org.apache.hadoop.fs.FileStatus&nbsp;file)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#isResourceEvictable-java.lang.String-org.apache.hadoop.fs.FileStatus-">SCMStore</a></code></span></div>
<div class="block">Check if a specific resource is evictable according to the store's enabled
cache eviction policies.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html#isResourceEvictable-java.lang.String-org.apache.hadoop.fs.FileStatus-">isResourceEvictable</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store">SCMStore</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - a unique identifier for a resource</dd>
<dd><code>file</code> - the <code>FileStatus</code> object for the resource file in the
file system.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the resource is evicatble, false otherwise</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/InMemorySCMStore.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>Prev&nbsp;Class</li>
<li><a href="../../../../../../../org/apache/hadoop/yarn/server/sharedcachemanager/store/SCMStore.html" title="class in org.apache.hadoop.yarn.server.sharedcachemanager.store"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/hadoop/yarn/server/sharedcachemanager/store/InMemorySCMStore.html" target="_top">Frames</a></li>
<li><a href="InMemorySCMStore.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.classes.inherited.from.class.org.apache.hadoop.service.CompositeService">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.org.apache.hadoop.yarn.server.sharedcachemanager.store.SCMStore">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>Field&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; 2008&#x2013;2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>