1<!--$Id: memp_set_priority.so,v 10.25 2007/05/22 18:06:06 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DB_MPOOLFILE->set_priority</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DB_MPOOLFILE->set_priority</b> 14</td> 15<td align=right> 16<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db.h> 23<p> 24int 25DB_MPOOLFILE->set_priority(DB_MPOOLFILE *mpf, DB_CACHE_PRIORITY priority); 26<p> 27int 28DB_MPOOLFILE->get_priority(DB_MPOOLFILE *mpf, DB_CACHE_PRIORITY *priorityp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DB_MPOOLFILE->set_priority</b> 32<!--$Id: dbc_set_priority.so,v 1.3 2007/05/22 18:06:05 bostic Exp $--> 33<p>Set the cache priority for pages referenced by the 34<a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> 35handle.</p> 36<p>The priority of a page biases the replacement algorithm to be more or 37less likely to discard a page when space is needed in the buffer pool. 38The bias is temporary, and pages will eventually be discarded if they 39are not referenced again. The DB_MPOOLFILE->set_priority method is only advisory, and does 40not guarantee pages will be treated in a specific way.</p> 41<p>To set the priority for the pages belonging to a particular database, 42call the DB_MPOOLFILE->set_priority method using the <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> handle 43returned by the <a href="../api_c/db_get_mpf.html">DB->get_mpf</a> method.</p> 44<p>The DB_MPOOLFILE->set_priority method configures a file in the memory pool, not only 45operations performed using the specified <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> handle.</p> 46<p>The DB_MPOOLFILE->set_priority method may be called at any time during the life of the 47application.</p> 48<p>The DB_MPOOLFILE->set_priority method 49returns a non-zero error value on failure 50and 0 on success. 51</p> 52<b>Parameters</b> <br> 53 <b>priority</b><ul compact><li>The <b>priority</b> parameter must be set to one of the following 54values: 55<br> 56<b><a name="DB_PRIORITY_VERY_LOW">DB_PRIORITY_VERY_LOW</a></b><ul compact><li>The lowest priority: pages are the most likely to be discarded.</ul> 57<b><a name="DB_PRIORITY_LOW">DB_PRIORITY_LOW</a></b><ul compact><li>The next lowest priority.</ul> 58<b><a name="DB_PRIORITY_DEFAULT">DB_PRIORITY_DEFAULT</a></b><ul compact><li>The default priority.</ul> 59<b><a name="DB_PRIORITY_HIGH">DB_PRIORITY_HIGH</a></b><ul compact><li>The next highest priority.</ul> 60<b><a name="DB_PRIORITY_VERY_HIGH">DB_PRIORITY_VERY_HIGH</a></b><ul compact><li>The highest priority: pages are the least likely to be discarded.</ul> 61<br></ul> 62<br> 63<hr size=1 noshade> 64<b>Description: DB_MPOOLFILE->get_priority</b> 65<p>The DB_MPOOLFILE->get_priority method returns the cache priority for the file referenced by the <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> handle.</p> 66<p>The DB_MPOOLFILE->get_priority method may be called at any time during the life of the 67application.</p> 68<p>The DB_MPOOLFILE->get_priority method 69returns a non-zero error value on failure 70and 0 on success. 71</p> 72<b>Parameters</b> <br> 73 <b>priorityp</b><ul compact><li>The DB_MPOOLFILE->get_priority method returns a reference to the 74cache priority for the file referenced by the <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> handle in <b>priorityp</b>.</ul> 75<br> 76<hr size=1 noshade> 77<br><b>Class</b> 78<a href="../api_c/env_class.html">DB_ENV</a>, <a href="../api_c/mempfile_class.html">DB_MPOOLFILE</a> 79<br><b>See Also</b> 80<a href="../api_c/memp_list.html">Memory Pools and Related Methods</a> 81</tt> 82<table width="100%"><tr><td><br></td><td align=right> 83<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 84</td></tr></table> 85<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 86</body> 87</html> 88