|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.db.DbMpoolFile
public class DbMpoolFile
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.
Field Summary | |
---|---|
protected boolean |
swigCMemOwn
|
Constructor Summary | |
---|---|
protected |
DbMpoolFile()
|
protected |
DbMpoolFile(long cPtr,
boolean cMemoryOwn)
|
Method Summary | |
---|---|
protected void |
delete()
|
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() |
protected static long |
getCPtr(DbMpoolFile obj)
|
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean swigCMemOwn
Constructor Detail |
---|
protected DbMpoolFile(long cPtr, boolean cMemoryOwn)
protected DbMpoolFile()
Method Detail |
---|
protected void delete()
protected static long getCPtr(DbMpoolFile obj)
public int get_priority() throws DbException
getPriority()
DbException
public int getPriority() throws DbException
The DbMpoolFile.getPriority method may be called at any time during the life of the application.
DbException
- Signals that an exception of some sort
has occurred.public void set_priority(int priority) throws DbException
setPriority(int)
DbException
public void setPriority(int priority) throws DbException
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.
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.
DbException
- Signals that an exception of some sort
has occurred.public int get_flags() throws DbException
getFlags()
DbException
public int getFlags() throws DbException
The DbMpoolFile.getFlags method may be called at any time during the life of the application.
DbException
- Signals that an exception of some sort
has occurred.public void set_flags(int flags, boolean onoff) throws DbException
setFlags(int,boolean)
DbException
public void setFlags(int flags, boolean onoff) throws DbException
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.
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.
DbException
- Signals that an exception of some sort
has occurred.public long get_maxsize() throws DbException
getMaxsize()
DbException
public long getMaxsize() throws DbException
The DbMpoolFile.getMaxsize method may be called at any time during the life of the application.
DbException
- Signals that an exception of some sort
has occurred.public void set_maxsize(long bytes) throws DbException
setMaxsize(long)
DbException
public void setMaxsize(long bytes) throws DbException
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.
bytes
- The maximum size of the files in bytes.
DbException
- Signals that an exception of some sort
has occurred.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |