# DbMpool

           import com.sleepycat.db.*;

           public DbMpoolStat stat()
                throws DbException;

           public DbMpoolFStat[] fstat()
                throws DbException;

           public int trickle(int pct)
                throws DbException;

## DESCRIPTION

           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 db_intro(3).

           This manual page describes the  specific  details  of  the
           memory pool interface.

           The  DbMpool(3) 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 DbException(3) 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  DbException(3)  that
           encapsulates an errno on failure.

## ENVIRONMENT VARIABLES

           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 db_appinit(3).

           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.

## ERRORS

           The  DbMpool.trickle  method  may   fail   and   throw   a
           DbException(3)  for  any  of  the errors specified for the
           following DB and library functions: DBmemp->pgin(3),
           DBmemp->pgout(3), DbLog.compare(3), DbLog.flush(3),
           close(2), fcntl(2), fflush(3), fsync(2), lseek(2),
           malloc(3), memcmp(3), memcpy(3), memset(3), mmap(2),
           open(2), sigfillset(3), sigprocmask(2), stat(2),
           strcpy(3), strdup(3), strerror(3), strlen(3), time(3),
           unlink(2), and write(2).

           In addition, the DbMpool.trickle method may fail and throw
           a  DbException(3) 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
           DbException(3)  for  any  of  the errors specified for the
           following DB and library functions: fcntl(2), malloc(3),
           memcpy(3), and strlen(3).

## SEE ALSO

           db_archive(1), db_checkpoint(1), db_deadlock(1), db_dump(1),
           db_load(1), db_recover(1), db_stat(1), db_intro(3),
           db_internal(3), db_thread(3), Db(3), Dbc(3), DbEnv(3),
           DbException(3), DbInfo(3), DbLock(3), DbLockTab(3), DbLog(3),
           DbLsn(3), DbMpool(3), Dbt(3), DbTxn(3), DbTxnMgr(3)