stasis/je-7.5.11/docs/java/com/sleepycat/je/CacheMode.html

724 lines
33 KiB
HTML
Raw Normal View History

2019-06-25 20:12:40 +00:00
<!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_151) on Tue Oct 31 17:36:45 EDT 2017 -->
<title>CacheMode (Oracle - Berkeley DB Java Edition API)</title>
<meta name="date" content="2017-10-31">
<link rel="stylesheet" type="text/css" href="../../../style.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="CacheMode (Oracle - Berkeley DB Java Edition API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static 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/CacheMode.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"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/sleepycat/je/BtreeStats.html" title="class in com.sleepycat.je"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/sleepycat/je/CheckpointConfig.html" title="class in com.sleepycat.je"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/sleepycat/je/CacheMode.html" target="_top">Frames</a></li>
<li><a href="CacheMode.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="#enum.constant.summary">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#enum.constant.detail">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&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">com.sleepycat.je</div>
<h2 title="Enum CacheMode" class="title">Enum CacheMode</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>java.lang.Enum&lt;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a>&gt;</li>
<li>
<ul class="inheritance">
<li>com.sleepycat.je.CacheMode</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Comparable&lt;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a>&gt;</dd>
</dl>
<hr>
<br>
<pre>public enum <span class="typeNameLabel">CacheMode</span>
extends java.lang.Enum&lt;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a>&gt;</pre>
<div class="block">Modes that can be specified for control over caching of records in the JE
in-memory cache. When a record is stored or retrieved, the cache mode
determines how long the record is subsequently retained in the JE in-memory
cache, relative to other records in the cache.
<p>When the cache overflows, JE must evict some records from the cache. By
default, JE uses a Least Recently Used (LRU) algorithm for determining which
records to evict. With the LRU algorithm, JE makes a best effort to evict
the "coldest" (least recently used or accessed) records and to retain the
"hottest" records in the cache for as long as possible.</p>
<p>When an <a href="../../../com/sleepycat/je/EnvironmentMutableConfig.html#setOffHeapCacheSize-long-"><code>off-heap
cache</code></a> is configured, records evicted from the main cache are placed in
the off-heap cache, and a separate LRU is used to determine when to evict
a record from the off-heap cache.</p>
<p>JE uses an approximate LRU approach with some exceptions and special
cases.</p>
<ul>
<li>
Individual records (LNs or Leaf Nodes) do not appear on the LRU
list, i.e., their "hotness" is not explicitly tracked. Instead,
their containing Btree node (BIN or bottom internal node) appears on
the LRU list. Each BIN contains roughly 100 LNs
(see <a href="../../../com/sleepycat/je/EnvironmentConfig.html#NODE_MAX_ENTRIES"><code>EnvironmentConfig.NODE_MAX_ENTRIES</code></a>).
When an LN is accessed, its BIN is moved to the hot end of the LRU
list, implying that all other LNs in the same BIN also are treated
as if they are hot. The same applies if the BIN is moved to the cold
end of the LRU list. The above statement applies to the off-heap
cache also, when one is configured.
</li>
<li>
When a BIN contains LNs and the BIN reaches the cold end of the LRU
list, memory can be reclaimed by evicting the LNs, and eviction of
the BIN is deferred. The empty BIN is moved to the hot end of the
LRU list. When an off-heap cache is configured, the eviction of LNs
in this manner occurs independently in both caches.
</li>
<li>
When a BIN contains no LNs, it may be evicted entirely. When the
BINs parent node becomes empty, it may also be evicted, and so on.
The BINs and INs are evicted on the basis of an LRU, but with two
exceptions:
<p>
1) Dirty BINs and INs are evicted only after eviction of all
non-dirty BINs and INs. This is important to reduce logging and
associated cleaning costs. When an off-heap cache is configured,
BINs and INs are evicted from the main cache without regard to
whether they are dirty. Dirty BINs and INs are evicted last, as
just described, only from the off-heap cache.
<p>
2) A BIN may be mutated to a BIN-delta to reclaim memory, rather
then being evicted entirely. A BIN-delta contains only the dirty
entries (for LNs recently logged). A BIN-delta is used when its
size relative to the full BIN will be small enough so that it will
be more efficient, both on disk and in memory, to store the delta
rather than the full BIN.
(see <a href="../../../com/sleepycat/je/EnvironmentConfig.html#TREE_BIN_DELTA"><code>EnvironmentConfig.TREE_BIN_DELTA</code></a>).
The advantage of keeping a BIN-delta in cache is that some
operations, particularly record insertions, can be performed using
the delta without having the complete BIN in cache. When a BIN is
mutated to a BIN-delta to reclaim memory, it is placed at the hot
end of the LRU list. When an off-heap cache is configured, BINs are
not mutated to BIN-deltas in the main cache, but rather this is done
only in the off-heap cache.
</li>
<li>
To reduce contention among threads on the LRU list, multiple LRU
lists may be configured. See
<a href="../../../com/sleepycat/je/EnvironmentConfig.html#EVICTOR_N_LRU_LISTS"><code>EnvironmentConfig.EVICTOR_N_LRU_LISTS</code></a>.
As described in the javadoc for this parameter, there is a trade-off
between thread contention and the accuracy of the LRU. This
parameter determines the number of main cache LRU lists as well as
the number of off-heap cache LRU lists, when an off-heap cache is
configured.
</li>
<li>
A non-default cache mode may be explicitly specified to override
the LRU behavior. See the CacheMode enumeration values for details.
the normal LRU behavior described above. See the CacheMode
enumeration values for details. The behavior of each CacheMode
when an off-heap cache is configured is also described.
</li>
</ul>
<p>When no cache mode is explicitly specified, the default cache mode is
<a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT"><code>DEFAULT</code></a>. The default mode causes the normal LRU algorithm to be
used.</p>
<p>An explicit cache mode may be specified as an <a href="../../../com/sleepycat/je/EnvironmentMutableConfig.html#setCacheMode-com.sleepycat.je.CacheMode-"><code>Environment property</code></a>, a <a href="../../../com/sleepycat/je/DatabaseConfig.html#setCacheMode-com.sleepycat.je.CacheMode-"><code>Database property</code></a>, a <a href="../../../com/sleepycat/je/Cursor.html#setCacheMode-com.sleepycat.je.CacheMode-"><code>Cursor property</code></a>, or on a per-operation basis using
<a href="../../../com/sleepycat/je/ReadOptions.html#setCacheMode-com.sleepycat.je.CacheMode-"><code>ReadOptions.setCacheMode(CacheMode)</code></a> or <a href="../../../com/sleepycat/je/WriteOptions.html#setCacheMode-com.sleepycat.je.CacheMode-"><code>WriteOptions.setCacheMode(CacheMode)</code></a>. If none are specified, <a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT"><code>DEFAULT</code></a> is used. If more than one non-null property is specified, the
Cursor property overrides the Database and Environment properties, and the
Database property overrides the Environment property.</p>
<p>When all records in a given Database, or all Databases, should be treated
the same with respect to caching, using the Database and/or Environment
cache mode properties is sufficient. For applications that need finer
grained control, the Cursor cache mode property can be used to provide a
specific cache mode for individual records or operations. The Cursor cache
mode property can be changed at any time, and the cache mode specified will
apply to subsequent operations performed with that Cursor.</p>
<p>In a Replicated Environment where a non-default cache mode is desired,
the cache mode can be configured on the Master node as described above.
However, it is important to configure the cache mode on the Replica nodes
using an Environment property. That way, the cache mode will apply to
<em>write</em> operations that are replayed on the Replica for all
Databases, even if the Databases are not open by the application on the
Replica. Since all nodes may be Replicas at some point in their life cycle,
it is recommended to configure the desired cache mode as an Environment
property on all nodes in a Replicated Environment.</p>
<p>On a Replica, per-Database control over the cache mode for <em>write</em>
operations is possible by opening the Database on the Replica and
configuring the cache mode. Per-Cursor control (meaning per-record or
per-operation) control of the cache mode is not possible on a Replica for
<em>write</em> operations. For <em>read</em> operations, both per-Database
and per-Cursor control is possible on the Replica, as described above.</p>
<p>
The cache related stats in <a href="../../../com/sleepycat/je/EnvironmentStats.html" title="class in com.sleepycat.je"><code>EnvironmentStats</code></a> can provide some measure
of the effectiveness of the cache mode choice.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="EnvironmentStats.html#cacheSizing">Cache Statistics:
Sizing</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum.constant.summary">
<!-- -->
</a>
<h3>Enum Constant Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation">
<caption><span>Enum Constants</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Enum Constant and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT">DEFAULT</a></span></code>
<div class="block">The record's hotness is changed to "most recently used" by the
operation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#EVICT_BIN">EVICT_BIN</a></span></code>
<div class="block">The record's BIN (and its LNs) are evicted after the operation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#EVICT_LN">EVICT_LN</a></span></code>
<div class="block">The record's LN is evicted after the operation, and the containing
BIN is moved to the hot end of the LRU list.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#KEEP_HOT">KEEP_HOT</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">please use <a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT"><code>DEFAULT</code></a> instead. As of JE 4.0, this mode
functions exactly as if <a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT"><code>DEFAULT</code></a> were specified.</span></div>
</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#MAKE_COLD">MAKE_COLD</a></span></code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;
<div class="block"><span class="deprecationComment">please use <a href="../../../com/sleepycat/je/CacheMode.html#UNCHANGED"><code>UNCHANGED</code></a> instead. As of JE 4.0, this
mode functions exactly as if <a href="../../../com/sleepycat/je/CacheMode.html#UNCHANGED"><code>UNCHANGED</code></a> were specified.</span></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#UNCHANGED">UNCHANGED</a></span></code>
<div class="block">The record's hotness or coldness is unchanged by the operation where
this cache mode is specified.</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="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="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#valueOf-java.lang.String-">valueOf</a></span>(java.lang.String&nbsp;name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../com/sleepycat/je/CacheMode.html#values--">values</a></span>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Enum">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Enum</h3>
<code>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</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.Object</h3>
<code>getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ENUM CONSTANT DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="enum.constant.detail">
<!-- -->
</a>
<h3>Enum Constant Detail</h3>
<a name="DEFAULT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT</h4>
<pre>public static final&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a> DEFAULT</pre>
<div class="block">The record's hotness is changed to "most recently used" by the
operation.
<p>This cache mode is used when the application does not need explicit
control over the cache and a standard LRU approach is sufficient.</p>
<p>Note that <code>null</code> may be specified to use the <code>DEFAULT</code>
mode.</p>
<p>Specifically:
<ul>
<li>The BIN containing the record's LN will remain in the main
cache, and it is moved to the hot end of its LRU list.</li>
<li>When an off-heap cache is configured, the record's LN and BIN
will be loaded into the main cache only. They will be removed from
the off-heap cache, if they were present there. However, if other
LNs belonging to this BIN were present in the off-heap cache, they
will remain there.</li>
<ul></div>
</li>
</ul>
<a name="KEEP_HOT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>KEEP_HOT</h4>
<pre>public static final&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a> KEEP_HOT</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">please use <a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT"><code>DEFAULT</code></a> instead. As of JE 4.0, this mode
functions exactly as if <a href="../../../com/sleepycat/je/CacheMode.html#DEFAULT"><code>DEFAULT</code></a> were specified.</span></div>
</li>
</ul>
<a name="UNCHANGED">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>UNCHANGED</h4>
<pre>public static final&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a> UNCHANGED</pre>
<div class="block">The record's hotness or coldness is unchanged by the operation where
this cache mode is specified.
<p>This cache mode is normally used when the application prefers that
the operation should not perturb the cache, for example, when scanning
over all records in a database.</p>
<p>Specifically:
<ul>
<li>A record's LN and BIN must be loaded into the main cache in
order to perform the operation. However, they may be removed from
the main cache after the operation, to avoid a net change to the
cache, according to the rules below.</li>
<li>If the record's LN was not present in the main cache prior to
the operation, then the LN will be evicted from the main cache
after the operation. The LN will not be added to, or removed from,
the off-heap cache.</li>
<li>When the LN is to be evicted from the main cache (according to
the above rules) and the operation is not performed via a cursor,
the LN is evicted when the operation is complete. When a cursor is
used, the LN is evicted when the cursor is moved to a different
record or closed.</li>
<li>If the record's BIN was not present in the main cache prior to
the operation, the action taken depends on whether the BIN is dirty
and whether an off-heap cache is configured.
<ul>
<li>When the BIN is not dirty, the BIN (and LN) will be evicted
from the main cache after the operation. The BIN (and LN) will
not be added to, or removed from, the off-heap cache.</li>
<li>When the BIN is dirty and an off-heap cache is
<em>not</em> configured, the BIN will not be evicted from the
main cache and will be moved to the hot end of its main cache
LRU list. This is done to reduce logging.</li>
<li>When the BIN is dirty and an off-heap cache <em>is</em>
configured, we evict the BIN from the main cache even when it
is dirty because the BIN (and LN) will be stored in the off-heap
cache and the BIN will not be logged. The BIN will be placed at
the hot end of its off-heap LRU list.</li>
<li>Note that when this operation loaded the BIN and the BIN
becomes dirty, it is normally because this operation is a write
operation. However, other concurrent threads can also dirty the
BIN.</li>
</ul>
<li>When the BIN is to be evicted from the main cache (according
to the above rules) and the operation is not performed via a
cursor, the BIN is evicted when the operation is complete. When a
cursor is used, the BIN is evicted only when the cursor moves to a
different BIN or is closed. Because of the way BINs are evicted,
when multiple operations are performed using a single cursor and
not perturbing the cache is desired, it is important to use this
cache mode for all of the operations.</li>
<li>When the BIN was present in the main cache prior to the
operation, its position in the LRU list will not be changed. Its
position in the off-heap LRU list, if it is present in the off-heap
cache, will also not be changed.</li>
</ul></div>
</li>
</ul>
<a name="MAKE_COLD">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MAKE_COLD</h4>
<pre>public static final&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a> MAKE_COLD</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>&nbsp;<span class="deprecationComment">please use <a href="../../../com/sleepycat/je/CacheMode.html#UNCHANGED"><code>UNCHANGED</code></a> instead. As of JE 4.0, this
mode functions exactly as if <a href="../../../com/sleepycat/je/CacheMode.html#UNCHANGED"><code>UNCHANGED</code></a> were specified.</span></div>
</li>
</ul>
<a name="EVICT_LN">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>EVICT_LN</h4>
<pre>public static final&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a> EVICT_LN</pre>
<div class="block">The record's LN is evicted after the operation, and the containing
BIN is moved to the hot end of the LRU list.
<p>This cache mode is normally used when not all LNs will fit into the
main cache, and the application prefers to read the LN from the log file
or load it from the off-heap cache when the record is accessed again,
rather than have it take up space in the main cache and potentially
cause expensive Java GC. By using this mode, the file system cache or
off-heap cache can be relied on for holding LNs, which complements the
use of the JE cache to hold BINs and INs.</p>
<p>Note that using this mode for all operations will prevent the cache
from filling, if all internal nodes fit in cache.</p>
<p>Specifically:
<ul>
<li>The record's LN will be evicted from the main cache after the
operation. The LN will be added to the off-heap cache, if it is not
already present and an off-heap cache is configured.</li>
<li>When the operation is not performed via a cursor, the LN is
evicted when the operation is complete. When a cursor is used, the
LN is evicted when the cursor is moved to a different record or
closed.</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>3.3.98</dd>
</dl>
</li>
</ul>
<a name="EVICT_BIN">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>EVICT_BIN</h4>
<pre>public static final&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a> EVICT_BIN</pre>
<div class="block">The record's BIN (and its LNs) are evicted after the operation.
<p>This cache mode is normally used when not all BINs will fit into the
main cache, and the application prefers to read the LN and BIN from the
log file or load it from the off-heap cache when the record is accessed
again, rather than have them take up space in the JE cache and
potentially cause expensive Java GC.</p>
<p>Because this mode evicts all LNs in the BIN, even if they are "hot"
from the perspective of a different accessor, this mode should be used
with caution. One valid use case is where all accessors use this mode;
in this case the cache mode might be set on a per-Database or
per-Environment basis.</p>
<p>Note that using this mode for all operations will prevent the cache
from filling, if all upper internal nodes fit in cache.</p>
<p>Specifically:
<ul>
<li>The record's LN will be evicted from the main cache after the
operation. The LN will be added to the off-heap cache, if it is not
already present and an off-heap cache is configured.</li>
<li>When the operation is not performed via a cursor, the LN is
evicted when the operation is complete. When a cursor is used, the
LN is evicted when the cursor is moved to a different record or
closed.</li>
<li>Whether the BIN is evicted depends on whether the BIN is dirty
and whether an off-heap cache is configured.
<ul>
<li>When the BIN is not dirty, the BIN (and LN) will be evicted
from the main cache after the operation. The BIN (and LN) will
be added to the off-heap cache, if they are not already present
and an off-heap cache is configured. The BIN will be placed at
the hot end of its off-heap LRU list.</li>
<li>When the BIN is dirty and an off-heap cache is
<em>not</em> configured, the BIN will not be evicted from the
main cache and will be moved to the hot end of its main cache
LRU list. This is done to reduce logging.</li>
<li>When the BIN is dirty and an off-heap cache <em>is</em>
configured, we evict the BIN from the main cache even when it
is dirty because the BIN (and LN) will be stored in the off-heap
cache and the BIN will not be logged. The BIN will be placed at
the hot end of its off-heap LRU list.</li>
<li>Note that BIN may have been dirtied by this operation, if
it is a write operation, or by earlier write operations.</li>
</ul>
<li>When the BIN is to be evicted from the main cache (according
to the above rules) and the operation is not performed via a
cursor, the BIN is evicted when the operation is complete. When a
cursor is used, the BIN is evicted only when the cursor moves to a
different BIN or is closed. Because of the way BINs are evicted,
when multiple operations are performed using a single cursor and
not perturbing the cache is desired, it is important to use this
cache mode for all of the operations.</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>4.0.97</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="values--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>values</h4>
<pre>public static&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a>[]&nbsp;values()</pre>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
<pre>
for (CacheMode c : CacheMode.values())
&nbsp; System.out.println(c);
</pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array containing the constants of this enum type, in the order they are declared</dd>
</dl>
</li>
</ul>
<a name="valueOf-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>valueOf</h4>
<pre>public static&nbsp;<a href="../../../com/sleepycat/je/CacheMode.html" title="enum in com.sleepycat.je">CacheMode</a>&nbsp;valueOf(java.lang.String&nbsp;name)</pre>
<div class="block">Returns the enum constant of this type with the specified name.
The string must match <i>exactly</i> an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - the name of the enum constant to be returned.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the enum constant with the specified name</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd>
<dd><code>java.lang.NullPointerException</code> - if the argument is null</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/CacheMode.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"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../com/sleepycat/je/BtreeStats.html" title="class in com.sleepycat.je"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../com/sleepycat/je/CheckpointConfig.html" title="class in com.sleepycat.je"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?com/sleepycat/je/CacheMode.html" target="_top">Frames</a></li>
<li><a href="CacheMode.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="#enum.constant.summary">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#enum.constant.detail">Enum Constants</a>&nbsp;|&nbsp;</li>
<li>Field&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><font size=1>Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.</font> </small></p>
</body>
</html>