/* * ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version: 1.3.19 * * Do not make changes to this file unless you know what you are doing--modify * the SWIG interface file instead. * ----------------------------------------------------------------------------- */ package com.sleepycat.db; /** * The memory pool interfaces for the Berkeley DB database * environment are methods of the {@link com.sleepycat.db.DbEnv * DbEnv} handle. The {@link com.sleepycat.db.DbEnv DbEnv} memory * pool methods and the DbMpoolFile class provide general-purpose, * page-oriented buffer management of files. Although designed to * work with the other {@link com.sleepycat.db.Db 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 {@link com.sleepycat.db.Db Db} object using the {@link * com.sleepycat.db.Db#get_mpf Db.get_mpf} method.

*/ public class DbMpoolFile { private long swigCPtr; protected boolean swigCMemOwn; protected DbMpoolFile(long cPtr, boolean cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = cPtr; } protected DbMpoolFile() { this(0, false); } protected void delete() { if (swigCPtr != 0 && swigCMemOwn) { swigCMemOwn = false; } swigCPtr = 0; } protected static long getCPtr(DbMpoolFile obj) { return (obj == null) ? 0 : obj.swigCPtr; } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #getPriority()} */ public int get_priority() throws DbException { return getPriority(); } /** * The DbMpoolFile.getPriority method returns the cache priority. *

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

* * @throws DbException Signals that an exception of some sort * has occurred. * @return The DbMpoolFile.getPriority method * returns the cache priority.

*/ public int getPriority() throws DbException { return db_javaJNI.DbMpoolFile_get_priority(swigCPtr); } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #setPriority(int)} */ public void set_priority(int priority) throws DbException { setPriority(priority); } /** * 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 * {@link com.sleepycat.db.DbMpoolFile DbMpoolFile} handle * returned by calling the {@link com.sleepycat.db.Db#get_mpf * Db.get_mpf} method.

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

* * @param priority must be set to one of the following * values: * * * * * * * * * * * @throws DbException Signals that an exception of some sort * has occurred. */ public void setPriority(int priority) throws DbException { db_javaJNI.DbMpoolFile_set_priority(swigCPtr, priority); } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #getFlags()} */ public int get_flags() throws DbException { return getFlags(); } /** * The DbMpoolFile.getFlags method returns the flags.

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

* * @throws DbException Signals that an exception of some sort * has occurred. * @return The DbMpoolFile.getFlags method returns * the flags.

*/ public int getFlags() throws DbException { return db_javaJNI.DbMpoolFile_get_flags(swigCPtr); } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #setFlags(int,boolean)} */ public void set_flags(int flags, boolean onoff) throws DbException { setFlags(flags, onoff); } /** * Configure a file in the cache.

* * To set the flags for a particular database, call the * DbMpoolFile.setFlags method using the {@link * com.sleepycat.db.DbMpoolFile DbMpoolFile} handle stored in the * mpf field of the {@link com.sleepycat.db.Db Db} handle. *

* * @param flags must be set by bitwise inclusively OR * 'ing together one or more of the following values: * * * * @param 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. */ public void setFlags(int flags, boolean onoff) throws DbException { db_javaJNI.DbMpoolFile_set_flags(swigCPtr, flags, onoff); } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #getMaxsize()} */ public long get_maxsize() throws DbException { return getMaxsize(); } /** * 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.

* * @throws DbException Signals that an exception of some sort * has occurred. * @return The DbMpoolFile.getMaxsize method returns * the size of the cache in bytes.

*/ public long getMaxsize() throws DbException { return db_javaJNI.DbMpoolFile_get_maxsize(swigCPtr); } /** * @deprecated As of Berkeley DB 4.2, replaced by {@link * #setMaxsize(long)} */ public void set_maxsize(long bytes) throws DbException { setMaxsize(bytes); } /** * 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 {@link * com.sleepycat.db.DbMpoolFile DbMpoolFile} handle stored in the * mpf field of the {@link com.sleepycat.db.Db 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.

* * @param bytes The maximum size of the files in bytes. * @throws DbException Signals that an exception of some sort * has occurred. */ public void setMaxsize(long bytes) throws DbException { db_javaJNI.DbMpoolFile_set_maxsize(swigCPtr, bytes); } }