Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

28
docs_src/memp/Makefile Normal file
View File

@@ -0,0 +1,28 @@
# $Id: Makefile,v 1.12 2007/07/06 23:08:01 mjc Exp $
COMMON= env_set_cache_max.html \
env_set_mp_mmapsize.html \
memp_fclose.html \
memp_fcreate.html \
memp_fget.html \
memp_fopen.html \
memp_fput.html \
memp_fsync.html \
memp_list.html \
memp_maxwrite.html \
memp_openfd.html \
memp_register.html \
memp_set_clear_len.html \
memp_set_fileid.html \
memp_set_flags.html \
memp_set_ftype.html \
memp_set_lsn_offset.html \
memp_set_maxsize.html \
memp_set_pgcookie.html \
memp_set_priority.html \
memp_stat.html \
memp_sync.html \
memp_trickle.html \
mempfile_class.html
CXX= memp_class.html

View File

@@ -0,0 +1,62 @@
m4_comment([$Id: env_set_cache_max.so,v 1.2 2007/07/07 14:40:15 bostic Exp $])
define(M4PAGELOCAL, [dbenv_set_cache_max, dbenv_get_cache_max])
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbenv_set_cache_max),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__set_cache_max(DB_ENV *dbenv, u_int32_t gbytes, u_int32_t bytes);
m4_blank
int
DB_ENV-__GT__get_cache_max(DB_ENV *dbenv, u_int32_t *gbytesp, u_int32_t *bytesp);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::set_cache_max(u_int32_t gbytes, u_int32_t bytes);
m4_blank
int
DbEnv::get_cache_max(u_int32_t *gbytesp, u_int32_t *bytesp);
]))
m4_p([dnl
The m4_refT(dbenv_set_cache_max) sets the maximum cache size, in bytes.
The specified size is rounded to the nearest multiple of the cache
region size, which is the initial cache size divided by the number of
regions specified to the m4_refT(dbenv_set_cachesize). If no value is
specified, it defaults to the initial cache size.])
m4_env_config(dbenv_set_cache_max,
[maximum cache size], set_cache_max, [the size in bytes])
m4_scope_env(dbenv_set_cache_max)
m4_when_any(dbenv_set_cache_max)
m4_return(dbenv_set_cache_max, std)
m4_parambegin
m4_param(mp_mmapsize, [dnl
The m4_arg(mp_mmapsize) parameter is the maximum file size, in bytes,
for a file to be mapped into the process address space.])
m4_paramend
m4_err(dbenv_set_cache_max,
einval, [the method was called after m4_ref(dbenv_open) was called])
m4_pf_description(m4_ref(dbenv_get_cache_max))
m4_p([dnl
The m4_refT(dbenv_get_cache_max) returns the maximum size of the cache.])
m4_when_any(dbenv_get_cache_max)
m4_return(dbenv_get_cache_max, std)
m4_parambegin
m4_param_co(bytesp, additional bytes of memory in the cache)
m4_param_co(gbytesp, gigabytes of memory in the cache)
m4_paramend
m4_seealso(DbEnv, DbMpool)
m4_page_footer

View File

@@ -0,0 +1,58 @@
m4_comment([$Id: env_set_mp_mmapsize.so,v 10.40 2004/09/28 15:04:21 bostic Exp $])
define(M4PAGELOCAL, [dbenv_set_mp_mmapsize, dbenv_get_mp_mmapsize])
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbenv_set_mp_mmapsize),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__set_mp_mmapsize(DB_ENV *dbenv, size_t mp_mmapsize);
m4_blank
int
DB_ENV-__GT__get_mp_mmapsize(DB_ENV *dbenv, size_t *mp_mmapsizep);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::set_mp_mmapsize(size_t mp_mmapsize);
m4_blank
int
DbEnv::get_mp_mmapsize(size_t *mp_mmapsizep);
]))
m4_p([dnl
Files that are opened read-only in the pool (and that satisfy a few
other criteria) are, by default, mapped into the process address space
instead of being copied into the local cache. This can result in
better-than-usual performance because available virtual memory is
normally much larger than the local cache, and page faults are faster
than page copying on many systems. However, it can cause resource
starvation in the presence of limited virtual memory, and it can result
in immense process sizes in the presence of large databases.])
m4_p([dnl
The m4_refT(dbenv_get_mp_mmapsize) sets the maximum file size, in bytes,
for a file to be mapped into the process address space. If no value is
specified, it defaults to 10MB.])
m4_env_config(dbenv_set_mp_mmapsize,
[maximum mapped file size], set_mp_mmapsize, [the size in bytes])
m4_scope_env(dbenv_set_mp_mmapsize)
m4_when_any(dbenv_set_mp_mmapsize)
m4_return(dbenv_set_mp_mmapsize, std)
m4_parambegin
m4_param(mp_mmapsize, [dnl
The m4_arg(mp_mmapsize) parameter is the maximum file size, in bytes,
for a file to be mapped into the process address space.])
m4_paramend
m4_err(dbenv_set_mp_mmapsize,
einval, [the method was called after m4_ref(dbenv_open) was called])
m4_pf_getter(dbenv_get_mp_mmapsize, maximum file map size,, mp_mmapsizep)
m4_seealso(DbMpool)
m4_page_footer

39
docs_src/memp/m4.methods Normal file
View File

@@ -0,0 +1,39 @@
m4_comment([$Id: m4.methods,v 1.11 2007/07/06 00:22:53 mjc Exp $])
m4_table_begin(, _center)
m4_table_header(Memory Pools and Related Methods, Description)
m4_comment([Db::mpf])m4_table_element(m4_ref(dbh_get_mpf), Return m4_ref(Db)'s underlying m4_ref(DbMpoolFile) handle)
m4_comment([DbEnv::memp_stat])m4_table_element(m4_ref(memp_stat), Return memory pool statistics)
m4_comment([DbEnv::memp_sync])m4_table_element(m4_ref(memp_sync), Flush pages from a memory pool)
m4_comment([DbEnv::memp_trickle])m4_table_element(m4_ref(memp_trickle), Trickle flush pages from a memory pool)
m4_comment([DbMemoryException])ifelse(M4API, CXX_API, [m4_table_element(m4_ref(DbMemoryException), Insufficient memory exception)])
m4_table_header(Memory Pool Configuration, _empty)
m4_comment([DbEnv::memp_register])m4_table_element(m4_ref(memp_register), Register input/output functions for a file in a memory pool)
m4_comment([DbEnv::set_cachesize])m4_table_element(m4_ref(dbenv_set_cachesize), Set the environment cache size)
m4_comment([DbEnv::set_cache_max])m4_table_element(m4_ref(dbenv_set_cache_max), Set the maximum cache size)
m4_comment([DbEnv::set_mp_max_openfd])m4_table_element(m4_ref(memp_set_max_openfd), Set the maximum number of open file descriptors)
m4_comment([DbEnv::set_mp_max_write])m4_table_element(m4_ref(memp_set_max_write), Set the maximum number of sequential disk writes)
m4_comment([DbEnv::set_mp_mmapsize])m4_table_element(m4_ref(dbenv_set_mp_mmapsize), Set maximum mapped-in database file size)
m4_table_header(Memory Pool Files, _empty)
m4_comment([DbEnv::memp_fcreate])m4_table_element(m4_ref(memp_fcreate), Create a memory pool file handle)
m4_comment([DbMpoolFile::])ifelse(M4API, CXX_API, [m4_table_element(m4_ref(DbMpoolFile), Memory pool file object)])
m4_comment([DbMpoolFile::close])m4_table_element(m4_ref(memp_fclose), Close a file in a memory pool)
m4_comment([DbMpoolFile::get])m4_table_element(m4_ref(memp_fget), Get page from a file in a memory pool)
m4_comment([DbMpoolFile::open])m4_table_element(m4_ref(memp_fopen), Open a file in a memory pool)
m4_comment([DbMpoolFile::put])m4_table_element(m4_ref(memp_fput), Return a page to a memory pool)
m4_comment([DbMpoolFile::sync])m4_table_element(m4_ref(memp_fsync), Flush pages from a file in a memory pool)
m4_table_header(Memory Pool File Configuration, _empty)
m4_comment([DbMpoolFile::set_clear_len])m4_table_element(m4_ref(memp_set_clear_len), Set file page bytes to be cleared)
m4_comment([DbMpoolFile::set_fileid])m4_table_element(m4_ref(memp_set_fileid), Set file unique identifier)
m4_comment([DbMpoolFile::set_flags])m4_table_element(m4_ref(memp_set_flags), General memory pool file configuration)
m4_comment([DbMpoolFile::set_ftype])m4_table_element(m4_ref(memp_set_ftype), Set file type)
m4_comment([DbMpoolFile::set_lsn_offset])m4_table_element(m4_ref(memp_set_lsn_offset), Set file log-sequence-number offset)
m4_comment([DbMpoolFile::set_maxsize])m4_table_element(m4_ref(memp_set_maxsize), Set maximum file size)
m4_comment([DbMpoolFile::set_pgcookie])m4_table_element(m4_ref(memp_set_pgcookie), Set file cookie for pgin/pgout)
m4_comment([DbMpoolFile::set_priority])m4_table_element(m4_ref(memp_set_priority), Set memory pool file priority)
m4_table_end

View File

@@ -0,0 +1,40 @@
m4_comment([$Id: memp_class.so,v 10.21 2006/10/24 15:47:59 bostic Exp $])
define(M4PAGELOCAL, DbMemoryException)
include(m4/m4.seealso)
m4_pf_header(m4_ref(DbMemoryException),
ifelse(M4API, C_API, [dnl
])
ifelse(M4API, CXX_API, [dnl
class DbMemoryException : public DbException {
public:
Dbt *get_dbt() const;
};
]))
m4_p([dnl
This information describes the m4_ref(DbMemoryException) class and how
it is used by the various Db* classes.])
m4_p([dnl
A m4_ref(DbMemoryException) is thrown when there is insufficient memory
to complete an operation, and there is the possibility of recovering.
An example is during a m4_ref(dbh_get) or m4_ref(dbc_get) operation with
the m4_ref(Dbt) flags set to m4_ref(DB_DBT_USERMEM).])
m4_idefz(DB_BUFFER_SMALL)
m4_p([dnl
The m4_ref(DbException) errno value is set to m4_ref(DB_BUFFER_SMALL)
or ENOMEM.])
m4_p([dnl
The m4_arg(get_dbt) method returns the m4_ref(Dbt) with insufficient
memory to complete the operation, causing the m4_ref(DbMemoryException)
to be thrown.
ifelse(M4API, CXX_API, [dnl
The m4_ref(Dbt) pointer may or may not refer to valid memory, depending
on whether the m4_ref(Dbt) used in the call to the failed m4_db method
is still in scope and has not been deleted.])])
m4_page_footer

View File

@@ -0,0 +1,37 @@
m4_comment([$Id: memp_fclose.so,v 10.33 2004/08/13 03:38:58 bostic Exp $])
define(M4PAGELOCAL, memp_fclose)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_fclose),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__close(DB_MPOOLFILE *mpf, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::close(u_int32_t flags);
]))
m4_p([dnl
The m4_refT(memp_fclose) closes the source file indicated by the
m4_refO(DbMpoolFile). Calling m4_ref(memp_fclose) does not imply a call
to m4_ref(memp_fsync); that is, no pages are written to the source file
as as a result of calling m4_ref(memp_fclose).])
m4_p([dnl
If the m4_ref(DbMpoolFile) was temporary, any underlying files created
for this m4_ref(DbMpoolFile) will be removed.])
m4_p([dnl
After m4_ref(memp_fclose) has been called, regardless of its return, the
m4_ref(DbMpoolFile) handle may not be accessed again.])
m4_return(memp_fclose, std)
m4_parambegin
m4_unusedflags
m4_paramend
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,29 @@
m4_comment([$Id: memp_fcreate.so,v 10.12 2004/08/13 03:38:58 bostic Exp $])
define(M4PAGELOCAL, memp_fcreate)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_fcreate),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__memp_fcreate(DB_ENV *dbenvp, DB_MPOOLFILE **dbmfp, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::memp_fcreate(DbMpoolFile **dbmfp, u_int32_t flags);
]))
m4_p([dnl
The m4_refT(memp_fcreate) creates a m4_ref(DbMpoolFile) structure that
is the handle for a m4_db shared memory buffer pool file. A pointer to
this structure is returned in the memory to which m4_arg(dbmfp) refers.
Calling the m4_refT(memp_fclose) will discard the returned handle.])
m4_return(memp_fcreate, std)
m4_parambegin
m4_unusedflags
m4_paramend
m4_seealso(DbMpool)
m4_page_footer

119
docs_src/memp/memp_fget.so Normal file
View File

@@ -0,0 +1,119 @@
m4_comment([$Id: memp_fget.so,v 10.48 2006/09/13 14:30:54 mjc Exp $])
define(M4PAGELOCAL,
[memp_fget, DB_MPOOL_CREATE, DB_MPOOL_DIRTY, DB_MPOOL_EDIT,
DB_MPOOL_LAST, DB_MPOOL_NEW,
DB_PAGE_NOTFOUND, DB_LOCK_DEADLOCK])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_fget),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__get(DB_MPOOLFILE *mpf,
db_pgno_t *pgnoaddr, DB_TXN * txnid, u_int32_t flags, void **pagep);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::get(db_pgno_t *pgnoaddr,
DbTxn *txnid, u_int32_t flags, void **pagep);
]))
m4_p([dnl
The m4_refT(memp_fget) returns pages from the cache.])
m4_p([dnl
All pages returned by m4_ref(memp_fget) will be retained (that is,
m4_italic(pinned)), in the pool until a subsequent call to
m4_ref(memp_fput).])
m4_p([The returned page is m4_bold(size_t) type aligned.])
m4_p([dnl
Fully or partially created pages have all their bytes set to a nul byte,
unless the m4_refT(memp_set_clear_len) was called to specify other
behavior before the file was opened.])
m4_idefz(DB_PAGE_NOTFOUND)
m4_return(memp_fget, except, DB_PAGE_NOTFOUND,
[if the requested page does not exist and m4_ref(DB_MPOOL_CREATE) was
not set], prev)
m4_parambegin
m4_param(flags, [dnl
m4_sf_or_may
m4_tagbegin
m4_tag(m4_idef(DB_MPOOL_CREATE), [dnl
If the specified page does not exist, create it. In this case, the
m4_linkpage(memp_register, pgin, pgin) method, if specified, is
called.])
m4_tag(m4_idef(DB_MPOOL_DIRTY), [dnl
The page will be modified and must be written to the source file before
being evicted from the pool. For files open with the
m4_ref(DB_MULTIVERSION) flag set, a new copy of the page will be made
if this is the first time the specified transaction is modifying it.])
m4_tag(m4_idef(DB_MPOOL_EDIT), [dnl
The page will be modified and must be written to the source file before
being evicted from the pool. No copy of the page will be made, regardless
of the m4_ref(DB_MULTIVERSION) setting. This flag is only intended for
use in situations where a transaction handle is not available, such as during
aborts or recovery.])
m4_tag(m4_idef(DB_MPOOL_LAST), [dnl
Return the last page of the source file, and copy its page number into
the memory location to which m4_arg(pgnoaddr) refers.])
m4_tag(m4_idef(DB_MPOOL_NEW), [dnl
Create a new page in the file, and copy its page number into the memory
location to which m4_arg(pgnoaddr) refers. In this case, the
m4_linkpage(memp_register, pgin, pgin) method, if specified, is
m4_bold(not) called.])
m4_tagend
m4_p([dnl
The m4_ref(DB_MPOOL_CREATE), m4_ref(DB_MPOOL_LAST), and
m4_ref(DB_MPOOL_NEW) flags are mutually exclusive.])])
m4_param_co(pagep, returned page, REF)
m4_param(pgnoaddr, [dnl
If the m4_arg(flags) parameter is set to m4_ref(DB_MPOOL_LAST) or
m4_ref(DB_MPOOL_NEW), the page number of the created page is copied
into the memory location to which the m4_arg(pgnoaddr) parameter
refers. Otherwise, the m4_arg(pgnoaddr) parameter is the page to
create or retrieve.
m4_p([m4_bold([dnl
Page numbers begin at 0; that is, the first page in the file is page
number 0, not page number 1.])])])
m4_param(txnid, [If the operation is part of an application-specified
transaction, the m4_arg(txnid) parameter is a transaction handle
returned from m4_ref(txn_begin); otherwise NULL. A transaction is
required if the file is open for multiversion concurrency control by
passing m4_ref(DB_MULTIVERSION) to m4_ref(memp_fopen) and the
m4_ref(DB_MPOOL_DIRTY), m4_ref(DB_MPOOL_CREATE) or
m4_ref(DB_MPOOL_NEW) flags were specified. Otherwise it is ignored.])
m4_paramend
m4_err(memp_fget,
EACCES,
[The m4_ref(DB_MPOOL_DIRTY) or m4_ref(DB_MPOOL_EDIT) flag was set and
the source file was not opened for writing.],
EAGAIN,
[The page reference count has overflowed. (This should never happen
unless there is a bug in the application.)],
einval,
[the m4_ref(DB_MPOOL_NEW) flag was set, and the source file was not
opened for writing;
more than one of m4_ref(DB_MPOOL_CREATE), m4_ref(DB_MPOOL_LAST), and
m4_ref(DB_MPOOL_NEW) was set.],
m4_ref(DB_LOCK_DEADLOCK),
[For transactions configured with m4_ref(DB_TXN_SNAPSHOT), the page has
been modified since the transaction began.],
memory,
[cache is full, and no more pages will fit in the pool])
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,84 @@
m4_comment([$Id: memp_fopen.so,v 10.53 2006/08/08 05:24:05 mjc Exp $])
define(M4PAGELOCAL, [memp_fopen, DB_DIRECT, DB_ODDFILESIZE])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_fopen),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__open(DB_MPOOLFILE *mpf,
char *file, u_int32_t flags, int mode, size_t pagesize);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::open(const char *file, u_int32_t flags, int mode, size_t pagesize);
]))
m4_p([dnl
The m4_refT(memp_fopen) opens a file in the shared memory buffer pool.])
m4_return(memp_fopen, std)
m4_parambegin
m4_param_utf8(file, [dnl
The m4_arg(file) parameter is the name of the file to be opened. If
m4_arg(file) is NULL, a private temporary file is created that
cannot be shared with any other process (although it may be shared with
other threads of control in the same process).])
m4_param(flags, [dnl
m4_sf_or_may
m4_tagbegin
m4_tag(m4_idef(DB_CREATE), [dnl
Create any underlying files, as necessary. If the files do not already
exist and the DB_CREATE flag is not specified, the call will
fail.])
m4_idefz([turn off system @buffering])
m4_tag(m4_idef(DB_DIRECT), [dnl
If set and supported by the system, turn off system buffering of the
file to avoid double caching.])
m4_tag(m4_idef(DB_MULTIVERSION), [dnl
Open the file with support for m4_link(M4RELDIR/ref/transapp/read,
multiversion concurrency control). Calls to m4_ref(memp_fget) which
dirty pages will cause copies to be made in the cache.])
m4_tag(m4_idef(DB_NOMMAP), [dnl
Always copy this file into the local cache instead of potentially mapping
it into process memory (see the description of the
m4_refT(dbenv_set_mp_mmapsize) for further information).])
m4_tag(m4_idef(DB_ODDFILESIZE), [dnl
Attempts to open files which are not a multiple of the page size in
length will fail, by default. If the m4_ref(DB_ODDFILESIZE) flag is
set, any partial page at the end of the file will be ignored and the
open will proceed.])
m4_tag(m4_idef(DB_RDONLY), [dnl
Open any underlying files for reading only. Any attempt to write the file
using the pool functions will fail, regardless of the actual permissions
of the file.])
m4_tagend])
m4_param_filemode(m4_ref(memp_fopen))
m4_param(pagesize, [dnl
The m4_arg(pagesize) parameter is the size, in bytes, of the unit of
transfer between the application and the cache, although it is not
necessarily the unit of transfer between the cache and the underlying
filesystem.])
m4_paramend
m4_err(memp_fopen, einval,
[the file has already been entered into the pool, and the m4_arg(pagesize)
value is not the same as when the file was entered into the pool, or the
length of the file is not zero or a multiple of the m4_arg(pagesize);
the DB_RDONLY flag was specified for an in-memory pool],
memory, [maximum number of open files has been reached])
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,51 @@
m4_comment([$Id: memp_fput.so,v 10.35 2007/10/26 15:01:55 bostic Exp $])
define(M4PAGELOCAL, memp_fput)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_fput),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__put(DB_MPOOLFILE *mpf,
void *pgaddr, DB_CACHE_PRIORITY priority, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::put(void *pgaddr, DB_CACHE_PRIORITY priority, u_int32_t flags);
]))
m4_p([dnl
The m4_refT(memp_fput) returns a reference to a page in the cache,
setting the priority of the page as specified by the m4_arg(priority)
parameter.])
m4_return(memp_fput, std)
m4_parambegin
m4_unusedflags
m4_param(pgaddr, [dnl
The m4_arg(pgaddr) parameter is the address of the page to be returned
to the cache. The m4_arg(pgaddr) parameter must be a value previously
returned by the m4_refT(memp_fget).])
m4_param(priority, [dnl
Set the page's m4_arg(priority) as follows:
m4_tagbegin
m4_tag(m4_idef(DB_PRIORITY_UNCHANGED), [The priority is unchanged.])
m4_tag(m4_idef(DB_PRIORITY_VERY_LOW), [dnl
The lowest priority: pages are the most likely to be discarded.])
m4_tag(m4_idef(DB_PRIORITY_LOW), [The next lowest priority.])
m4_tag(m4_idef(DB_PRIORITY_DEFAULT), [The default priority.])
m4_tag(m4_idef(DB_PRIORITY_HIGH), [The next highest priority.])
m4_tag(m4_idef(DB_PRIORITY_VERY_HIGH), [dnl
The highest priority: pages are the least likely to be discarded.])
m4_tagend])
m4_paramend
m4_err(memp_fput, einval)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,25 @@
m4_comment([$Id: memp_fsync.so,v 10.36 2006/11/30 19:06:50 bostic Exp $])
define(M4PAGELOCAL, memp_fsync)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_fsync),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__sync(DB_MPOOLFILE *mpf);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::sync();
]))
m4_p([dnl
The m4_refT(memp_fsync) writes all modified pages associated with the
m4_ref(DbMpoolFile) back to the source file. If any of the modified
pages are m4_italic(pinned) (that is, currently in use),
m4_ref(memp_fsync) will ignore them.])
m4_return(memp_fsync, std)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,7 @@
m4_comment([$Id: memp_list.so,v 1.1 2002/08/30 20:01:28 bostic Exp $])
m4_page_title([m4_db: Memory Pools and Related Methods])
include(memp/m4.methods)
m4_page_footer

View File

@@ -0,0 +1,65 @@
m4_comment([$Id: memp_maxwrite.so,v 10.6 2007/11/08 16:28:12 bostic Exp $])
define(M4PAGELOCAL, [memp_get_max_write, memp_set_max_write])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_max_write),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__set_mp_max_write(DB_ENV *env, int maxwrite, db_timeout_t maxwrite_sleep);
m4_blank
int
DB_ENV-__GT__get_mp_max_write(DB_ENV *env, int *maxwritep, db_timeout_t *maxwrite_sleepp);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::set_mp_max_write(int maxwrite, db_timeout_t maxwrite_sleep);
m4_blank
int
DbEnv::get_mp_max_write(int *maxwritep, db_timeout_t *maxwrite_sleepp);
]))
m4_p([dnl
The m4_refT(memp_set_max_write) limits the number of sequential write
operations scheduled by the library when flushing dirty pages from the
cache.])
m4_env_config(memp_set_max_write,
[maximum number of sequential write operations], set_mp_max_write,
[the maximum number of sequential writes and the number of microseconds
to sleep, also separated by whitespace characters])
m4_scope_env(memp_set_max_write)
m4_return(memp_set_max_write, std)
m4_parambegin
m4_param(maxwrite, [dnl
The maximum number of sequential write operations scheduled by the
library when flushing dirty pages from the cache, or 0 if there is
no limitation on the number of sequential write operations.])
m4_param(maxwrite_sleep, [dnl
The number of microseconds the thread of control should pause before
scheduling further write operations. It must be specified as an
unsigned 32-bit number of microseconds, limiting the maximum pause to
roughly 71 minutes.])
m4_paramend
m4_err(memp_set_max_write, einval)
m4_pf_description(m4_ref(memp_get_max_write))
m4_p([dnl
The m4_refT(memp_get_max_write) returns the current maximum number of
sequential write operations and microseconds to pause.])
m4_when_any(memp_get_max_write)
m4_return(memp_get_max_write, std)
m4_parambegin
m4_param_co(maxwritep, maximum number of sequential write operations)
m4_param_co(maxwrite_sleepp, microseconds to pause before scheduling further write operations)
m4_paramend
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,47 @@
m4_comment([$Id: memp_openfd.so,v 10.4 2007/11/08 16:28:12 bostic Exp $])
define(M4PAGELOCAL, [memp_get_max_openfd, memp_set_max_openfd])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_max_openfd),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__set_mp_max_openfd(DB_ENV *env, int maxopenfd);
m4_blank
int
DB_ENV-__GT__get_mp_max_openfd(DB_ENV *env, int *maxopenfdp);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::set_mp_max_openfd(int maxopenfd);
m4_blank
int
DbEnv::get_mp_max_openfd(int *maxopenfdp);
]))
m4_p([dnl
The m4_refT(memp_set_max_openfd) limits the number of file descriptors
the library will open concurrently when flushing dirty pages from the
cache.])
m4_env_config(memp_set_max_openfd,
[limit on open file descriptors to flush dirty pages],
set_max_openfd, [the number of open file descriptors])
m4_scope_env(memp_set_max_write)
m4_return(memp_set_max_openfd, std)
m4_parambegin
m4_param(maxopenfd, [dnl
The maximum number of file descriptors that may be concurrently opened
by the library when flushing dirty pages from the cache.])
m4_paramend
m4_err(memp_set_max_openfd, einval)
m4_pf_getter(memp_get_max_openfd,
maximum number of file descriptors open,, maxopenfdp)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,91 @@
m4_comment([$Id: memp_register.so,v 10.38 2004/08/13 03:38:58 bostic Exp $])
define(M4PAGELOCAL, memp_register)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_register),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__memp_register(DB_ENV *env, int ftype,
int (*pgin_fcn)(DB_ENV *, db_pgno_t pgno, void *pgaddr, DBT *pgcookie),
int (*pgout_fcn)(DB_ENV *, db_pgno_t pgno, void *pgaddr, DBT *pgcookie));
])
ifelse(M4API, CXX_API, [dnl
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);
]))
m4_p([dnl
The m4_refT(memp_register) registers page-in and page-out
functions for files of type m4_arg(ftype) in the specified pool.])
m4_p([dnl
If the m4_arg(pgin_fcn) function is non-NULL, it is called each time
a page is read into the memory pool from a file of type m4_arg(ftype), or
a page is created for a file of type m4_arg(ftype) (see the
DB_MPOOL_CREATE flag for the m4_refT(memp_fget)).])
m4_p([dnl
If the m4_arg(pgout_fcn) function is non-NULL, it is called each time
a page is written to a file of type m4_arg(ftype).])
m4_p([dnl
The purpose of the m4_ref(memp_register) function is to support processing
when pages are entered into, or flushed from, the pool. For example, this
functionality might be used to do byte-endian conversion as pages are read
from, or written to, the underlying file.])
m4_p([dnl
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
m4_ref(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 m4_db access method types because
m4_ref(dbh_open) registers them separately.)])
m4_p([dnl
If a thread or process does not call m4_ref(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,
m4_ref(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.])
m4_return(memp_register, std)
m4_parambegin
m4_param(ftype, [dnl
The m4_arg(ftype) parameter specifies the type of file for which the
page-in and page-out functions will be called.
m4_p([dnl
The m4_arg(ftype) 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 m4_db library).])])
m4_param([[pgin_fcn, pgout_fcn]], [dnl
The page-in and page-out functions.
m4_p([dnl
The m4_arg(pgin_fcn) and m4_arg(pgout_fcn) functions are called with a
reference to the current database environment, the page number being
read or written, a pointer to the page being read or written, and any
parameter m4_arg(pgcookie) that was specified to the
m4_refT(memp_set_pgcookie).])
m4_p([dnl
The m4_arg(pgin_fcn) and m4_arg(pgout_fcn) functions should return 0 on
success, and a non-zero value on failure, in which case the shared m4_db
library function calling it will also fail, returning that non-zero
value. The non-zero value should be selected from values outside of the
m4_db library namespace.])])
m4_paramend
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,45 @@
m4_comment([$Id: memp_set_clear_len.so,v 10.18 2005/11/30 19:46:21 bostic Exp $])
define(M4PAGELOCAL, [memp_set_clear_len, memp_get_clear_len])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_clear_len),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_clear_len(DB_MPOOLFILE *mpf, u_int32_t len);
m4_blank
int
DB_MPOOLFILE-__GT__get_clear_len(DB_MPOOLFILE *mpf, u_int32_t *lenp);
])dnl
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set(u_int32_t len);
m4_blank
int
DbMpoolFile::get_clear_len(u_int32_t *lenp);
]))
m4_p([dnl
The m4_refT(memp_set_clear_len) sets the number of initial bytes in a
page that should be set to nul when the page is created as a result of
the m4_ref(DB_MPOOL_CREATE) or m4_ref(DB_MPOOL_NEW) flags being
specified to m4_ref(memp_fget). If no clear length is specified, the
entire page is cleared when it is created.])
m4_scope_mpf(memp_set_clear_len)
m4_when_mpfopen(memp_set_clear_len, error)
m4_return(memp_set_clear_len, std)
m4_parambegin
m4_param(len, [dnl
The m4_arg(len) parameter is the number of initial bytes in a page that
should be set to nul when the page is created. A value of 0 results in
the entire page being set to nul bytes.])
m4_paramend
m4_pf_getter(memp_get_clear_len, bytes to be cleared,, lenp)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,76 @@
m4_comment([$Id: memp_set_fileid.so,v 10.14 2005/04/14 13:08:06 sue Exp $])
define(M4PAGELOCAL, [memp_set_fileid, memp_get_fileid])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_fileid),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_fileid(DB_MPOOLFILE *mpf, u_int8_t *fileid);
m4_blank
int
DB_MPOOLFILE-__GT__get_fileid(DB_MPOOLFILE *mpf, u_int8_t *fileid);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set(u_int8_t *fileid);
m4_blank
int DbMpoolFile::get_fileid(u_int8_t *fileid);
]))
m4_p([dnl
The m4_refT(memp_set_fileid) specifies a unique identifier for the file.
(The shared memory buffer pool functions must be able to uniquely
identify files in order that multiple processes wanting to share a file
will correctly identify it in the pool.)])
m4_p([dnl
On most UNIX/POSIX systems, the m4_arg(fileid) field will not need to
be set, and the memory pool functions will use the file's device and
inode numbers for this purpose. On Windows systems, the memory pool
functions use the values returned by GetFileInformationByHandle() by
default -- these values are known to be constant between processes and
over reboot in the case of NTFS (in which they are the NTFS MFT
indices).])
m4_p([dnl
On other filesystems (for example, FAT or NFS), these default values
are not necessarily unique between processes or across system reboots.
m4_bold([Applications wanting to maintain a shared memory buffer pool
between processes or across system reboots, in which the pool contains
pages from files stored on such filesystems, must specify a unique file
identifier using the m4_refT(memp_set_fileid), and each process opening
the file must provide the same unique identifier.])])
m4_p([dnl
This call should not be necessary for most applications. Specifically,
it is not necessary if the memory pool is not shared between processes
and is reinstantiated after each system reboot, if the application is
using the m4_db access methods instead of calling the pool functions
explicitly, or if the files in the memory pool are stored on filesystems
in which the default values as described previously are invariant
between process and across system reboots.])
m4_scope_mpf(memp_set_fileid)
m4_when_mpfopen(memp_set_fileid)
m4_return(memp_set_fileid, std)
m4_parambegin
m4_param(fileid, [dnl
The m4_arg(fileid) parameter is the unique identifier for the file.
Unique file identifiers must be a DB_FILE_ID_LEN length array of bytes.])
m4_paramend
m4_pf_description(m4_ref(memp_get_fileid))
m4_p([dnl
The m4_refT(memp_get_fileid) copies the file's identifier into the
memory location referenced by m4_arg(fileid).])
m4_return(memp_get_fileid, std)
m4_when_any(memp_get_fileid)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,67 @@
m4_comment([$Id: memp_set_flags.so,v 1.19 2007/06/07 15:30:46 bostic Exp $])
define(M4PAGELOCAL,
[memp_set_flags, memp_get_flags, DB_MPOOL_NOFILE, DB_MPOOL_UNLINK])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_flags),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_flags(DB_MPOOLFILE *mpf, u_int32_t flags, int onoff)
m4_blank
int
DB_MPOOLFILE-__GT__get_flags(DB_MPOOLFILE *mpf, u_int32_t *flagsp);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set_flags(u_int32_t flags, bool onoff);
m4_blank
int
DbMpoolFile::get_flags(u_int32_t *flagsp);
]))
define(m4_flags_any, [m4_p([dnl
The m4_ref($1) flag may be used to configure m4_db at any time during
the life of the application.])])
m4_p([dnl
Configure a file in the cache.])
m4_p([dnl
To set the flags for a particular database, call the
m4_refT(memp_set_flags) using the m4_ref(DbMpoolFile) handle stored in
the m4_arg(mpf) field of the m4_ref(Db) handle.])
m4_return(memp_set_flags, std)
m4_parambegin
m4_param(flags, [dnl
m4_sf_or_must
m4_tagbegin
m4_tag(m4_idef(DB_MPOOL_NOFILE), [dnl
If set, no backing temporary file will be opened for the specified
in-memory database, even if it expands to fill the entire cache.
Attempts to create new database pages after the cache has been filled
will fail.
m4_scope_mpf_flags(DB_MPOOL_NOFILE)
m4_flags_any(DB_MPOOL_NOFILE)])
m4_tag(m4_idef(DB_MPOOL_UNLINK), [dnl
If set, remove the file when the last reference to it is closed.
m4_scope_mpf_flags(DB_MPOOL_NOFILE)
m4_flags_any(DB_MPOOL_UNLINK)])
m4_tagend])
m4_param(onoff, [dnl
If m4_arg(onoff) is
ifelse(M4API, C_API, zero, false),
the specified flags are cleared; otherwise they are set.])
m4_paramend
m4_pf_getter(memp_get_flags, flags,, flagsp)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,44 @@
m4_comment([$Id: memp_set_ftype.so,v 10.17 2005/11/30 19:46:21 bostic Exp $])
define(M4PAGELOCAL, [memp_set_ftype, memp_get_ftype])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_ftype),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_ftype(DB_MPOOLFILE *mpf, int ftype);
m4_blank
int
DB_MPOOLFILE-__GT__get_ftype(DB_MPOOLFILE *mpf, int *ftypep);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set(int ftype);
m4_blank
int
DbMpoolFile::get_ftype(int *ftypep);
]))
m4_p([dnl
The m4_refT(memp_set_ftype) specifies a file type for the purposes of
input or output processing of the file's pages as they are read from or
written to, the backing filesystem store.])
m4_scope_mpf(memp_set_ftype)
m4_when_mpfopen(memp_set_ftype, overwrite)
m4_return(memp_set_ftype, std)
m4_parambegin
m4_param(ftype, [dnl
The m4_arg(ftype) parameter sets the file's type for the purposes of input
and output processing. The m4_arg(ftype) must be the same as a
m4_arg(ftype) parameter previously specified to the m4_refT(memp_register).
(See the m4_ref(memp_register) documentation for more information.)])
m4_paramend
m4_pf_getter(memp_get_ftype, file type,, ftypep)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,44 @@
m4_comment([$Id: memp_set_lsn_offset.so,v 10.17 2005/04/14 17:57:54 bostic Exp $])
define(M4PAGELOCAL, [memp_set_lsn_offset, memp_get_lsn_offset])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_lsn_offset),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_lsn_offset(DB_MPOOLFILE *mpf, int32_t lsn_offset);
m4_blank
int
DB_MPOOLFILE-__GT__get_lsn_offset(DB_MPOOLFILE *mpf, int32_t *lsn_offsetp);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set(int32_t lsn_offset);
m4_blank
int
DbMpoolFile::get_lsn_offset(int32_t *lsn_offsetp);
]))
m4_p([dnl
The m4_refT(memp_set_lsn_offset) specifies the zero-based byte offset
of a log sequence number (m4_ref(DbLsn)) on the file's pages, for the
purposes of page-flushing as part of transaction checkpoint. (See the
m4_ref(memp_sync) documentation for more information.)])
m4_scope_mpf(memp_set_lsn_offset)
m4_when_mpfopen(memp_set_lsn_offset, error)
m4_return(memp_set_lsn_offset, std)
m4_parambegin
m4_param(lsn_offset, [dnl
The m4_arg(lsn_offset) parameter is the zero-based byte offset of the
log sequence number on the file's pages.])
m4_paramend
m4_pf_getter(memp_get_lsn_offset,
log sequence number byte offset,, lsn_offsetp)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,62 @@
m4_comment([$Id: memp_set_maxsize.so,v 1.15 2005/09/17 16:30:18 bostic Exp $])
define(M4PAGELOCAL, [memp_set_maxsize, memp_get_maxsize])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_maxsize),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_maxsize(DB_MPOOLFILE *mpf,
u_int32_t gbytes, u_int32_t bytes);
m4_blank
int
DB_MPOOLFILE-__GT__get_maxsize(DB_MPOOLFILE *mpf,
u_int32_t *gbytesp, u_int32_t *bytesp);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set_maxsize(u_int32_t gbytes, u_int32_t bytes);
m4_blank
int
DbMpoolFile::get_maxsize(u_int32_t *gbytesp, u_int32_t *bytesp);
]))
m4_p([dnl
Set the maximum size for the file to be m4_arg(gbytes) gigabytes plus
m4_arg(bytes). Attempts to allocate new pages in the file after the
limit has been reached will fail.])
m4_p([dnl
To set the maximum file size for a particular database, call the
m4_refT(memp_set_maxsize) using the m4_ref(DbMpoolFile) handle stored
in the m4_arg(mpf) field of the m4_ref(Db) handle. Attempts to insert
new items into the database after the limit has been reached may fail.])
m4_scope_mpf(memp_set_maxsize)
m4_when_any(memp_set_maxsize)
m4_return(memp_set_maxsize, std)
m4_parambegin
m4_param(bytes, [dnl
The maximum size of the file is set to m4_arg(gbytes) gigabytes plus
m4_arg(bytes).])
m4_param(gbytes, [dnl
The maximum size of the file is set to m4_arg(gbytes) gigabytes plus
m4_arg(bytes).])
m4_paramend
m4_pf_description(m4_ref(memp_get_maxsize))
m4_return(memp_get_maxsize, std)
m4_when_any(memp_get_maxsize)
m4_parambegin
m4_param_co(bytesp, additional bytes of memory in the maximum file size)
m4_param_co(gbytesp, gigabytes of memory in the maximum file size)
m4_paramend
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,45 @@
m4_comment([$Id: memp_set_pgcookie.so,v 10.17 2005/11/30 19:46:21 bostic Exp $])
define(M4PAGELOCAL, [memp_set_pgcookie, memp_get_pgcookie])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_set_pgcookie),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_pgcookie(DB_MPOOLFILE *mpf, DBT *pgcookie);
m4_blank
int
DB_MPOOLFILE-__GT__get_pgcookie(DB_MPOOLFILE *mpf, DBT *dbt);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set(DBT *pgcookie);
m4_blank
int
DbMpoolFile::get_pgcookie(DBT *dbt);
]))
m4_p([dnl
The m4_refT(memp_set_pgcookie) specifies a byte string that is provided
to the functions registered to do input or output processing of the
file's pages as they are read from or written to, the backing filesystem
store. (See the m4_ref(memp_register) documentation for more
information.)])
m4_scope_mpf(memp_set_pgcookie)
m4_when_mpfopen(memp_set_pgcookie, overwrite)
m4_return(memp_set_pgcookie, std)
m4_parambegin
m4_param(pgcookie, [dnl
The m4_arg(pgcookie) parameter is a byte string provided to the
functions registered to do input or output processing of the file's
pages.])
m4_paramend
m4_pf_getter(memp_get_pgcookie, byte string,, dbt, reference)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,24 @@
m4_comment([$Id: memp_set_priority.so,v 10.25 2007/05/22 18:06:06 bostic Exp $])
define(M4INTERFACE, memp_set_priority)
define(M4PAGELOCAL, [memp_set_priority, memp_get_priority,
DB_PRIORITY_VERY_LOW, DB_PRIORITY_LOW, DB_PRIORITY_DEFAULT,
DB_PRIORITY_HIGH, DB_PRIORITY_VERY_HIGH])
m4_pf_header(m4_ref(memp_set_priority),
ifelse(M4API, C_API, [dnl
int
DB_MPOOLFILE-__GT__set_priority(DB_MPOOLFILE *mpf, DB_CACHE_PRIORITY priority);
m4_blank
int
DB_MPOOLFILE-__GT__get_priority(DB_MPOOLFILE *mpf, DB_CACHE_PRIORITY *priorityp);
])
ifelse(M4API, CXX_API, [dnl
int
DbMpoolFile::set_priority(DB_CACHE_PRIORITY priority);
m4_blank
int
DbMpoolFile::get_priority(DB_CACHE_PRIORITY *priorityp);
]))
include(dbc/dbc_set_priority.so)

219
docs_src/memp/memp_stat.so Normal file
View File

@@ -0,0 +1,219 @@
m4_comment([$Id: memp_stat.so,v 10.72 2007/09/21 20:06:03 bostic Exp $])
define(M4PAGELOCAL, [memp_stat, memp_fstat, memp_stat_print])
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_stat),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__memp_stat(DB_ENV *env, DB_MPOOL_STAT **gsp,
DB_MPOOL_FSTAT *(*fsp)__LB____RB__, u_int32_t flags);
m4_blank
int
DB_ENV-__GT__memp_stat_print(DB_ENV *env, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::memp_stat(DB_MPOOL_STAT **gsp,
DB_MPOOL_FSTAT *(*fsp)__LB____RB__, u_int32_t flags);
m4_blank
int
DbEnv::memp_stat_print(u_int32_t flags);
]))
m4_p([dnl
The m4_refT(memp_stat) returns the memory pool (that is, the buffer
cache) subsystem statistics.])
m4_p([dnl
The m4_refT(memp_stat) creates statistical structures of type DB_MPOOL_STAT
and DB_MPOOL_FSTAT, and copy pointers to them into user-specified memory
locations. The cache statistics are stored in the DB_MPOOL_STAT structure
and the per-file cache statistics are stored the DB_MPOOL_FSTAT structure.])
m4_alloc([Statistical structures])
m4_p([dnl
If m4_arg(gsp) is non-NULL, the global statistics for the cache
m4_arg(mp) are copied into the memory location to which it refers.
The following DB_MPOOL_STAT fields will be filled in:])
m4_tagbegin
m4_field(size_t, st_gbytes,
[Gigabytes of cache (total cache size is st_gbytes + st_bytes).])
m4_field(size_t, st_bytes,
[Bytes of cache (total cache size is st_gbytes + st_bytes).])
m4_field(u_int32_t, st_ncache,
[Number of caches.])
m4_field(u_int32_t, st_max_ncache,
[Maximum number of caches, as configured with the
m4_refT(dbenv_set_cache_max).])
m4_field(roff_t, st_regsize,
[Individual cache size, in bytes.])
m4_field(size_t, st_mmapsize,
[Maximum memory-mapped file size.])
m4_field(int, st_maxopenfd,
[Maximum open file descriptors.])
m4_field(int, st_maxwrite,
[Maximum sequential buffer writes.])
m4_field(db_timeout_t, st_maxwrite_sleep,
[Microseconds to pause after writing maximum sequential buffers.])
m4_field(u_int32_t, st_map,
[Requested pages mapped into the process' address space (there is no
available information about whether or not this request caused disk I/O,
although examining the application page fault rate may be helpful).])
m4_field(u_int32_t, st_cache_hit,
[Requested pages found in the cache.])
m4_field(u_int32_t, st_cache_miss,
[Requested pages not found in the cache.])
m4_field(u_int32_t, st_page_create,
[Pages created in the cache.])
m4_field(u_int32_t, st_page_in,
[Pages read into the cache.])
m4_field(u_int32_t, st_page_out,
[Pages written from the cache to the backing file.])
m4_field(u_int32_t, st_ro_evict,
[Clean pages forced from the cache.])
m4_field(u_int32_t, st_rw_evict,
[Dirty pages forced from the cache.])
m4_field(u_int32_t, st_page_trickle,
[Dirty pages written using the m4_refT(memp_trickle).])
m4_field(u_int32_t, st_pages,
[Pages in the cache.])
m4_field(u_int32_t, st_page_clean,
[Clean pages currently in the cache.])
m4_field(u_int32_t, st_page_dirty,
[Dirty pages currently in the cache.])
m4_field(u_int32_t, st_hash_buckets,
[Number of hash buckets in buffer hash table.])
m4_field(u_int32_t, st_hash_searches,
[Total number of buffer hash table lookups.])
m4_field(u_int32_t, st_hash_longest,
[Longest chain ever encountered in buffer hash table lookups.])
m4_field(u_int32_t, st_hash_examined,
[Total number of hash elements traversed during hash table lookups.])
m4_field(u_int32_t, st_hash_nowait,
[Number of times that a thread of control was able to obtain a hash
bucket lock without waiting.])
m4_field(u_int32_t, st_hash_wait,
[Number of times that a thread of control was forced to wait before
obtaining a hash bucket lock.])
m4_field(u_int32_t, st_hash_max_nowait,
[The number of times a thread of control was able to obtain the hash
bucket lock without waiting on the bucket which had the maximum number
of times that a thread of control needed to wait.])
m4_field(u_int32_t, st_hash_max_wait,
[Maximum number of times any hash bucket lock was waited for by a
thread of control.])
m4_field(u_int32_t, st_region_wait,
[Number of times that a thread of control was forced to wait before
obtaining a cache region mutex.])
m4_field(u_int32_t, st_region_nowait,
[Number of times that a thread of control was able to obtain a cache
region mutex without waiting.])
m4_field(u_int32_t, st_mvcc_frozen,
[Number of buffers frozen.])
m4_field(u_int32_t, st_mvcc_thawed,
[Number of buffers thawed.])
m4_field(u_int32_t, st_mvcc_freed,
[Number of frozen buffers freed.])
m4_field(u_int32_t, st_alloc,
[Number of page allocations.])
m4_field(u_int32_t, st_alloc_buckets,
[Number of hash buckets checked during allocation.])
m4_field(u_int32_t, st_alloc_max_buckets,
[Maximum number of hash buckets checked during an allocation.])
m4_field(u_int32_t, st_alloc_pages,
[Number of pages checked during allocation.])
m4_field(u_int32_t, st_alloc_max_pages,
[Maximum number of pages checked during an allocation.])
m4_field(u_int32_t, st_io_wait,
[Number of operations blocked waiting for I/O to complete.])
m4_tagend
m4_p([dnl
If m4_arg(fsp) is non-NULL, a pointer to a NULL-terminated
variable length array of statistics for individual files, in the cache
m4_arg(mp), is copied into the memory location to which it refers. If
no individual files currently exist in the cache, m4_arg(fsp) will be
set to NULL.])
m4_p([dnl
The per-file statistics are stored in structures of type DB_MPOOL_FSTAT.
The following DB_MPOOL_FSTAT fields will be filled in for each file in
the cache; that is, each element of the array:])
m4_tagbegin
m4_field(char *, file_name,
[The name of the file.])
m4_field(size_t, st_pagesize,
[Page size in bytes.])
m4_field(u_int32_t, st_cache_hit,
[Requested pages found in the cache.])
m4_field(u_int32_t, st_cache_miss,
[Requested pages not found in the cache.])
m4_field(u_int32_t, st_map,
[Requested pages mapped into the process' address space.])
m4_field(u_int32_t, st_page_create,
[Pages created in the cache.])
m4_field(u_int32_t, st_page_in,
[Pages read into the cache.])
m4_field(u_int32_t, st_page_out,
[Pages written from the cache to the backing file.])
m4_tagend
m4_when(memp_stat, before, dbenv_open)
m4_return(memp_stat, std)
m4_parambegin
m4_param(flags, m4_stat_flags)
m4_param_co(fsp, allocated per-file statistics structures, REF)
m4_param_co(gsp, allocated global statistics structure, REF)
m4_paramend
m4_err(memp_stat, einval)
m4_stat_print(memp_stat_print, memory pool subsystem, memp_stat)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,40 @@
m4_comment([$Id: memp_sync.so,v 10.43 2007/02/27 19:23:07 bostic Exp $])
define(M4PAGELOCAL, memp_sync)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_sync),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__memp_sync(DB_ENV *env, DB_LSN *lsn);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::memp_sync(DbLsn *lsn);
]))
m4_p([dnl
The m4_refT(memp_sync) flushes modified pages in the cache to their
backing files.])
m4_p([dnl
Pages in the pool that cannot be immediately written back to disk (for
example, pages that are currently in use by another thread of control)
are waited for and written to disk as soon as it is possible to do
so.])
m4_return(memp_sync, std)
m4_parambegin
m4_param(lsn, [dnl
The purpose of the m4_arg(lsn) parameter is to enable a transaction
manager to ensure, as part of a checkpoint, that all pages modified by
a certain time have been written to disk.
m4_p([dnl
All modified pages with a a log sequence number (m4_ref(DbLsn)) less
than the m4_arg(lsn) parameter are written to disk. If m4_arg(lsn) is
NULL, all modified pages in the pool are written to disk.])])
m4_paramend
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,39 @@
m4_comment([$Id: memp_trickle.so,v 10.36 2004/08/13 03:38:58 bostic Exp $])
define(M4PAGELOCAL, memp_trickle)
include(m4/m4.seealso)
m4_pf_header(m4_ref(memp_trickle),
ifelse(M4API, C_API, [dnl
int
DB_ENV-__GT__memp_trickle(DB_ENV *env, int percent, int *nwrotep);
])
ifelse(M4API, CXX_API, [dnl
int
DbEnv::memp_trickle(int percent, int *nwrotep);
]))
m4_p([dnl
The m4_refT(memp_trickle) ensures that a specified percent of the pages
in the shared memory pool are clean, by writing dirty pages to their
backing files.])
m4_p([dnl
The purpose of the m4_ref(memp_trickle) function 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.])
m4_return(memp_trickle, std)
m4_parambegin
m4_param_co(nwrotep, number of pages written to reach the specified
percentage)
m4_param(percent, [dnl
The m4_arg(percent) parameter is the percent of the pages in the cache
that should be clean.])
m4_paramend
m4_err(memp_trickle, einval)
m4_seealso(DbMpool)
m4_page_footer

View File

@@ -0,0 +1,58 @@
m4_comment([$Id: mempfile_class.so,v 10.24 2004/08/13 03:38:58 bostic Exp $])
define(M4PAGELOCAL, DbMpoolFile)
include(m4/m4.seealso)
m4_pf_header(m4_ref(DbMpoolFile),
ifelse(M4API, C_API, [dnl
typedef struct __db_mpoolfile DB_MPOOLFILE;
])
ifelse(M4API, CXX_API, [dnl
class DbMpoolFile {
public:
DB_MPOOLFILE *DbMpoolFile::get_DB_MPOOLFILE();
const DB_MPOOLFILE *DbMpoolFile::get_const_DB_MPOOLFILE() const;
...
};
]))
m4_p([dnl
The memory pool interfaces for the m4_db database environment are
methods of the m4_ref(DbEnv) handle. The m4_ref(DbEnv) memory pool
methods and the m4_ref(DbMpoolFile) class provide general-purpose,
page-oriented buffer management of files. Although designed to work
with the other m4_ref(Db) classes, they are also useful for more general
purposes. The memory pools are referred to in this document as simply
m4_italic(pools).])
m4_p([dnl
Pools may be shared between processes. Pools are usually filled by
pages from one or more files. Pages in the pool are replaced in LRU
(least-recently-used) order, with each new page replacing the page that
has been unused the longest. Pages retrieved from the pool using
m4_ref(memp_fget) are m4_italic(pinned) in the pool until they are
returned to the control of the buffer pool using the m4_ref(memp_fput)
method.])
m4_p([dnl
The m4_ref(DbMpoolFile) object is the handle for a file in the memory
pool. The handle is not free-threaded. Once the m4_refT(memp_fclose)
is called, the handle may not be accessed again, regardless of that
method's return.])
ifelse(M4API, CXX_API, [dnl
m4_p([dnl
Each m4_ref(DbMpoolFile) object has an associated m4_refc(DbMpoolFile)
structure, which is used by the underlying implementation of m4_db and
its C-language API. The DbMpoolFile::get_DB_MPOOLFILE method returns a
pointer to this struct. Given a const m4_ref(DbMpoolFile) object,
DbMpoolFile::get_const_DB_MPOOLFILE returns a const pointer to the same
struct.])
m4_p([dnl
These methods may be useful for m4_db applications including both C
and C++ language software. It should not be necessary to use these
calls in a purely C++ application.])])
m4_seealso(DbMpool)
m4_page_footer