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: DbEnv::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>DbEnv::rep_set_nsites</b> 14</td> 15<td align=right> 16<a href="../api_cxx/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 <db_cxx.h> 23<p> 24int 25DbEnv::rep_set_nsites(u_int32_t nsites); 26<p> 27int 28DbEnv::rep_get_nsites(u_int32_t *nsitesp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::rep_set_nsites</b> 32<p>The DbEnv::rep_set_nsites method specifies the total number of sites 33in a replication group.</p> 34<p>The DbEnv::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_cxx/rep_elect.html">DbEnv::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 DbEnv::rep_set_nsites method configures a database environment, not only operations 47performed using the specified <a href="../api_cxx/env_class.html">DbEnv</a> handle.</p> 48<p>The DbEnv::rep_set_nsites method may not be called before the <a href="../api_cxx/rep_start.html">DbEnv::rep_start</a> method is called.</p> 49<p>The DbEnv::rep_set_nsites method 50either returns a non-zero error value 51or throws an exception that encapsulates a non-zero error value on 52failure, and returns 0 on success. 53</p> 54<b>Parameters</b> <br> 55 <b>nsites</b><ul compact><li>An integer specifying the total number of sites in the replication 56group.</ul> 57<br> 58<hr size=1 noshade> 59<b>Description: DbEnv::rep_get_nsites</b> 60<p>The DbEnv::rep_get_nsites method returns the total number of sites in the replication group.</p> 61<p>The DbEnv::rep_get_nsites method may be called at any time during the life of the 62application.</p> 63<p>The DbEnv::rep_get_nsites method 64either returns a non-zero error value 65or throws an exception that encapsulates a non-zero error value on 66failure, and returns 0 on success. 67</p> 68<b>Parameters</b> <br> 69 <b>nsitesp</b><ul compact><li>The DbEnv::rep_get_nsites method returns the 70total number of sites in the replication group in <b>nsitesp</b>.</ul> 71<br> 72<hr size=1 noshade> 73<br><b>Class</b> 74<a href="../api_cxx/env_class.html">DbEnv</a> 75<br><b>See Also</b> 76<a href="../api_cxx/rep_list.html">Replication and Related Methods</a> 77</tt> 78<table width="100%"><tr><td><br></td><td align=right> 79<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 80</td></tr></table> 81<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 82</body> 83</html> 84