1<!--$Id: base_meth.so,v 1.5 2008/04/23 13:35:47 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 Reference Guide: Base replication API</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><b><dl><dt>Berkeley DB Reference Guide:<dd>Berkeley DB Replication</dl></b></td> 13<td align=right><a href="../rep/mgr_meth.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../rep/comm.html"><img src="../../images/next.gif" alt="Next"></a> 14</td></tr></table> 15<p align=center><b>Base replication API</b></p> 16<p>Applications which use the Base replication API use the following 17Berkeley DB methods.</p> 18<br> 19<b><a href="../../api_c/rep_transport.html">DB_ENV->rep_set_transport</a></b><ul compact><li>The <a href="../../api_c/rep_transport.html">DB_ENV->rep_set_transport</a> method configures the replication system's 20communications infrastructure.</ul> 21<b><a href="../../api_c/rep_start.html">DB_ENV->rep_start</a></b><ul compact><li>The <a href="../../api_c/rep_start.html">DB_ENV->rep_start</a> method configures (or reconfigures) an existing database 22environment to be a replication master or client.</ul> 23<b><a href="../../api_c/rep_message.html">DB_ENV->rep_process_message</a></b><ul compact><li>The <a href="../../api_c/rep_message.html">DB_ENV->rep_process_message</a> method is used to process incoming messages from other 24environments in the replication group. For clients, it is responsible 25for accepting log records and updating the local databases based on 26messages from the master. For both the master and the clients, it is 27responsible for handling administrative functions (for example, the 28protocol for dealing with lost messages), and permitting new clients to 29join an active replication group. This method should only be called 30after the environment has been configured as a replication master or 31client via <a href="../../api_c/rep_start.html">DB_ENV->rep_start</a>.</ul> 32<b><a href="../../api_c/rep_elect.html">DB_ENV->rep_elect</a></b><ul compact><li>The <a href="../../api_c/rep_elect.html">DB_ENV->rep_elect</a> method causes the replication group to elect a new 33master; it is called whenever contact with the master is lost and the 34application wants the remaining sites to select a new master.</ul> 35<b><a href="../../api_c/env_event_notify.html">DB_ENV->set_event_notify</a></b><ul compact><li>The <a href="../../api_c/env_event_notify.html">DB_ENV->set_event_notify</a> method is needed for applications to 36discover important replication-related events, such as the result of 37an election and appointment of a new master.</ul> 38<b><a href="../../api_c/rep_priority.html">DB_ENV->rep_set_priority</a></b><ul compact><li>The <a href="../../api_c/rep_priority.html">DB_ENV->rep_set_priority</a> method configures the local site's priority for 39the purpose of elections.</ul> 40<b><a href="../../api_c/rep_timeout.html">DB_ENV->rep_set_timeout</a></b><ul compact><li>This method optionally configures various timeout values. Otherwise 41default timeout values as specified in <a href="../../api_c/rep_timeout.html">DB_ENV->rep_set_timeout</a> are 42used.</ul> 43<b><a href="../../api_c/rep_limit.html">DB_ENV->rep_set_limit</a></b><ul compact><li>The <a href="../../api_c/rep_limit.html">DB_ENV->rep_set_limit</a> method imposes an upper bound on the amount of data 44that will be sent in response to a single call to <a href="../../api_c/rep_message.html">DB_ENV->rep_process_message</a>. 45During client recovery, that is, when a replica site is trying to 46synchronize with the master, clients may ask the master for a large 47number of log records. If it is going to harm an application for the 48master message loop to remain busy for an extended period transmitting 49records to the replica, then the application will want to use 50<a href="../../api_c/rep_limit.html">DB_ENV->rep_set_limit</a> to limit the amount of data the master will send 51before relinquishing control and accepting other messages.</ul> 52<b><a href="../../api_c/rep_request.html">DB_ENV->rep_set_request</a></b><ul compact><li>This method sets a threshold for the minimum and maximum time that 53a client waits before requesting retransmission of a missing 54message.</ul> 55<br> 56<p>In addition to the methods previously described, applications which use 57the Base replication API may also call the following methods, as needed: 58<a href="../../api_c/rep_stat.html">DB_ENV->rep_stat</a>, <a href="../../api_c/rep_sync.html">DB_ENV->rep_sync</a>, <a href="../../api_c/rep_config.html">DB_ENV->rep_set_config</a>.</p> 59<table width="100%"><tr><td><br></td><td align=right><a href="../rep/mgr_meth.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../rep/comm.html"><img src="../../images/next.gif" alt="Next"></a> 60</td></tr></table> 61<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 62</body> 63</html> 64