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>Base API Methods</title> 7 <link rel="stylesheet" href="gettingStarted.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 Programmer's Reference Guide" /> 10 <link rel="up" href="rep.html" title="Chapter��12.�� Berkeley DB Replication" /> 11 <link rel="prev" href="rep_mgr_meth.html" title="Replication Manager methods" /> 12 <link rel="next" href="rep_comm.html" title="Building the communications infrastructure" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Base API Methods</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="rep_mgr_meth.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��12.�� 23 Berkeley DB Replication 24 </th> 25 <td width="20%" align="right">��<a accesskey="n" href="rep_comm.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="rep_base_meth"></a>Base API Methods</h2> 35 </div> 36 </div> 37 </div> 38 <p>Base API applications use the following 39Berkeley DB methods.</p> 40 <div class="variablelist"> 41 <dl> 42 <dt> 43 <span class="term"> 44 <a href="../api_reference/C/reptransport.html" class="olink">DB_ENV->rep_set_transport()</a> 45 </span> 46 </dt> 47 <dd> 48 <p> 49 The <a href="../api_reference/C/reptransport.html" class="olink">DB_ENV->rep_set_transport()</a> method configures the replication system's 50 communications infrastructure. 51 </p> 52 </dd> 53 <dt> 54 <span class="term"> 55 <a href="../api_reference/C/repstart.html" class="olink">DB_ENV->rep_start()</a> 56 </span> 57 </dt> 58 <dd> 59 <p> 60 The <a href="../api_reference/C/repstart.html" class="olink">DB_ENV->rep_start()</a> method configures (or reconfigures) an existing database 61 environment to be a replication master or client. 62 </p> 63 </dd> 64 <dt> 65 <span class="term"> 66 <a href="../api_reference/C/repmessage.html" class="olink">DB_ENV->rep_process_message()</a> 67 </span> 68 </dt> 69 <dd> 70 <p> 71 The <a href="../api_reference/C/repmessage.html" class="olink">DB_ENV->rep_process_message()</a> method is used to process incoming messages 72 from other environments in the replication group. For clients, 73 it is responsible for accepting log records and updating the 74 local databases based on messages from the master. For both 75 the master and the clients, it is responsible for handling 76 administrative functions (for example, the protocol for dealing 77 with lost messages), and permitting new clients to join an 78 active replication group. This method should only be called 79 after the replication system's communications infrastructure 80 has been configured via <a href="../api_reference/C/reptransport.html" class="olink">DB_ENV->rep_set_transport()</a>. 81 </p> 82 </dd> 83 <dt> 84 <span class="term"> 85 <a href="../api_reference/C/repelect.html" class="olink">DB_ENV->rep_elect()</a> 86 </span> 87 </dt> 88 <dd> 89 <p> 90 The <a href="../api_reference/C/repelect.html" class="olink">DB_ENV->rep_elect()</a> method causes the replication group to elect a 91 new master; it is called whenever contact with the master is 92 lost and the application wants the remaining sites to select a 93 new master. 94 </p> 95 </dd> 96 <dt> 97 <span class="term"> 98 <a href="../api_reference/C/envevent_notify.html" class="olink">DB_ENV->set_event_notify()</a> 99 </span> 100 </dt> 101 <dd> 102 <p> 103 The <a href="../api_reference/C/envevent_notify.html" class="olink">DB_ENV->set_event_notify()</a> method is needed for applications to 104 discover important replication-related events, such as the 105 result of an election and appointment of a new master. 106 </p> 107 </dd> 108 <dt> 109 <span class="term"> 110 <a href="../api_reference/C/reppriority.html" class="olink">DB_ENV->rep_set_priority()</a> 111 </span> 112 </dt> 113 <dd> 114 <p> 115 The <a href="../api_reference/C/reppriority.html" class="olink">DB_ENV->rep_set_priority()</a> method configures the local site's priority for 116 the purpose of elections. 117 </p> 118 </dd> 119 <dt> 120 <span class="term"> 121 <a href="../api_reference/C/repset_timeout.html" class="olink">DB_ENV->rep_set_timeout()</a> 122 </span> 123 </dt> 124 <dd> 125 <p> 126 This method optionally configures various timeout values. Otherwise 127 default timeout values as specified in <a href="../api_reference/C/repset_timeout.html" class="olink">DB_ENV->rep_set_timeout()</a> are 128 used. 129 </p> 130 </dd> 131 <dt> 132 <span class="term"> 133 <a href="../api_reference/C/repset_limit.html" class="olink">DB_ENV->rep_set_limit()</a> 134 </span> 135 </dt> 136 <dd> 137 <p> 138 The <a href="../api_reference/C/repset_limit.html" class="olink">DB_ENV->rep_set_limit()</a> method imposes an upper bound on the amount of 139 data that will be sent in response to a single call to 140 <a href="../api_reference/C/repmessage.html" class="olink">DB_ENV->rep_process_message()</a>. During client recovery, that is, when a replica 141 site is trying to synchronize with the master, clients may ask 142 the master for a large number of log records. If it is going 143 to harm an application for the master message loop to remain 144 busy for an extended period transmitting records to the 145 replica, then the application will want to use <a href="../api_reference/C/repset_limit.html" class="olink">DB_ENV->rep_set_limit()</a> to 146 limit the amount of data the master will send before 147 relinquishing control and accepting other messages. 148 </p> 149 </dd> 150 <dt> 151 <span class="term"> 152 <a href="../api_reference/C/repset_request.html" class="olink">DB_ENV->rep_set_request()</a> 153 </span> 154 </dt> 155 <dd> 156 <p> 157 This method sets a threshold for the minimum and maximum time that 158 a client waits before requesting retransmission of a missing 159 message. 160 </p> 161 </dd> 162 </dl> 163 </div> 164 <p>In addition to the methods previously described, Base API applications 165may also call the following methods, as needed: 166<a href="../api_reference/C/repstat.html" class="olink">DB_ENV->rep_stat()</a>, <a href="../api_reference/C/repsync.html" class="olink">DB_ENV->rep_sync()</a> and <a href="../api_reference/C/repconfig.html" class="olink">DB_ENV->rep_set_config()</a>.</p> 167 </div> 168 <div class="navfooter"> 169 <hr /> 170 <table width="100%" summary="Navigation footer"> 171 <tr> 172 <td width="40%" align="left"><a accesskey="p" href="rep_mgr_meth.html">Prev</a>��</td> 173 <td width="20%" align="center"> 174 <a accesskey="u" href="rep.html">Up</a> 175 </td> 176 <td width="40%" align="right">��<a accesskey="n" href="rep_comm.html">Next</a></td> 177 </tr> 178 <tr> 179 <td width="40%" align="left" valign="top">Replication Manager methods��</td> 180 <td width="20%" align="center"> 181 <a accesskey="h" href="index.html">Home</a> 182 </td> 183 <td width="40%" align="right" valign="top">��Building the communications infrastructure</td> 184 </tr> 185 </table> 186 </div> 187 </body> 188</html> 189