1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DbMpoolFile::set_priority()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="memp.html" title="Chapter 9. The DbMpoolFile Handle" /> 11 <link rel="prev" href="mempset_pgcookie.html" title="DbMpoolFile::set_pgcookie()" /> 12 <link rel="next" href="mutex.html" title="Chapter 10. Mutex Methods" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbMpoolFile::set_priority()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempset_pgcookie.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 9. 23 The DbMpoolFile Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="mutex.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="mempset_priority"></a>DbMpoolFile::set_priority()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbMpoolFile::set_priority(DB_CACHE_PRIORITY priority); </pre> 42 <p> 43 Set the cache priority for pages referenced by the 44 <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> handle. 45 </p> 46 <p> 47 The priority of a page biases the replacement algorithm to be more or 48 less likely to discard a page when space is needed in the cache. 49 The bias is temporary, and pages will eventually be discarded if they 50 are not referenced again. The <code class="methodname">DbMpoolFile::set_priority()</code> method is 51 only advisory, and does not guarantee pages will be treated in a 52 specific way. 53 </p> 54 <p> 55 To set the priority for the pages belonging to a particular database, 56 call the <code class="methodname">DbMpoolFile::set_priority()</code> method using the 57 <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> handle 58 returned by the <a class="xref" href="dbget_mpf.html" title="Db::get_mpf()">Db::get_mpf()</a> method. 59 </p> 60 <p> 61 The <code class="methodname">DbMpoolFile::set_priority()</code> method configures a file in the 62 cache, not only operations performed using the specified 63 <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> handle. 64 </p> 65 <p> 66 The <code class="methodname">DbMpoolFile::set_priority()</code> method may be called at any time 67 during the life of the application. 68 </p> 69 <p> 70 The <code class="methodname">DbMpoolFile::set_priority()</code> <span> 71 72 <span> 73 method either returns a non-zero error value or throws an 74 exception that encapsulates a non-zero error value on 75 failure, and returns 0 on success. 76 </span> 77 </span> 78 </p> 79 <div class="sect2" lang="en" xml:lang="en"> 80 <div class="titlepage"> 81 <div> 82 <div> 83 <h3 class="title"><a id="id1697753"></a>Parameters</h3> 84 </div> 85 </div> 86 </div> 87 <div class="sect3" lang="en" xml:lang="en"> 88 <div class="titlepage"> 89 <div> 90 <div> 91 <h4 class="title"><a id="id1697758"></a>priority</h4> 92 </div> 93 </div> 94 </div> 95 <p> 96 The <span class="bold"><strong>priority</strong></span> parameter must be set to 97 one of the following values: 98 </p> 99 <div class="itemizedlist"> 100 <ul type="disc"> 101 <li> 102 <p> 103 <code class="literal">DB_PRIORITY_VERY_LOW</code> 104 </p> 105 <p> 106 The lowest priority: pages are the most likely to be discarded. 107 </p> 108 </li> 109 <li> 110 <p> 111 <code class="literal">DB_PRIORITY_LOW</code> 112 </p> 113 <p> 114 The next lowest priority. 115 </p> 116 </li> 117 <li> 118 <p> 119 <code class="literal">DB_PRIORITY_DEFAULT</code> 120 </p> 121 <p> 122 The default priority. 123 </p> 124 </li> 125 <li> 126 <p> 127 <code class="literal">DB_PRIORITY_HIGH</code> 128 </p> 129 <p> 130 The next highest priority. 131 </p> 132 </li> 133 <li> 134 <p> 135 <code class="literal">DB_PRIORITY_VERY_HIGH</code> 136 </p> 137 <p> 138 The highest priority: pages are the least likely to be discarded. 139 </p> 140 </li> 141 </ul> 142 </div> 143 </div> 144 </div> 145 <div class="sect2" lang="en" xml:lang="en"> 146 <div class="titlepage"> 147 <div> 148 <div> 149 <h3 class="title"><a id="id1698059"></a>Class</h3> 150 </div> 151 </div> 152 </div> 153 <p> 154 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> 155 </p> 156 </div> 157 <div class="sect2" lang="en" xml:lang="en"> 158 <div class="titlepage"> 159 <div> 160 <div> 161 <h3 class="title"><a id="id1697901"></a>See Also</h3> 162 </div> 163 </div> 164 </div> 165 <p> 166 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 167 </p> 168 </div> 169 </div> 170 <div class="navfooter"> 171 <hr /> 172 <table width="100%" summary="Navigation footer"> 173 <tr> 174 <td width="40%" align="left"><a accesskey="p" href="mempset_pgcookie.html">Prev</a> </td> 175 <td width="20%" align="center"> 176 <a accesskey="u" href="memp.html">Up</a> 177 </td> 178 <td width="40%" align="right"> <a accesskey="n" href="mutex.html">Next</a></td> 179 </tr> 180 <tr> 181 <td width="40%" align="left" valign="top">DbMpoolFile::set_pgcookie() </td> 182 <td width="20%" align="center"> 183 <a accesskey="h" href="index.html">Home</a> 184 </td> 185 <td width="40%" align="right" valign="top"> Chapter 10. 186 Mutex Methods 187 </td> 188 </tr> 189 </table> 190 </div> 191 </body> 192</html> 193