Berkeley DB version 4.2.52

## com.sleepycat.db
Class DbMpoolFile

    java.lang.Object
      |
      +--com.sleepycat.db.DbMpoolFile

public class DbMpoolFile
extends Object

The memory pool interfaces for the Berkeley DB database environment are methods of the `DbEnv` handle. The `DbEnv` memory pool methods and the DbMpoolFile class provide general-purpose, page-oriented buffer management of files. Although designed to work with the other `Db` classes, they are also useful for more general purposes. The memory pools are referred to in this document as simply pools.

In the Berkeley DB Java API, the DbMpoolFile class provides a very limited set of operations. It is only intended to modify settings for a `Db` object using the `Db.get_mpf` method.

Method Summary
`int` `get_flags()` Deprecated. As of Berkeley DB 4.2, replaced by `getFlags()`
`long` `get_maxsize()` Deprecated. As of Berkeley DB 4.2, replaced by `getMaxsize()`
`int` `get_priority()` Deprecated. As of Berkeley DB 4.2, replaced by `getPriority()`
`int` `getFlags()` The DbMpoolFile.getFlags method returns the flags.
`long` `getMaxsize()` The DbMpoolFile.getMaxsize method returns the size of the cache in bytes.
`int` `getPriority()` The DbMpoolFile.getPriority method returns the cache priority.
`void` `set_flags(int flags, boolean onoff)` Deprecated. As of Berkeley DB 4.2, replaced by `setFlags(int,boolean)`
`void` `set_maxsize(long bytes)` Deprecated. As of Berkeley DB 4.2, replaced by `setMaxsize(long)`
`void` `set_priority(int priority)` Deprecated. As of Berkeley DB 4.2, replaced by `setPriority(int)`
`void` `setFlags(int flags, boolean onoff)` Configure a file in the cache.
`void` `setMaxsize(long bytes)` Set the maximum size for the file to be bytes bytes.
`void` `setPriority(int priority)` Set the cache priority for pages from the specified file.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### get_priority

    public int get_priority()
                     throws DbException

  Deprecated. As of Berkeley DB 4.2, replaced by `getPriority()`

    `DbException`

### getPriority

    public int getPriority()
                    throws DbException

  The DbMpoolFile.getPriority method returns the cache priority.

  The DbMpoolFile.getPriority method may be called at any time during the life of the application.

  Returns:
    The DbMpoolFile.getPriority method returns the cache priority.
  Throws:
    `DbException` - Signals that an exception of some sort has occurred.

### set_priority

    public void set_priority(int priority)
                      throws DbException

  Deprecated. As of Berkeley DB 4.2, replaced by `setPriority(int)`

    `DbException`

### setPriority

    public void setPriority(int priority)
                     throws DbException

  Set the cache priority for pages from the specified file. The priority of a page biases the replacement algorithm to be more or less likely to discard a page when space is needed in the buffer pool. The bias is temporary, and pages will eventually be discarded if they are not referenced again. The DbMpoolFile.setPriority method is only advisory, and does not guarantee pages will be treated in a specific way.

  To set the priority for the pages belonging to a particular database, call the DbMpoolFile.setPriority method using the `DbMpoolFile` handle returned by calling the `Db.get_mpf` method.

  The DbMpoolFile.setPriority method may be called at any time during the life of the application.

  Parameters:
    `priority` - must be set to one of the following values:
    - `Db.DB_PRIORITY_VERY_LOW`

      The lowest priority: pages are the most likely to be discarded.

    - `Db.DB_PRIORITY_LOW`

      The next lowest priority.

    - `Db.DB_PRIORITY_DEFAULT`

      The default priority.

    - `Db.DB_PRIORITY_HIGH`

      The next highest priority.

    - `Db.DB_PRIORITY_VERY_HIGH`

      The highest priority: pages are the least likely to be discarded.

  Throws:
    `DbException` - Signals that an exception of some sort has occurred.

### get_flags

    public int get_flags()
                  throws DbException

  Deprecated. As of Berkeley DB 4.2, replaced by `getFlags()`

    `DbException`

### getFlags

    public int getFlags()
                 throws DbException

  The DbMpoolFile.getFlags method returns the flags.

  The DbMpoolFile.getFlags method may be called at any time during the life of the application.

  Returns:
    The DbMpoolFile.getFlags method returns the flags.
  Throws:
    `DbException` - Signals that an exception of some sort has occurred.

### set_flags

    public void set_flags(int flags,
                          boolean onoff)
                   throws DbException

  Deprecated. As of Berkeley DB 4.2, replaced by `setFlags(int,boolean)`

    `DbException`

### setFlags

    public void setFlags(int flags,
                         boolean onoff)
                  throws DbException

  Configure a file in the cache.

  To set the flags for a particular database, call the DbMpoolFile.setFlags method using the `DbMpoolFile` handle stored in the mpf field of the `Db` handle.

  Parameters:
    `flags` - must be set by bitwise inclusively OR'ing together one or more of the following values:
    - `Db.DB_MPOOL_NOFILE`

      If set, no backing temporary file will be opened for in-memory databases, even if they expand to fill the entire cache. Attempts to create new file pages after the cache has been filled will fail.

      The `Db.DB_MPOOL_NOFILE` flag may be used to configure Berkeley DB at any time during the life of the application.

    `onoff` - If onoff is false, the specified flags are cleared; otherwise they are set.
  Throws:
    `DbException` - Signals that an exception of some sort has occurred.

### get_maxsize

    public long get_maxsize()
                     throws DbException

  Deprecated. As of Berkeley DB 4.2, replaced by `getMaxsize()`

    `DbException`

### getMaxsize

    public long getMaxsize()
                    throws DbException

  The DbMpoolFile.getMaxsize method returns the size of the cache in bytes.

  The DbMpoolFile.getMaxsize method may be called at any time during the life of the application.

  Returns:
    The DbMpoolFile.getMaxsize method returns the size of the cache in bytes.
  Throws:
    `DbException` - Signals that an exception of some sort has occurred.

### set_maxsize

    public void set_maxsize(long bytes)
                     throws DbException

  Deprecated. As of Berkeley DB 4.2, replaced by `setMaxsize(long)`

    `DbException`

### setMaxsize

    public void setMaxsize(long bytes)
                    throws DbException

  Set the maximum size for the file to be bytes bytes. Attempts to allocate new pages in the file after the limit has been reached will fail.

  To set the maximum file size for a particular database, call the DbMpoolFile.setMaxsize method using the `DbMpoolFile` handle stored in the mpf field of the `Db` handle. Attempts to insert new items into the database after the limit has been reached may fail.

  The DbMpoolFile.setMaxsize method may be called at any time during the life of the application.

  Parameters:
    `bytes` - The maximum size of the files in bytes.
  Throws:
    `DbException` - Signals that an exception of some sort has occurred.

Berkeley DB version 4.2.52

Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.