Debian Codegraph @

docs/api_reference/C/repnsites.html

raw symbols SCIP
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_nsites()</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="repset_limit.html" title="DB_ENV-&gt;rep_set_limit()" />
12 <link rel="next" href="reppriority.html" title="DB_ENV-&gt;rep_set_priority()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">DB_ENV-&gt;rep_set_nsites()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="repset_limit.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 10. 
26 Replication Methods
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="reppriority.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="repnsites"></a>DB_ENV-&gt;rep_set_nsites()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db.h&gt;
42
43 int
44 DB_ENV-&gt;rep_set_nsites(DB_ENV *env, u_int32_t nsites); </pre>
45 <p>
46 The <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> method specifies the total number of
47 sites in a replication group. This method should not be used by
48 Replication Manager applications; the number of sites in use by a
49 Replication Manager application is determined dynamically.
50 </p>
51 <p>
52 The <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> method is typically called by
53 Base API applications. (However, see also the
54 <a class="xref" href="repelect.html" title="DB_ENV-&gt;rep_elect()">DB_ENV-&gt;rep_elect()</a> method
55 <span class="bold"><strong>nsites</strong></span>
56 parameter.)
57 </p>
58 <p>
59 The database environment's replication subsystem may also be
60 configured using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. The syntax of
61 the entry in that file is a single line with the string
62 "rep_set_nsites", one or more whitespace characters, and the
63 number of sites specified. For example, "rep_set_nsites 5" sets
64 the number of sites to 5. Because the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read
65 when the database environment is opened, it will silently overrule
66 configuration done before that time.
67 </p>
68 <p>
69 The <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> method configures a database
70 environment, not only operations performed using the specified
71 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a> handle.
72 </p>
73 <p>
74 If master leases are in use, the <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> method
75 should not be called after the <a class="xref" href="repstart.html" title="DB_ENV-&gt;rep_start()">DB_ENV-&gt;rep_start()</a>
76 method is called as this could cause you to lose data previously
77 thought to be durable. If master leases are not in use, the
78 <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> method may be
79 called at any time during the life of the application.
80 </p>
81 <p>
82 The <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> <span>
83 <span>
84 method returns a non-zero error value on failure and 0 on success.
85 </span>
86
87 </span>
88 </p>
89 <div class="sect2" lang="en" xml:lang="en">
90 <div class="titlepage">
91 <div>
92 <div>
93 <h3 class="title"><a id="idp54150216"></a>Parameters</h3>
94 </div>
95 </div>
96 </div>
97 <div class="sect3" lang="en" xml:lang="en">
98 <div class="titlepage">
99 <div>
100 <div>
101 <h4 class="title"><a id="idp54149096"></a>nsites</h4>
102 </div>
103 </div>
104 </div>
105 <p>
106 An integer specifying the total number of sites in the replication
107 group.
108 </p>
109 </div>
110 </div>
111 <div class="sect2" lang="en" xml:lang="en">
112 <div class="titlepage">
113 <div>
114 <div>
115 <h3 class="title"><a id="idp54151072"></a>Errors</h3>
116 </div>
117 </div>
118 </div>
119 <p>
120 The <code class="methodname">DB_ENV-&gt;rep_set_nsites()</code> <span>
121 <span>
122 method may fail and return one of the following non-zero errors:
123 </span>
124
125 </span>
126 </p>
127 <div class="sect3" lang="en" xml:lang="en">
128 <div class="titlepage">
129 <div>
130 <div>
131 <h4 class="title"><a id="idp54148984"></a>EINVAL</h4>
132 </div>
133 </div>
134 </div>
135 <p>
136 If master leases are in use and replication has already been started; or if
137 an invalid flag value or parameter was specified.
138 </p>
139 </div>
140 </div>
141 <div class="sect2" lang="en" xml:lang="en">
142 <div class="titlepage">
143 <div>
144 <div>
145 <h3 class="title"><a id="idp54137432"></a>Class</h3>
146 </div>
147 </div>
148 </div>
149 <p>
150 <a class="link" href="env.html" title="Chapter 5.  The DB_ENV Handle">DB_ENV</a>
151 </p>
152 </div>
153 <div class="sect2" lang="en" xml:lang="en">
154 <div class="titlepage">
155 <div>
156 <div>
157 <h3 class="title"><a id="idp54157544"></a>See Also</h3>
158 </div>
159 </div>
160 </div>
161 <p>
162 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a>
163 </p>
164 </div>
165 </div>
166 <div class="navfooter">
167 <hr />
168 <table width="100%" summary="Navigation footer">
169 <tr>
170 <td width="40%" align="left"><a accesskey="p" href="repset_limit.html">Prev</a> </td>
171 <td width="20%" align="center">
172 <a accesskey="u" href="rep.html">Up</a>
173 </td>
174 <td width="40%" align="right"> <a accesskey="n" href="reppriority.html">Next</a></td>
175 </tr>
176 <tr>
177 <td width="40%" align="left" valign="top">DB_ENV-&gt;rep_set_limit() </td>
178 <td width="20%" align="center">
179 <a accesskey="h" href="index.html">Home</a>
180 </td>
181 <td width="40%" align="right" valign="top"> DB_ENV-&gt;rep_set_priority()</td>
182 </tr>
183 </table>
184 </div>
185 </body>
186 </html>