• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/db-4.8.30/docs/api_reference/C/
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>DB_ENV-&gt;rep_set_request()</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��10.�� Replication Methods" />
11    <link rel="prev" href="reppriority.html" title="DB_ENV-&gt;rep_set_priority()" />
12    <link rel="next" href="repset_timeout.html" title="DB_ENV-&gt;rep_set_timeout()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DB_ENV-&gt;rep_set_request()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="reppriority.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��10.��
23                Replication Methods
24        </th>
25          <td width="20%" align="right">��<a accesskey="n" href="repset_timeout.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="repset_request"></a>DB_ENV-&gt;rep_set_request()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db.h&gt;
39
40int
41DB_ENV-&gt;rep_set_request(DB_ENV *env, u_int32_t min, u_int32_t max);  </pre>
42      <p>
43         The <code class="methodname">DB_ENV-&gt;rep_set_request()</code> method sets a threshold for the
44         minimum and maximum time that a client waits before requesting retransmission of a missing
45         message.  Specifically, if the client detects a gap in the sequence of incoming log records
46         or database pages, Berkeley DB will wait for at least <span class="bold"><strong>min</strong></span>
47         microseconds before requesting retransmission of the missing record.  Berkeley DB will
48         double that amount before requesting the same missing record again, and so on, up to a
49         maximum threshold of <span class="bold"><strong>max</strong></span> microseconds.
50    </p>
51      <p>
52         These values are thresholds only.  Since Berkeley DB has no thread
53         available in the library as a timer, the threshold is only checked
54         when a thread enters the Berkeley DB library to process an incoming
55         replication message. Any amount of time may have passed since the last
56         message arrived and Berkeley DB only checks whether the amount of time
57         since a request was made is beyond the threshold value or not.
58    </p>
59      <p>
60         By default the minimum is 40000 and the maximum is 1280000 (1.28
61         seconds). These defaults are fairly arbitrary and the application
62         likely needs to adjust these.  The values should be based on expected
63         load and performance characteristics of the master and client host
64         platforms and transport infrastructure as well as round-trip message
65         time.
66    </p>
67      <p>
68         The database environment's replication subsystem may also be configured using the
69         environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file.  The
70         syntax of the entry in that file is a single line with the string "rep_set_request", one or
71         more whitespace characters, and the request times specified in two parts: the min and the
72         max. For example, "rep_set_request 40000 1280000". Because the 
73         <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read when the
74         database environment is opened, it will silently overrule configuration done before that
75         time.
76    </p>
77      <p>
78         The <code class="methodname">DB_ENV-&gt;rep_set_request()</code> method configures a database
79         environment, not only operations performed using the specified 
80         <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle.
81    </p>
82      <p>
83         The <code class="methodname">DB_ENV-&gt;rep_set_request()</code> method may be called at any time during
84         the life of the application.
85    </p>
86      <p>
87         The <code class="methodname">DB_ENV-&gt;rep_set_request()</code> <span>
88            <span>
89                  method returns a non-zero error value on failure and 0 on success.
90            </span>
91            
92        </span>
93    </p>
94      <div class="sect2" lang="en" xml:lang="en">
95        <div class="titlepage">
96          <div>
97            <div>
98              <h3 class="title"><a id="id1699586"></a>Parameters</h3>
99            </div>
100          </div>
101        </div>
102        <div class="sect3" lang="en" xml:lang="en">
103          <div class="titlepage">
104            <div>
105              <div>
106                <h4 class="title"><a id="id1699514"></a>max</h4>
107              </div>
108            </div>
109          </div>
110          <p>
111                          The maximum number of microseconds a client waits before requesting
112                          retransmission.
113                     </p>
114        </div>
115        <div class="sect3" lang="en" xml:lang="en">
116          <div class="titlepage">
117            <div>
118              <div>
119                <h4 class="title"><a id="id1699668"></a>min</h4>
120              </div>
121            </div>
122          </div>
123          <p>
124                          The minimum number of microseconds a client waits before requesting
125                          retransmission.
126                     </p>
127        </div>
128      </div>
129      <div class="sect2" lang="en" xml:lang="en">
130        <div class="titlepage">
131          <div>
132            <div>
133              <h3 class="title"><a id="id1699670"></a>Errors</h3>
134            </div>
135          </div>
136        </div>
137        <p>
138                         The <code class="methodname">DB_ENV-&gt;rep_set_request()</code> <span>
139            <span>
140                 method may fail and return one of the following non-zero errors:
141            </span>
142            
143        </span>
144                    </p>
145        <div class="sect3" lang="en" xml:lang="en">
146          <div class="titlepage">
147            <div>
148              <div>
149                <h4 class="title"><a id="id1699513"></a>EINVAL</h4>
150              </div>
151            </div>
152          </div>
153          <p>
154                An invalid flag value or parameter was specified.
155            </p>
156        </div>
157      </div>
158      <div class="sect2" lang="en" xml:lang="en">
159        <div class="titlepage">
160          <div>
161            <div>
162              <h3 class="title"><a id="id1699761"></a>Class</h3>
163            </div>
164          </div>
165        </div>
166        <p>
167                <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
168            </p>
169      </div>
170      <div class="sect2" lang="en" xml:lang="en">
171        <div class="titlepage">
172          <div>
173            <div>
174              <h3 class="title"><a id="id1699506"></a>See Also</h3>
175            </div>
176          </div>
177        </div>
178        <p>
179                     <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 
180                </p>
181      </div>
182    </div>
183    <div class="navfooter">
184      <hr />
185      <table width="100%" summary="Navigation footer">
186        <tr>
187          <td width="40%" align="left"><a accesskey="p" href="reppriority.html">Prev</a>��</td>
188          <td width="20%" align="center">
189            <a accesskey="u" href="rep.html">Up</a>
190          </td>
191          <td width="40%" align="right">��<a accesskey="n" href="repset_timeout.html">Next</a></td>
192        </tr>
193        <tr>
194          <td width="40%" align="left" valign="top">DB_ENV-&gt;rep_set_priority()��</td>
195          <td width="20%" align="center">
196            <a accesskey="h" href="index.html">Home</a>
197          </td>
198          <td width="40%" align="right" valign="top">��DB_ENV-&gt;rep_set_timeout()</td>
199        </tr>
200      </table>
201    </div>
202  </body>
203</html>
204