• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/db-4.8.30/docs/api_reference/CXX/
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>DbEnv::repmgr_stat()</title>
7    <link rel="stylesheet" href="apiReference.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9    <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
10    <link rel="up" href="rep.html" title="Chapter 11.  Replication Methods" />
11    <link rel="prev" href="repmgrstart.html" title="DbEnv::repmgr_start()" />
12    <link rel="next" href="repmgrstat_print.html" title="DbEnv::repmgr_stat_print()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DbEnv::repmgr_stat()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="repmgrstart.html">Prev</a> </td>
22          <th width="60%" align="center">Chapter 11. 
23                Replication Methods
24        </th>
25          <td width="20%" align="right"> <a accesskey="n" href="repmgrstat_print.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="repmgrstat"></a>DbEnv::repmgr_stat()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db_cxx.h&gt;
39
40int
41DbEnv::repmgr_stat(DB_REPMGR_STAT **statp, u_int32_t flags); </pre>
42      <p>
43         The <code class="methodname">DbEnv::repmgr_stat()</code> method returns the Replication Manager
44         statistics.
45    </p>
46      <p>
47         The <code class="methodname">DbEnv::repmgr_stat()</code> method creates a statistical structure of
48         type <code class="literal">DB_REPMGR_STAT</code> and copies a pointer to it into a user-specified
49         memory location.
50    </p>
51      <p>
52         Statistical structures are stored in allocated memory.  If application-specific allocation
53         routines have been declared (see <a class="xref" href="envset_alloc.html" title="DbEnv::set_alloc()">DbEnv::set_alloc()</a> 
54         for more information), they are used to allocate the memory; otherwise, the standard
55         C library <span class="bold"><strong>malloc</strong></span>(3) is used.  The caller is responsible
56         for deallocating the memory.  To deallocate the memory, free the memory reference;
57         references inside the returned memory need not be individually freed.
58    </p>
59      <p>
60         The following <code class="literal">DB_REPMGR_STAT</code> fields will be filled in:
61    </p>
62      <div class="itemizedlist">
63        <ul type="disc">
64          <li>
65            <p>
66                    <span class="bold"><strong>uintmax_t st_connect_fail;</strong></span>
67                </p>
68            <p>
69                    The number of times an attempt to open a new TCP/IP connection failed.
70                </p>
71          </li>
72          <li>
73            <p>
74                    <span class="bold"><strong>uintmax_t st_connection_drop;</strong></span>
75                </p>
76            <p>
77                    The number of times an existing TCP/IP connection
78                    failed.
79                </p>
80          </li>
81          <li>
82            <p>
83                    <span class="bold"><strong>uintmax_t st_msgs_dropped;</strong></span>
84                </p>
85            <p>
86                    The number of outgoing messages that were completely dropped, because
87                    the outgoing message queue was full.  (Berkeley DB replication is
88                    tolerant of dropped messages, and will automatically request
89                    retransmission of any missing messages as needed.)
90                </p>
91          </li>
92          <li>
93            <p>
94                    <span class="bold"><strong>uintmax_t st_msgs_queued;</strong></span>
95                </p>
96            <p>
97                    The number of outgoing messages which could not be transmitted
98                    immediately, due to a full network buffer, and had to be queued for
99                    later delivery.
100                </p>
101          </li>
102          <li>
103            <p>
104                    <span class="bold"><strong>uintmax_t st_perm_failed;</strong></span>
105                </p>
106            <p>
107                    The number of times a message critical for maintaining database
108                    integrity (for example, a transaction commit), originating at this
109                    site, did not receive sufficient acknowledgement from clients,
110                    according to the configured acknowledgement policy and acknowledgement
111                    timeout.
112                </p>
113          </li>
114        </ul>
115      </div>
116      <p>
117         The <code class="methodname">DbEnv::repmgr_stat()</code> method may not be called before the
118         <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>  method is called.
119    </p>
120      <p>
121         The <code class="methodname">DbEnv::repmgr_stat()</code> <span>
122            
123            <span>
124                method either returns a non-zero error value or throws an
125                exception that encapsulates a non-zero error value on
126                failure, and returns 0 on success.
127            </span>
128        </span>
129    </p>
130      <div class="sect2" lang="en" xml:lang="en">
131        <div class="titlepage">
132          <div>
133            <div>
134              <h3 class="title"><a id="id1708459"></a>Parameters</h3>
135            </div>
136          </div>
137        </div>
138        <div class="sect3" lang="en" xml:lang="en">
139          <div class="titlepage">
140            <div>
141              <div>
142                <h4 class="title"><a id="id1708577"></a>flags</h4>
143              </div>
144            </div>
145          </div>
146          <p>
147                          The <span class="bold"><strong>flags</strong></span> parameter must be set to 0
148                          or the following value:
149                     </p>
150          <div class="itemizedlist">
151            <ul type="disc">
152              <li>
153                <p>
154                     <code class="literal">DB_STAT_CLEAR</code>
155                </p>
156                <p>
157                    Reset statistics after returning their values.
158                </p>
159              </li>
160            </ul>
161          </div>
162        </div>
163        <div class="sect3" lang="en" xml:lang="en">
164          <div class="titlepage">
165            <div>
166              <div>
167                <h4 class="title"><a id="id1708789"></a>statp</h4>
168              </div>
169            </div>
170          </div>
171          <p>
172                          The <span class="bold"><strong>statp</strong></span> parameter references memory
173                          into which a pointer to the allocated statistics structure is copied.
174                     </p>
175        </div>
176      </div>
177      <div class="sect2" lang="en" xml:lang="en">
178        <div class="titlepage">
179          <div>
180            <div>
181              <h3 class="title"><a id="id1708927"></a>Errors</h3>
182            </div>
183          </div>
184        </div>
185        <p>
186                         The <code class="methodname">DbEnv::repmgr_stat()</code> <span>
187            
188            <span>
189                method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
190                exception, encapsulating one of the following non-zero errors, or return one
191                of the following non-zero errors:
192            </span>
193        </span>
194                    </p>
195        <div class="sect3" lang="en" xml:lang="en">
196          <div class="titlepage">
197            <div>
198              <div>
199                <h4 class="title"><a id="id1708321"></a>EINVAL</h4>
200              </div>
201            </div>
202          </div>
203          <p>
204                If the method was called before <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> 
205                was called; or if an invalid flag value or parameter was specified.
206            </p>
207        </div>
208      </div>
209      <div class="sect2" lang="en" xml:lang="en">
210        <div class="titlepage">
211          <div>
212            <div>
213              <h3 class="title"><a id="id1708322"></a>Class</h3>
214            </div>
215          </div>
216        </div>
217        <p>
218                 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  
219            </p>
220      </div>
221      <div class="sect2" lang="en" xml:lang="en">
222        <div class="titlepage">
223          <div>
224            <div>
225              <h3 class="title"><a id="id1708389"></a>See Also</h3>
226            </div>
227          </div>
228        </div>
229        <p>
230                     <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 
231                </p>
232      </div>
233    </div>
234    <div class="navfooter">
235      <hr />
236      <table width="100%" summary="Navigation footer">
237        <tr>
238          <td width="40%" align="left"><a accesskey="p" href="repmgrstart.html">Prev</a> </td>
239          <td width="20%" align="center">
240            <a accesskey="u" href="rep.html">Up</a>
241          </td>
242          <td width="40%" align="right"> <a accesskey="n" href="repmgrstat_print.html">Next</a></td>
243        </tr>
244        <tr>
245          <td width="40%" align="left" valign="top">DbEnv::repmgr_start() </td>
246          <td width="20%" align="center">
247            <a accesskey="h" href="index.html">Home</a>
248          </td>
249          <td width="40%" align="right" valign="top"> DbEnv::repmgr_stat_print()</td>
250        </tr>
251      </table>
252    </div>
253  </body>
254</html>
255