1<!--$Id: rep_nsites.so,v 1.6 2008/01/30 20:14:30 sue Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DB_ENV-&gt;rep_set_nsites</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DB_ENV-&gt;rep_set_nsites</b>
14</td>
15<td align=right>
16<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a>
17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db.h&gt;
23<p>
24int
25DB_ENV-&gt;rep_set_nsites(DB_ENV *env, u_int32_t nsites);
26<p>
27int
28DB_ENV-&gt;rep_get_nsites(DB_ENV *env, u_int32_t *nsitesp);
29</pre></b>
30<hr size=1 noshade>
31<b>Description: DB_ENV-&gt;rep_set_nsites</b>
32<p>The DB_ENV-&gt;rep_set_nsites method specifies the total number of sites
33in a replication group.</p>
34<p>The DB_ENV-&gt;rep_set_nsites method is typically called by applications which
35use the Berkeley DB library "replication manager" support.  (However, see
36also the <a href="/api_c/rep_elect.html">DB_ENV-&gt;rep_elect</a> man page, the description of the <b>nsites</b>
37parameter.)</p>
38<p>The database environment's replication subsystem may also be configured using the
39environment's <a href="/ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file.  The syntax of the entry in that
40file is a single line with the string "rep_set_nsites", one or more whitespace
41characters, and the number of sites specified.
42For example, "rep_set_nsites 5" sets the number of sites to 5.
43Because the <a href="/ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment
44is opened, it will silently overrule configuration done before that
45time.</p>
46<p>The DB_ENV-&gt;rep_set_nsites method configures a database environment, not only operations
47performed using the specified <a href="/api_c/env_class.html">DB_ENV</a> handle.</p>
48<p>The DB_ENV-&gt;rep_set_nsites method may not be called before the <a href="/api_c/rep_start.html">DB_ENV-&gt;rep_start</a> method is called.</p>
49<p>The DB_ENV-&gt;rep_set_nsites method
50returns a non-zero error value on failure
51and 0 on success.
52</p>
53<b>Parameters</b> <br>
54 <b>nsites</b><ul compact><li>An integer specifying the total number of sites in the replication
55group.</ul>
56<br>
57<hr size=1 noshade>
58<b>Description: DB_ENV-&gt;rep_get_nsites</b>
59<p>The DB_ENV-&gt;rep_get_nsites method returns the total number of sites in the replication group.</p>
60<p>The DB_ENV-&gt;rep_get_nsites method may be called at any time during the life of the
61application.</p>
62<p>The DB_ENV-&gt;rep_get_nsites method
63returns a non-zero error value on failure
64and 0 on success.
65</p>
66<b>Parameters</b> <br>
67 <b>nsitesp</b><ul compact><li>The DB_ENV-&gt;rep_get_nsites method returns  the
68total number of sites in the replication group in <b>nsitesp</b>.</ul>
69<br>
70<hr size=1 noshade>
71<br><b>Class</b>
72<a href="/api_c/env_class.html">DB_ENV</a>
73<br><b>See Also</b>
74<a href="/api_c/rep_list.html">Replication and Related Methods</a>
75</tt>
76<table width="100%"><tr><td><br></td><td align=right>
77<a href="/api_c/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a>
78</td></tr></table>
79<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
80</body>
81</html>
82