head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.53.29; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.10; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.48.59; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.12.06.00.08.06; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.04.58; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @
DbEnv::memp_register |
![]() ![]() |
#include <db_cxx.h>extern "C" { typedef int (*pgin_fcn_type)(DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DBT *pgcookie); typedef int (*pgout_fcn_type)(DB_ENV *dbenv, db_pgno_t pgno, void *pgaddr, DBT *pgcookie); }; int DbEnv::memp_register(int ftype, pgin_fcn_type pgin_fcn, pgout_fcn_type pgout_fcn);
The DbEnv::memp_register method registers page-in and page-out functions for files of type ftype in the specified pool.
If the pgin_fcn function is non-NULL, it is called each time a page is read into the memory pool from a file of type ftype, or a page is created for a file of type ftype (see the DB_MPOOL_CREATE flag for the DbMpoolFile::get method).
If the pgout_fcn function is non-NULL, it is called each time a page is written to a file of type ftype.
Both the pgin_fcn and pgout_fcn functions are called with a reference to the current environment, the page number, a pointer to the page being read or written, and any argument pgcookie that was specified to the DbMpoolFile::open function when the file was opened. The pgin_fcn and pgout_fcn functions should return 0 on success, and an applicable non-zero errno value on failure, in which case the shared memory pool interface routine (and, by extension, any Berkeley DB library function) calling it will also fail, returning that errno value.
The purpose of the DbEnv::memp_register function is to support processing when pages are entered into, or flushed from, the pool. A file type must be specified to make it possible for unrelated threads or processes that are sharing a pool, to evict each other's pages from the pool. During initialization, applications should call DbEnv::memp_register for each type of file requiring input or output processing that will be sharing the underlying pool. (No registry is necessary for the standard Berkeley DB access method types because Db::open registers them separately.)
If a thread or process does not call DbEnv::memp_register for a file type, it is impossible for it to evict pages for any file requiring input or output processing from the pool. For this reason, DbEnv::memp_register should always be called by each application sharing a pool for each type of file included in the pool, regardless of whether or not the application itself uses files of that type.
There are no standard values for ftype, pgin_fcn, pgout_fcn, and pgcookie, except that the ftype value for a file must be a non-zero positive number because negative numbers are reserved for internal use by the Berkeley DB library. For this reason, applications sharing a pool must coordinate their values among themselves.
The DbEnv::memp_register method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.
The DbEnv::memp_register method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv::memp_register method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
![]() ![]() |
Copyright Sleepycat Software
@
1.1
log
@Initial revision
@
text
@d1 1
a1 1
@
1.1.1.1
log
@Import: RPM 4.0.3
@
text
@@
1.1.1.2
log
@Import: RPM 4.0.4
@
text
@d1 1
a1 1
d17 1
a17 1
d25 4
a28 4
typedef int (*pgin_fcn_type)(DB_ENV *dbenv,
db_pgno_t pgno, void *pgaddr, DBT *pgcookie);
typedef int (*pgout_fcn_type)(DB_ENV *dbenv,
db_pgno_t pgno, void *pgaddr, DBT *pgcookie);
d32 1
a32 1
pgin_fcn_type pgin_fcn, pgout_fcn_type pgout_fcn);
d43 5
a47 5
Both the pgin_fcn and pgout_fcn functions are called
with a reference to the current environment, the page number, a pointer
to the page being read or written, and any argument pgcookie
that was specified to the DbMpoolFile::set_pgcookie method. The
pgin_fcn and pgout_fcn functions should return 0 on
a84 1
DbEnv::memp_fcreate,
a91 5
DbMpoolFile::set_clear_len,
DbMpoolFile::set_fileid,
DbMpoolFile::set_ftype,
DbMpoolFile::set_lsn_offset,
DbMpoolFile::set_pgcookie,
d98 1
a98 1
@
1.1.1.3
log
@Import: RPM 4.0.5
@
text
@d1 2
a2 2
a3 1
d68 4
a71 4
value for a file must be a non-zero positive number less than 128
(0 and negative numbers are reserved for internal use by the Berkeley DB
library). For this reason, applications sharing a pool must coordinate
the values among themselves.
d76 4
a79 4
If a catastrophic error has occurred, the DbEnv::memp_register method may fail and
either return DB_RUNRECOVERY or throw a
DbRunRecoveryException,
in which case all subsequent Berkeley DB calls will fail in the same way.
d81 1
a81 1
DbEnv, DbMpoolFile
d83 19
a101 1
Memory Pools and Related Methods
@
1.1.1.4
log
@Import: RPM 4.1
@
text
@d1 2
a2 2
d4 1
d69 4
a72 4
value for a file must be a non-zero positive number because negative
numbers are reserved for internal use by the Berkeley DB library. For this
reason, applications sharing a pool must coordinate their values among
themselves.
d77 4
a80 4
If a catastrophic error has occurred, the DbEnv::memp_register method may fail and either
return DB_RUNRECOVERY or throw an exception encapsulating
DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail
in the same way.
d82 1
a82 1
DbEnv, DbMpoolFile
d84 1
a84 19
DbEnv::set_cachesize,
DbEnv::set_mp_mmapsize,
DbEnv::memp_fcreate,
DbMpoolFile::close,
DbMpoolFile::get,
DbMpoolFile::open,
DbMpoolFile::put,
DbMpoolFile::set,
DbMpoolFile::sync,
DbEnv::memp_register,
DbMpoolFile::set_clear_len,
DbMpoolFile::set_fileid,
DbMpoolFile::set_ftype,
DbMpoolFile::set_lsn_offset,
DbMpoolFile::set_pgcookie,
DbEnv::memp_stat,
DbEnv::memp_sync,
and
DbEnv::memp_trickle.
@
1.1.1.5
log
@Import: RPM 4.1.1
@
text
@d1 2
a2 2
a3 1
d68 4
a71 4
value for a file must be a non-zero positive number less than 128
(0 and negative numbers are reserved for internal use by the Berkeley DB
library). For this reason, applications sharing a pool must coordinate
the values among themselves.
d76 4
a79 4
If a catastrophic error has occurred, the DbEnv::memp_register method may fail and
either return DB_RUNRECOVERY or throw a
DbRunRecoveryException,
in which case all subsequent Berkeley DB calls will fail in the same way.
d81 1
a81 1
DbEnv, DbMpoolFile
d83 19
a101 1
Memory Pools and Related Methods
@