gecko-dev/db/man/man.html/DbMpool.j.html
1998-10-15 03:56:37 +00:00

206 lines
9.3 KiB
HTML

<HTML>
<HEAD>
<TITLE>DbMpool</TITLE>
</HEAD>
<BODY BGCOLOR=white>
<H1>DbMpool</H1>
<HR SIZE=1 NOSHADE>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->
<B>import</B> <B>com.sleepycat.db.*;</B>
<B>public</B> <B>DbMpoolStat</B> <B>stat()</B>
<B>throws</B> <B>DbException;</B>
<B>public</B> <B>DbMpoolFStat[]</B> <B>fstat()</B>
<B>throws</B> <B>DbException;</B>
<B>public</B> <B>int</B> <B>trickle(int</B> <B>pct)</B>
<B>throws</B> <B>DbException;</B>
</PRE>
<H2>DESCRIPTION</H2><PRE>
The DB library is a family of classes that provides a
modular programming interface to transactions and record-
oriented file access. The library includes support for
transactions, locking, logging and file page caching, as
well as various indexed access methods. Many of the
classes (e.g., the file page caching class) are useful
independent of the other DB classes, although some classes
are explicitly based on other classes (e.g., transactions
and logging). For a general description of the DB
package, see <B><A HREF="db_intro.html">db_intro(3)</A></B>.
This manual page describes the specific details of the
memory pool interface.
The <B><A HREF="DbMpool.j.html">DbMpool(3)</A></B> class is the library interface intended to
provide general-purpose, page-oriented buffer management
of one or more files. While designed to work with the
other Db classes, this class is also useful for more
general purposes. The memory pools (DbMpool's) are
referred to in this document as simply ``pools''. The
DbMpool class has a small subset of the corresponding
DB/C++ functionality. This class has been provided to
allow certain administrative actions on underlying Mpool's
opened as a consequence of DbEnv.appinit(). Direct access
to other Mpool functionality is not appropriate for the
Java environment.
DbMpool.trickle
The DbMpool.trickle method ensures that at least pct
percent of the pages in the shared memory pool are clean
by writing dirty pages to their backing files. The number
of pages that were written to reach the correct percentage
is returned.
The purpose of the DbMpool.trickle method is to enable a
memory pool manager to ensure that a page is always
available for reading in new information without having to
wait for a write.
The DbMpool.trickle method throws a <B><A HREF="DbException.j.html">DbException(3)</A></B> that
encapsulates an errno on failure.
DbMpool.stat
DbMpool.fstat
The DbMpool.stat and DbMpool.fstat methods create
statistical structures and return to the caller. The
statistics include the number of files participating in
the pool, the active pages in the pool, and information as
to how effective the cache has been.
The stat method creates a DbMpoolStat object containing
global statistics. The fields can be accessed via
methods:
long get_st_cachesize();
Cache size in bytes.
int get_st_cache_hit();
Requested pages found in the cache.
int get_st_cache_miss();
Requested pages not found in the cache.
int get_st_map();
Requested pages mapped into the process' address
space (there is no available information as to
whether or not this request caused disk I/O, although
examining the application page fault rate may be
helpful).
int get_st_page_create();
Pages created in the cache.
int get_st_page_in();
Pages read into the cache.
int get_st_page_out();
Pages written from the cache to the backing file.
int get_st_ro_evict();
Clean pages forced from the cache.
int get_st_rw_evict();
Dirty pages forced from the cache.
int get_st_hash_buckets();
Number of hash buckets in buffer hash table.
int get_st_hash_searches();
Total number of buffer hash table lookups.
int get_st_hash_longest();
The longest chain ever encountered in buffer hash
table lookups.
int get_st_hash_examined();
Total number of hash elements traversed during hash
table lookups.
int get_st_page_clean();
Clean pages currently in the cache.
int get_st_page_dirty();
Dirty pages currently in the cache.
int get_st_page_trickle();
Dirty pages written using the memp_trickle interface.
The fstat method creates an array of DbMpoolFStat objects
containing statistics for individual files in the pool.
Each DbMpoolFStat object contains statistics for an
individual DbMpoolFile, and the statistics can be accessed
via methods:
String get_file_name();
The name of the file.
long get_st_pagesize();
Page size in bytes.
int get_st_cache_hit();
Requested pages found in the cache.
int get_st_cache_miss();
Requested pages not found in the cache.
int get_st_map();
Requested pages mapped into the process' address
space.
int get_st_page_create();
Pages created in the cache.
int get_st_page_in();
Pages read into the cache.
int get_st_page_out();
Pages written from the cache to the backing file.
The DbMpool.stat method throws a <B><A HREF="DbException.j.html">DbException(3)</A></B> that
encapsulates an errno on failure.
</PRE>
<H2>ENVIRONMENT VARIABLES</H2><PRE>
The following environment variables affect the behavior of
DbMpoolFile:
DB_HOME
If the dbenv argument to DbMpool.open was initialized
using db_appinit, the environment variable DB_HOME
may be used as the path of the database home for the
interpretation of the dir argument to DbMpool.open,
as described in <B><A HREF="db_appinit.html">db_appinit(3)</A></B>.
TMPDIR
If the dbenv argument to DbMpool.open was null or not
initialized using db_appinit, the environment
variable TMPDIR may be used as the directory in which
to create the memory pool, as described in the
DbMpool.open section above.
</PRE>
<H2>ERRORS</H2><PRE>
The DbMpool.trickle method may fail and throw a
<B><A HREF="DbException.j.html">DbException(3)</A></B> for any of the errors specified for the
following DB and library functions: <B><A HREF="db_mpool.html">DBmemp-&gt;pgin(3)</A></B>,
<B><A HREF="db_mpool.html">DBmemp-&gt;pgout(3)</A></B>, <B><A HREF="DbLog.j.html">DbLog.compare(3)</A></B>, <B><A HREF="DbLog.j.html">DbLog.flush(3)</A></B>,
<B>close(2)</B>, <B>fcntl(2)</B>, <B>fflush(3)</B>, <B>fsync(2)</B>, <B>lseek(2)</B>,
<B>malloc(3)</B>, <B>memcmp(3)</B>, <B>memcpy(3)</B>, <B>memset(3)</B>, <B>mmap(2)</B>,
<B>open(2)</B>, <B>sigfillset(3)</B>, <B>sigprocmask(2)</B>, <B>stat(2)</B>,
<B>strcpy(3)</B>, <B>strdup(3)</B>, <B>strerror(3)</B>, <B>strlen(3)</B>, <B>time(3)</B>,
<B>unlink(2)</B>, and <B>write(2)</B>.
In addition, the DbMpool.trickle method may fail and throw
a <B><A HREF="DbException.j.html">DbException(3)</A></B> encapsulating an errno for the following
conditions:
[EINVAL]
An invalid flag value or parameter was specified.
The DbMpool.stat method may fail and throw a
<B><A HREF="DbException.j.html">DbException(3)</A></B> for any of the errors specified for the
following DB and library functions: <B>fcntl(2)</B>, <B>malloc(3)</B>,
<B>memcpy(3)</B>, and <B>strlen(3)</B>.
</PRE>
<H2>SEE ALSO</H2><PRE>
<B><A HREF="db_archive.html">db_archive(1)</A></B>, <B><A HREF="db_checkpoint.html">db_checkpoint(1)</A></B>, <B><A HREF="db_deadlock.html">db_deadlock(1)</A></B>, <B><A HREF="db_dump.html">db_dump(1)</A></B>,
<B><A HREF="db_load.html">db_load(1)</A></B>, <B><A HREF="db_recover.html">db_recover(1)</A></B>, <B><A HREF="db_stat.html">db_stat(1)</A></B>, <B><A HREF="db_intro.html">db_intro(3)</A></B>,
<B><A HREF="db_internal.html">db_internal(3)</A></B>, <B><A HREF="db_thread.html">db_thread(3)</A></B>, <B><A HREF="Db.j.html">Db(3)</A></B>, <B><A HREF="Dbc.j.html">Dbc(3)</A></B>, <B><A HREF="DbEnv.j.html">DbEnv(3)</A></B>,
<B><A HREF="DbException.j.html">DbException(3)</A></B>, <B><A HREF="DbInfo.j.html">DbInfo(3)</A></B>, <B><A HREF="DbLock.j.html">DbLock(3)</A></B>, <B><A HREF="DbLockTab.j.html">DbLockTab(3)</A></B>, <B><A HREF="DbLog.j.html">DbLog(3)</A></B>,
<B><A HREF="DbLsn.j.html">DbLsn(3)</A></B>, <B><A HREF="DbMpool.j.html">DbMpool(3)</A></B>, <B><A HREF="Dbt.j.html">Dbt(3)</A></B>, <B><A HREF="DbTxn.j.html">DbTxn(3)</A></B>, <B><A HREF="DbTxnMgr.j.html">DbTxnMgr(3)</A></B>
</PRE>
<HR SIZE=1 NOSHADE>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>