• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
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>Chapter 9.  The DbMpoolFile Handle</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="index.html" title="Berkeley DB C++ API Reference" />
11    <link rel="prev" href="logcompare.html" title="DbEnv::log_compare()" />
12    <link rel="next" href="dbget_mpf.html" title="Db::get_mpf()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Chapter 9. 
19              The  DbMpoolFile Handle
20        </th>
21        </tr>
22        <tr>
23          <td width="20%" align="left"><a accesskey="p" href="logcompare.html">Prev</a> </td>
24          <th width="60%" align="center"> </th>
25          <td width="20%" align="right"> <a accesskey="n" href="dbget_mpf.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="chapter" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title"><a id="memp"></a>Chapter 9. 
35              The  DbMpoolFile Handle
36        </h2>
37          </div>
38        </div>
39      </div>
40      <pre class="programlisting">#include &lt;db_cxx.h&gt;
41
42class DbMpoolFile { 
43public: 
44        DB_MPOOLFILE *DbMpoolFile::get_DB_MPOOLFILE(); 
45        const DB_MPOOLFILE *DbMpoolFile::get_const_DB_MPOOLFILE() const; ... 
46}; </pre>
47      <p>
48            The memory pool interfaces for the Berkeley DB database environment are methods of the
49            <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> handle. The 
50            <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> memory pool methods and the
51            <code class="classname">DB_MPOOLFILE</code> class provide general-purpose, page-oriented buffer
52            management of files. Although designed to work with the other 
53            <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a>classes, they are also useful for more general
54            purposes. The memory pools are referred to in this document as simply
55            <span class="emphasis"><em>the cache</em></span>.
56    </p>
57      <p>
58            The cache may be shared between processes. The cache is usually filled by pages from one or
59            more files. Pages in the cache are replaced in LRU (least-recently-used) order, with each
60            new page replacing the page that has been unused the longest. Pages retrieved from the
61            cache using <a class="xref" href="mempfget.html" title="DbMpoolFile::get()">DbMpoolFile::get()</a> are
62            <span class="emphasis"><em>pinned</em></span> in the cache until they are returned to the control of the
63            cache using the <a class="xref" href="mempput.html" title="DbMpoolFile::put()">DbMpoolFile::put()</a> method.
64    </p>
65      <p>
66            The <code class="classname">DbMpoolFile</code> object is the handle for a file in the 
67            cache. The handle is not free-threaded. Once the 
68            <a class="xref" href="mempfclose.html" title="DbMpoolFile::close()">DbMpoolFile::close()</a> method is called, the handle
69            may not be accessed again, regardless of that method's return.
70    </p>
71      <div class="sect1" lang="en" xml:lang="en">
72        <div class="titlepage">
73          <div>
74            <div>
75              <h2 class="title" style="clear: both"><a id="memplist"></a>Memory Pools and Related Methods</h2>
76            </div>
77          </div>
78        </div>
79        <div class="navtable">
80          <table border="1" width="80%">
81            <thead>
82              <tr>
83                <th>Memory Pools and Related Methods</th>
84                <th>Description</th>
85              </tr>
86            </thead>
87            <tbody>
88              <tr>
89                <td>
90                  <a class="xref" href="dbmemory.html" title="DbMemoryException">DbMemoryException</a>
91                </td>
92                <td>Exception class for insufficient memory</td>
93              </tr>
94              <tr>
95                <td>
96                  <a class="xref" href="dbget_mpf.html" title="Db::get_mpf()">Db::get_mpf()</a>
97                </td>
98                <td>Return the DbMpoolFile for a Db</td>
99              </tr>
100              <tr>
101                <td>
102                  <a class="xref" href="mempstat.html" title="DbEnv::memp_stat()">DbEnv::memp_stat()</a>
103                </td>
104                <td>Return cache statistics</td>
105              </tr>
106              <tr>
107                <td>
108                  <a class="xref" href="mempstat_print.html" title="DbEnv::memp_stat_print()">DbEnv::memp_stat_print()</a>
109                </td>
110                <td>Print cache statistics</td>
111              </tr>
112              <tr>
113                <td>
114                  <a class="xref" href="mempsync.html" title="DbEnv::memp_sync()">DbEnv::memp_sync()</a>
115                </td>
116                <td>Flush all pages from the cache</td>
117              </tr>
118              <tr>
119                <td>
120                  <a class="xref" href="memptrickle.html" title="DbEnv::memp_trickle()">DbEnv::memp_trickle()</a>
121                </td>
122                <td>Flush some pages from the cache</td>
123              </tr>
124              <tr>
125                <td colspan="2">
126                  <span class="bold">
127                    <strong>Memory Pool Configuration</strong>
128                  </span>
129                </td>
130              </tr>
131              <tr>
132                <td>
133                  <a class="xref" href="mempregister.html" title="DbEnv::memp_register()">DbEnv::memp_register()</a>
134                </td>
135                <td>Register a custom file type</td>
136              </tr>
137              <tr>
138                <td><a class="xref" href="envset_cache_max.html" title="DbEnv::set_cache_max()">DbEnv::set_cache_max()</a>, <a class="xref" href="envget_cache_max.html" title="DbEnv::get_cache_max()">DbEnv::get_cache_max()</a></td>
139                <td>Set/get the maximum cache size</td>
140              </tr>
141              <tr>
142                <td><a class="xref" href="envset_cachesize.html" title="DbEnv::set_cachesize()">DbEnv::set_cachesize()</a>, <a class="xref" href="envget_cachesize.html" title="DbEnv::get_cachesize()">DbEnv::get_cachesize()</a></td>
143                <td>Set/get the environment cache size</td>
144              </tr>
145              <tr>
146                <td><a class="xref" href="mempset_mp_max_openfd.html" title="DbEnv::set_mp_max_openfd()">DbEnv::set_mp_max_openfd()</a>, <a class="xref" href="mempget_mp_max_openfd.html" title="DbEnv::get_mp_max_openfd()">DbEnv::get_mp_max_openfd()</a></td>
147                <td>Set/get the maximum number of open file descriptors</td>
148              </tr>
149              <tr>
150                <td><a class="xref" href="mempset_mp_max_write.html" title="DbEnv::set_mp_max_write()">DbEnv::set_mp_max_write()</a>, <a class="xref" href="mempget_mp_max_write.html" title="DbEnv::get_mp_max_write()">DbEnv::get_mp_max_write()</a></td>
151                <td>Set/get the maximum number of sequential disk writes</td>
152              </tr>
153              <tr>
154                <td><a class="xref" href="envset_mp_mmapsize.html" title="DbEnv::set_mp_mmapsize()">DbEnv::set_mp_mmapsize()</a>, <a class="xref" href="envget_mp_mmapsize.html" title="DbEnv::get_mp_mmapsize()">DbEnv::get_mp_mmapsize()</a></td>
155                <td>Set/get maximum file size to memory map when opened read-only</td>
156              </tr>
157              <tr>
158                <td colspan="2">
159                  <span class="bold">
160                    <strong>Memory Pool Files</strong>
161                  </span>
162                </td>
163              </tr>
164              <tr>
165                <td>
166                  <a class="xref" href="mempfcreate.html" title="DbEnv::memp_fcreate()">DbEnv::memp_fcreate()</a>
167                </td>
168                <td>Create a memory pool file handle</td>
169              </tr>
170              <tr>
171                <td>
172                  <a class="xref" href="mempfclose.html" title="DbMpoolFile::close()">DbMpoolFile::close()</a>
173                </td>
174                <td>Close a file in the cache</td>
175              </tr>
176              <tr>
177                <td>
178                  <a class="xref" href="mempfget.html" title="DbMpoolFile::get()">DbMpoolFile::get()</a>
179                </td>
180                <td>Get page from a file in the cache</td>
181              </tr>
182              <tr>
183                <td>
184                  <a class="xref" href="mempfopen.html" title="DbMpoolFile::open()">DbMpoolFile::open()</a>
185                </td>
186                <td>Open a file in the cache</td>
187              </tr>
188              <tr>
189                <td>
190                  <a class="xref" href="mempput.html" title="DbMpoolFile::put()">DbMpoolFile::put()</a>
191                </td>
192                <td>Return a page to the cache</td>
193              </tr>
194              <tr>
195                <td>
196                  <a class="xref" href="mempfsync.html" title="DbMpoolFile::sync()">DbMpoolFile::sync()</a>
197                </td>
198                <td>Flush pages from a file from the cache</td>
199              </tr>
200              <tr>
201                <td colspan="2">
202                  <span class="bold">
203                    <strong>Memory Pool File Configuration</strong>
204                  </span>
205                </td>
206              </tr>
207              <tr>
208                <td><a class="xref" href="mempset_clear_len.html" title="DbMpoolFile::set_clear_len()">DbMpoolFile::set_clear_len()</a>, <a class="xref" href="mempget_clear_len.html" title="DbMpoolFile::get_clear_len()">DbMpoolFile::get_clear_len()</a></td>
209                <td>Set/get number of bytes to clear when creating a new page</td>
210              </tr>
211              <tr>
212                <td><a class="xref" href="mempset_fileid.html" title="DbMpoolFile::set_fileid()">DbMpoolFile::set_fileid()</a>, <a class="xref" href="mempget_fileid.html" title="DbMpoolFile::get_fileid()">DbMpoolFile::get_fileid()</a></td>
213                <td>Set/get file unique identifier</td>
214              </tr>
215              <tr>
216                <td><a class="xref" href="mempset_flags.html" title="DbMpoolFile::set_flags()">DbMpoolFile::set_flags()</a>, <a class="xref" href="mempget_flags.html" title="DbMpoolFile::get_flags()">DbMpoolFile::get_flags()</a></td>
217                <td>Set/get file options</td>
218              </tr>
219              <tr>
220                <td><a class="xref" href="mempset_ftype.html" title="DbMpoolFile::set_ftype()">DbMpoolFile::set_ftype()</a>, <a class="xref" href="mempget_ftype.html" title="DbMpoolFile::get_ftype()">DbMpoolFile::get_ftype()</a></td>
221                <td>Set/get file type</td>
222              </tr>
223              <tr>
224                <td><a class="xref" href="mempset_lsn_offset.html" title="DbMpoolFile::set_lsn_offset()">DbMpoolFile::set_lsn_offset()</a>, <a class="xref" href="mempget_lsn_offset.html" title="DbMpoolFile::get_lsn_offset()">DbMpoolFile::get_lsn_offset()</a></td>
225                <td>Set/get file log-sequence-number offset</td>
226              </tr>
227              <tr>
228                <td><a class="xref" href="mempset_maxsize.html" title="DbMpoolFile::set_maxsize()">DbMpoolFile::set_maxsize()</a>, <a class="xref" href="mempget_maxsize.html" title="DbMpoolFile::get_maxsize()">DbMpoolFile::get_maxsize()</a></td>
229                <td>Set/get maximum file size</td>
230              </tr>
231              <tr>
232                <td><a class="xref" href="mempset_pgcookie.html" title="DbMpoolFile::set_pgcookie()">DbMpoolFile::set_pgcookie()</a>, <a class="xref" href="mempget_pgcookie.html" title="DbMpoolFile::get_pgcookie()">DbMpoolFile::get_pgcookie()</a></td>
233                <td>Set/get file cookie for pgin/pgout</td>
234              </tr>
235              <tr>
236                <td><a class="xref" href="mempset_priority.html" title="DbMpoolFile::set_priority()">DbMpoolFile::set_priority()</a>, <a class="xref" href="mempget_priority.html" title="DbMpoolFile::get_priority()">DbMpoolFile::get_priority()</a></td>
237                <td>Set/get cache file priority</td>
238              </tr>
239            </tbody>
240          </table>
241        </div>
242      </div>
243    </div>
244    <div class="navfooter">
245      <hr />
246      <table width="100%" summary="Navigation footer">
247        <tr>
248          <td width="40%" align="left"><a accesskey="p" href="logcompare.html">Prev</a> </td>
249          <td width="20%" align="center"> </td>
250          <td width="40%" align="right"> <a accesskey="n" href="dbget_mpf.html">Next</a></td>
251        </tr>
252        <tr>
253          <td width="40%" align="left" valign="top">DbEnv::log_compare() </td>
254          <td width="20%" align="center">
255            <a accesskey="h" href="index.html">Home</a>
256          </td>
257          <td width="40%" align="right" valign="top"> Db::get_mpf()</td>
258        </tr>
259      </table>
260    </div>
261  </body>
262</html>
263