~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/tcl/docs/mpool.html

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--Copyright 1999-2002 by Sleepycat Software, Inc.-->
2
 
<!--All rights reserved.-->
3
 
<HTML>
4
 
<HEAD>
5
 
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
6
 
   <META NAME="GENERATOR" CONTENT="Mozilla/4.08 [en] (X11; I; FreeBSD 2.2.8-19990120-SNAP i386) [Netscape]">
7
 
</HEAD>
8
 
<BODY>
9
 
 
10
 
<H2>
11
 
<A NAME="Memory Pool Commands"></A>Memory Pool Commands</H2>
12
 
Memory pools are used in a manner similar to the other subsystems.&nbsp;
13
 
We create a handle to the pool and&nbsp; then use it for a variety of operations.&nbsp;
14
 
Some of the memory pool commands use the environment instead. Those are
15
 
presented first.
16
 
<P><B>> &lt;env> mpool_stat</B>
17
 
<P>This command returns&nbsp; the statistics associated with the memory
18
 
pool subsystem.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/memp_stat.html">memp_stat</A>
19
 
function.&nbsp; It returns a list of name/value pairs of the DB_MPOOL_STAT
20
 
structure.
21
 
<BR>
22
 
<HR WIDTH="100%">
23
 
<BR><B>> &lt;env> mpool_sync <I>lsn</I></B>
24
 
<P>This command flushes the memory pool for all pages with a log sequence
25
 
number less than <B><I>lsn</I></B>.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/memp_sync.html">memp_sync&nbsp;</A>
26
 
function.&nbsp; It returns either a 0 (for success), a DB error message
27
 
or it throws a Tcl error with a system message.
28
 
<BR>
29
 
<HR WIDTH="100%">
30
 
<BR><B>> &lt;env> mpool_trickle <I>percent</I></B>
31
 
<P>This command tells DB to ensure that at least <B><I>percent</I></B>
32
 
percent of the pages are clean by writing out enough to dirty pages to
33
 
achieve that percentage.&nbsp; It is a direct call to the <A HREF="../../docs/api_c/memp_trickle.html">memp_trickle</A>
34
 
function.&nbsp; The command will return the number of pages actually written.&nbsp;
35
 
It returns either the number of pages on success, or it throws a Tcl error
36
 
with a system message.
37
 
<BR>
38
 
<HR WIDTH="100%">
39
 
<P><B>> &lt;env> mpool [-create] [-nommap] [-rdonly] [-mode <I>mode</I>]
40
 
-pagesize <I>size</I> [<I>file</I>]</B>
41
 
<P>This command creates a new memory pool.&nbsp; It invokes the <A HREF="../../docs/api_c/memp_fopen.html">memp_fopen</A>
42
 
function.&nbsp; After it successfully gets a handle to a memory pool, we
43
 
bind it to a new Tcl command of the form <B><I>$env.mpX</I></B>, where
44
 
X is an integer starting at&nbsp; 0 (e.g. <B>$env.mp0, $env.mp1, </B>etc).&nbsp;
45
 
We use the <I>Tcl_CreateObjCommand()</I> to create the top level memory
46
 
pool functions.&nbsp; It is through this handle that the user can manipulate
47
 
the pool.&nbsp; Internally, the handle we get back from DB will be stored
48
 
as the <I>ClientData</I> portion of the new command set so that future
49
 
memory pool calls will have that handle readily available.&nbsp; Additionally,
50
 
we need to maintain this handle in relation to the environment so that
51
 
if the user calls <A HREF="../../docs/api_tcl/env_close.html">&lt;env> close</A> without closing
52
 
the memory pool we can properly clean up.&nbsp; The arguments are:
53
 
<UL>
54
 
<LI>
55
 
<B><I>file</I></B> is the name of the file to open</LI>
56
 
 
57
 
<LI>
58
 
<B>-create </B>selects the DB_CREATE flag to create underlying file</LI>
59
 
 
60
 
<LI>
61
 
<B>-mode <I>mode </I></B>sets the permissions of created file to <B><I>mode</I></B></LI>
62
 
 
63
 
<LI>
64
 
<B>-nommap</B> selects the DB_NOMMAP flag to disallow using mmap'ed files</LI>
65
 
 
66
 
<LI>
67
 
<B>-pagesize</B> sets the underlying file page size to <B><I>size</I></B></LI>
68
 
 
69
 
<LI>
70
 
<B>-rdonly </B>selects the DB_RDONLY flag for read only access</LI>
71
 
</UL>
72
 
 
73
 
<HR WIDTH="100%">
74
 
<BR><B>> &lt;mp> close</B>
75
 
<P>This command closes the memory pool.&nbsp; It is a direct call to the
76
 
<A HREF="../../docs/api_c/memp_fclose.html">memp_close</A>
77
 
function.&nbsp; It returns either a 0 (for success), a DB error message
78
 
or it throws a Tcl error with a system message.
79
 
<P>Additionally, since the handle is no longer valid, we will call
80
 
<I>Tcl_DeleteCommand()
81
 
</I>so
82
 
that further uses of the handle will be dealt with properly by Tcl itself.&nbsp;
83
 
We must also remove the reference to this handle from the environment.&nbsp;
84
 
We will go through the list of pinned pages that were acquired by the <A HREF="#> <mp> get">get</A>
85
 
command and
86
 
<A HREF="#> <pg> put">put</A> them back.
87
 
<HR WIDTH="100%">
88
 
<BR><B>> &lt;mp> fsync</B>
89
 
<P>This command flushes all of the file's dirty pages to disk.&nbsp; It
90
 
is a direct call to the <A HREF="../../docs/api_c/memp_fsync.html">memp_fsync</A>
91
 
function.&nbsp; It returns either a 0 (for success), a DB error message
92
 
or it throws a Tcl error with a system message.
93
 
<HR WIDTH="100%">
94
 
<BR><A NAME="> <mp> get"></A><B>> &lt;mp> get [-create] [-last] [-new]
95
 
[<I>pgno</I>]</B>
96
 
<P>This command gets the&nbsp; <B><I>pgno </I></B>page from the memory
97
 
pool.&nbsp; It invokes the <A HREF="../../docs/api_c/memp_fget.html">memp_fget</A>
98
 
function and possibly the <A HREF="../../docs/api_c/memp_fset.html">memp_fset</A>
99
 
function if any options are chosen to set the page characteristics.&nbsp;
100
 
After it successfully gets a handle to a page,&nbsp; we bind it to and
101
 
return a new Tcl command of the form <B><I>$env.mpN.pX</I></B>, where X
102
 
is an integer starting at&nbsp; 0 (e.g. <B>$env.mp0.p0, $env.mp1.p0, </B>etc).&nbsp;
103
 
We use the <I>Tcl_CreateObjCommand()</I> to create the top level page functions.&nbsp;
104
 
It is through this handle that the user can manipulate the page.&nbsp;
105
 
Internally, the handle we get back from DB will be stored as the <I>ClientData</I>
106
 
portion of the new command set.&nbsp; We need to store this handle in&nbsp;
107
 
relation to the memory pool handle so that if the memory pool is closed,
108
 
we will <A HREF="#> <pg> put">put</A> back the pages (setting the discard
109
 
flag) and delete that set of commands.
110
 
<P>The arguments are:
111
 
<UL>
112
 
<LI>
113
 
<B>-create </B>selects the DB_MPOOL_CREATE flag&nbsp; to create the page
114
 
if it does not exist.</LI>
115
 
 
116
 
<LI>
117
 
<B>-last</B> selects the DB_MPOOL_LAST flag to return the last page in
118
 
the file</LI>
119
 
 
120
 
<LI>
121
 
<B>-new</B> selects the DB_MPOOL_NEW flag to create a new page</LI>
122
 
</UL>
123
 
 
124
 
<HR WIDTH="100%">
125
 
<BR><B>> &lt;pg> pgnum</B>
126
 
<P>This command returns the page number associated with this memory pool
127
 
page.&nbsp; Primarily it will be used after an <A HREF="#> <mp> get">&lt;mp>
128
 
get</A> call.
129
 
<BR>
130
 
<HR WIDTH="100%"><B>> &lt;pg> pgsize</B>
131
 
<P>This command returns the page size associated with this memory pool
132
 
page.&nbsp; Primarily it will be used after an <A HREF="#> <mp> get">&lt;mp>
133
 
get</A> call.
134
 
<BR>
135
 
<HR WIDTH="100%"><B>> &lt;pg> set [-clean] [-dirty] [-discard]</B>
136
 
<P>This command sets the characteristics of the page.&nbsp; It is a direct
137
 
call to the <A HREF="../../docs/api_c/memp_fset.html">memp_fset</A> function.&nbsp;
138
 
It returns either a 0 (for success), a DB error message or it throws a
139
 
Tcl error with a system message.&nbsp; The arguments are:
140
 
<UL>
141
 
<LI>
142
 
<B>-clean</B> selects the DB_MPOOL_CLEAN flag to indicate this is a clean
143
 
page</LI>
144
 
 
145
 
<LI>
146
 
<B>-dirty</B> selects the DB_MPOOL_DIRTY flag to indicate this page should
147
 
be flushed before eviction</LI>
148
 
 
149
 
<LI>
150
 
<B>-discard</B> selects the DB_MPOOL_DISCARD flag to indicate this page
151
 
is unimportant</LI>
152
 
</UL>
153
 
 
154
 
<HR WIDTH="100%">
155
 
<BR><A NAME="> <pg> put"></A><B>> &lt;pg> put [-clean] [-dirty] [-discard]</B>
156
 
<P>This command will put back the page to the memory pool.&nbsp; It is
157
 
a direct call to the <A HREF="../../docs/api_c/memp_fput.html">memp_fput</A>
158
 
function.&nbsp; It returns either a 0 (for success), a DB error message
159
 
or it throws a Tcl error with a system message. Additionally, since the
160
 
handle is no longer valid, we will call
161
 
<I>Tcl_DeleteCommand()
162
 
</I>so that
163
 
further uses of the handle will be dealt with properly by Tcl itself.&nbsp;
164
 
We must also remove the reference to this handle from the memory pool.
165
 
<P>The arguments are:
166
 
<UL>
167
 
<LI>
168
 
<B>-clean</B> selects the DB_MPOOL_CLEAN flag to indicate this is a clean
169
 
page</LI>
170
 
 
171
 
<LI>
172
 
<B>-dirty</B> selects the DB_MPOOL_DIRTY flag to indicate this page should
173
 
be flushed before eviction</LI>
174
 
 
175
 
<LI>
176
 
<B>-discard</B> selects the DB_MPOOL_DISCARD flag to indicate this page
177
 
is unimportant</LI>
178
 
</UL>
179
 
 
180
 
<HR WIDTH="100%">
181
 
<BR><B>> &lt;pg> init <I>val|string</I></B>
182
 
<P>This command initializes the page to the <B><I>val</I></B> given or
183
 
places the <B><I>string</I></B> given at the beginning of the page.&nbsp;
184
 
It returns a 0 for success or it throws a Tcl error with an error message.
185
 
<P>
186
 
<HR WIDTH="100%">
187
 
<BR><B>> &lt;pg> is_setto <I>val|string</I></B>
188
 
<P>This command verifies the page contains the <B><I>val</I></B> given
189
 
or checks that the <B>string</B> given is at the beginning of the page.&nbsp;
190
 
It returns a 1 if the page is correctly set to the value and a 0 otherwise.