| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 
 | <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Chapter 9.  The DbMpoolFile Handle</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
    <link rel="up" href="index.html" title="Berkeley DB C++ API Reference" />
    <link rel="prev" href="logcompare.html" title="DbEnv::log_compare()" />
    <link rel="next" href="dbget_mpf.html" title="Db::get_mpf()" />
  </head>
  <body>
    <div xmlns="" class="navheader">
      <div class="libver">
        <p>Library Version 11.2.5.3</p>
      </div>
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">Chapter 9. 
              The  DbMpoolFile Handle
        </th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="logcompare.html">Prev</a> </td>
          <th width="60%" align="center"> </th>
          <td width="20%" align="right"> <a accesskey="n" href="dbget_mpf.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="chapter" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title"><a id="memp"></a>Chapter 9. 
              The  DbMpoolFile Handle
        </h2>
          </div>
        </div>
      </div>
      <pre class="programlisting">#include <db_cxx.h>
class DbMpoolFile { 
public: 
        DB_MPOOLFILE *DbMpoolFile::get_DB_MPOOLFILE(); 
        const DB_MPOOLFILE *DbMpoolFile::get_const_DB_MPOOLFILE() const; 
        ... 
}; </pre>
      <p>
            The memory pool interfaces for the Berkeley DB database environment are methods of the
            <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> handle. The 
            <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> memory pool methods and the
            <code class="classname">DB_MPOOLFILE</code> class provide general-purpose, page-oriented buffer
            management of files. Although designed to work with the other 
            <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a>classes, they are also useful for more general
            purposes. The memory pools are referred to in this document as simply
            <span class="emphasis"><em>the cache</em></span>.
    </p>
      <p>
            The cache may be shared between processes. The cache is usually filled by pages from one or
            more files. Pages in the cache are replaced in LRU (least-recently-used) order, with each
            new page replacing the page that has been unused the longest. Pages retrieved from the
            cache using <a class="xref" href="mempfget.html" title="DbMpoolFile::get()">DbMpoolFile::get()</a> are
            <span class="emphasis"><em>pinned</em></span> in the cache until they are returned to the control of the
            cache using the <a class="xref" href="mempput.html" title="DbMpoolFile::put()">DbMpoolFile::put()</a> method.
    </p>
      <p>
            The <code class="classname">DbMpoolFile</code> object is the handle for a file in the 
            cache. The handle is not free-threaded. Once the 
            <a class="xref" href="mempfclose.html" title="DbMpoolFile::close()">DbMpoolFile::close()</a> method is called, the handle
            may not be accessed again, regardless of that method's return.
    </p>
      <div class="sect1" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h2 class="title" style="clear: both"><a id="memplist"></a>Memory Pools and Related Methods</h2>
            </div>
          </div>
        </div>
        <div class="navtable">
          <table border="1" width="80%">
            <thead>
              <tr>
                <th>Memory Pools and Related Methods</th>
                <th>Description</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td>
                  <a class="xref" href="dbmemory.html" title="DbMemoryException">DbMemoryException</a>
                </td>
                <td>Exception class for insufficient memory</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="dbget_mpf.html" title="Db::get_mpf()">Db::get_mpf()</a>
                </td>
                <td>Return the DbMpoolFile for a Db</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempstat.html" title="DbEnv::memp_stat()">DbEnv::memp_stat()</a>
                </td>
                <td>Return cache statistics</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempstat_print.html" title="DbEnv::memp_stat_print()">DbEnv::memp_stat_print()</a>
                </td>
                <td>Print cache statistics</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempsync.html" title="DbEnv::memp_sync()">DbEnv::memp_sync()</a>
                </td>
                <td>Flush all pages from the cache</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="memptrickle.html" title="DbEnv::memp_trickle()">DbEnv::memp_trickle()</a>
                </td>
                <td>Flush some pages from the cache</td>
              </tr>
              <tr>
                <td colspan="2">
                  <span class="bold">
                    <strong>Memory Pool Configuration</strong>
                  </span>
                </td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempregister.html" title="DbEnv::memp_register()">DbEnv::memp_register()</a>
                </td>
                <td>Register a custom file type</td>
              </tr>
              <tr>
                <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>
                <td>Set/get the maximum cache size</td>
              </tr>
              <tr>
                <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>
                <td>Set/get the environment cache size</td>
              </tr>
              <tr>
                <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>
                <td>Set/get the maximum number of open file descriptors</td>
              </tr>
              <tr>
                <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>
                <td>Set/get the maximum number of sequential disk writes</td>
              </tr>
              <tr>
                <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>
                <td>Set/get maximum file size to memory map when opened read-only</td>
              </tr>
              <tr>
                <td><a class="xref" href="envset_mp_mtxcount.html" title="DbEnv::set_mp_mtxcount()">DbEnv::set_mp_mtxcount()</a>, <a class="xref" href="envget_mp_mtxcount.html" title="DbEnv::get_mp_mtxcount()">DbEnv::get_mp_mtxcount()</a></td>
                <td>Set/get the number of mutexes allocated to the hash table</td>
              </tr>
              <tr>
                <td><a class="xref" href="envset_mp_pagesize.html" title="DbEnv::set_mp_pagesize()">DbEnv::set_mp_pagesize()</a>, <a class="xref" href="envget_mp_pagesize.html" title="DbEnv::get_mp_pagesize()">DbEnv::get_mp_pagesize()</a></td>
                <td>Set/get page size to configure the buffer pool</td>
              </tr>
              <tr>
                <td><a class="xref" href="envset_mp_tablesize.html" title="DbEnv::set_mp_tablesize()">DbEnv::set_mp_tablesize()</a>, <a class="xref" href="envget_mp_tablesize.html" title="DbEnv::get_mp_tablesize()">DbEnv::get_mp_tablesize()</a></td>
                <td>Set/get the hash table size</td>
              </tr>
              <tr>
                <td colspan="2">
                  <span class="bold">
                    <strong>Memory Pool Files</strong>
                  </span>
                </td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempfcreate.html" title="DbEnv::memp_fcreate()">DbEnv::memp_fcreate()</a>
                </td>
                <td>Create a memory pool file handle</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempfclose.html" title="DbMpoolFile::close()">DbMpoolFile::close()</a>
                </td>
                <td>Close a file in the cache</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempfget.html" title="DbMpoolFile::get()">DbMpoolFile::get()</a>
                </td>
                <td>Get page from a file in the cache</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempfopen.html" title="DbMpoolFile::open()">DbMpoolFile::open()</a>
                </td>
                <td>Open a file in the cache</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempput.html" title="DbMpoolFile::put()">DbMpoolFile::put()</a>
                </td>
                <td>Return a page to the cache</td>
              </tr>
              <tr>
                <td>
                  <a class="xref" href="mempfsync.html" title="DbMpoolFile::sync()">DbMpoolFile::sync()</a>
                </td>
                <td>Flush pages from a file from the cache</td>
              </tr>
              <tr>
                <td colspan="2">
                  <span class="bold">
                    <strong>Memory Pool File Configuration</strong>
                  </span>
                </td>
              </tr>
              <tr>
                <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>
                <td>Set/get number of bytes to clear when creating a new page</td>
              </tr>
              <tr>
                <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>
                <td>Set/get file unique identifier</td>
              </tr>
              <tr>
                <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>
                <td>Set/get file options</td>
              </tr>
              <tr>
                <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>
                <td>Set/get file type</td>
              </tr>
              <tr>
                <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>
                <td>Set/get file log-sequence-number offset</td>
              </tr>
              <tr>
                <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>
                <td>Set/get maximum file size</td>
              </tr>
              <tr>
                <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>
                <td>Set/get file cookie for pgin/pgout</td>
              </tr>
              <tr>
                <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>
                <td>Set/get cache file priority</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="logcompare.html">Prev</a> </td>
          <td width="20%" align="center"> </td>
          <td width="40%" align="right"> <a accesskey="n" href="dbget_mpf.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">DbEnv::log_compare() </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> Db::get_mpf()</td>
        </tr>
      </table>
    </div>
  </body>
</html>
 |