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->rep_set_priority()</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="repnsites.html" title="DB_ENV->rep_set_nsites()" /> 12 <link rel="next" href="repset_request.html" title="DB_ENV->rep_set_request()" /> 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->rep_set_priority()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="repnsites.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_request.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="reppriority"></a>DB_ENV->rep_set_priority()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->rep_set_priority(DB_ENV *env, u_int32_t priority); </pre> 42 <p> 43 The <code class="methodname">DB_ENV->rep_set_priority()</code> method specifies the database 44 environment's priority in replication group elections. A special 45 value of 0 indicates that this environment cannot be a replication 46 group master. 47 </p> 48 <p> 49 The database environment's replication subsystem may also be configured using the 50 environment's 51 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file. 52 The syntax of the entry in that file is a single line with the string "rep_set_priority", 53 one or more whitespace characters, and the priority of this site. For example, 54 "rep_set_priority 1" sets the priority of this site to 1. Because the 55 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file is read 56 when the database environment is opened, it will silently overrule configuration done 57 before that time. 58 </p> 59 <p> 60 Note that if the application never explicitly sets a priority, then a default value of 100 61 is used. 62 </p> 63 <p> 64 The <code class="methodname">DB_ENV->rep_set_priority()</code> method configures a database 65 environment, not only operations performed using the specified 66 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> handle. 67 </p> 68 <p> 69 The <code class="methodname">DB_ENV->rep_set_priority()</code> method may be called at any time 70 during the life of the application. 71 </p> 72 <p> 73 The <code class="methodname">DB_ENV->rep_set_priority()</code> <span> 74 <span> 75 method returns a non-zero error value on failure and 0 on success. 76 </span> 77 78 </span> 79 </p> 80 <div class="sect2" lang="en" xml:lang="en"> 81 <div class="titlepage"> 82 <div> 83 <div> 84 <h3 class="title"><a id="id1699395"></a>Parameters</h3> 85 </div> 86 </div> 87 </div> 88 <div class="sect3" lang="en" xml:lang="en"> 89 <div class="titlepage"> 90 <div> 91 <div> 92 <h4 class="title"><a id="id1699400"></a>priority</h4> 93 </div> 94 </div> 95 </div> 96 <p> 97 The priority of this database environment in the replication group. The 98 priority must be a non-zero integer, or 0 if this environment cannot be a 99 replication group master. (See 100 <a href="../../programmer_reference/rep_pri.html" class="olink">Replication environment priorities</a> 101 for more information). 102 </p> 103 </div> 104 </div> 105 <div class="sect2" lang="en" xml:lang="en"> 106 <div class="titlepage"> 107 <div> 108 <div> 109 <h3 class="title"><a id="id1699478"></a>Class</h3> 110 </div> 111 </div> 112 </div> 113 <p> 114 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 115 </p> 116 </div> 117 <div class="sect2" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h3 class="title"><a id="id1699234"></a>See Also</h3> 122 </div> 123 </div> 124 </div> 125 <p> 126 <a class="xref" href="rep.html#replist" title="Replication and Related Methods">Replication and Related Methods</a> 127 </p> 128 </div> 129 </div> 130 <div class="navfooter"> 131 <hr /> 132 <table width="100%" summary="Navigation footer"> 133 <tr> 134 <td width="40%" align="left"><a accesskey="p" href="repnsites.html">Prev</a>��</td> 135 <td width="20%" align="center"> 136 <a accesskey="u" href="rep.html">Up</a> 137 </td> 138 <td width="40%" align="right">��<a accesskey="n" href="repset_request.html">Next</a></td> 139 </tr> 140 <tr> 141 <td width="40%" align="left" valign="top">DB_ENV->rep_set_nsites()��</td> 142 <td width="20%" align="center"> 143 <a accesskey="h" href="index.html">Home</a> 144 </td> 145 <td width="40%" align="right" valign="top">��DB_ENV->rep_set_request()</td> 146 </tr> 147 </table> 148 </div> 149 </body> 150</html> 151