1<!--$Id: rep_request.so,v 1.5 2008/02/20 19:01:48 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_request</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_request</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_request(u_int32_t min, u_int32_t max); 26<p> 27int 28DbEnv::rep_get_request(u_int32_t *minp, u_int32_t *maxp); 29</pre></b> 30<hr size=1 noshade> 31<b>Description: DbEnv::rep_set_request</b> 32<p>The DbEnv::rep_set_request method sets a threshold for the minimum and maximum 33time that a client waits before requesting retransmission of a missing 34message. Specifically, if the client detects a gap in the sequence 35of incoming log records or database pages, Berkeley DB will 36wait for at least <b>min</b> microseconds before requesting 37retransmission of the missing record. Berkeley DB will double that 38amount before requesting the same missing record again, and so on, up 39to a maximum threshold of <b>max</b> microseconds.</p> 40<p>These values are thresholds only. Since Berkeley DB has no thread available in 41the library as a timer, the threshold is only checked when a thread 42enters the Berkeley DB library to process an incoming replication message. 43Any amount of time may have passed since the last message arrived and 44Berkeley DB only checks whether the amount of time since a request was made 45is beyond the threshold value or not.</p> 46<p>By default the minimum is 40000 and the maximum is 1280000 (1.28 seconds). 47These defaults are fairly arbitrary and the application likely needs 48to adjust these. The values should be based on expected load and 49performance characteristics of the master and client host platforms 50and transport infrastructure as well as round-trip message time.</p> 51<p>The database environment's replication subsystem may also be configured using the 52environment's <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file. The syntax of the entry in that 53file is a single line with the string "rep_set_request", one or more whitespace 54characters, and the request times specified in two parts: the min and the max. 55For example, "rep_set_request 40000 1280000". 56Because the <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is read when the database environment 57is opened, it will silently overrule configuration done before that 58time.</p> 59<p>The DbEnv::rep_set_request method configures a database environment, not only operations 60performed using the specified <a href="../api_cxx/env_class.html">DbEnv</a> handle.</p> 61<p>The DbEnv::rep_set_request method may be called at any time during the life of the 62application.</p> 63<p>The DbEnv::rep_set_request 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>max</b><ul compact><li>The maximum number of microseconds a client waits before 70requesting retransmission.</ul> 71 <b>min</b><ul compact><li>The minimum number of microseconds a client waits before 72requesting retransmission.</ul> 73<br> 74<br><b>Errors</b> 75<p>The DbEnv::rep_set_request method 76may fail and throw 77<a href="../api_cxx/except_class.html">DbException</a>, 78encapsulating one of the following non-zero errors, or return one of 79the following non-zero errors:</p> 80<br> 81<b>EINVAL</b><ul compact><li>An 82invalid flag value or parameter was specified.</ul> 83<br> 84<hr size=1 noshade> 85<b>Description: DbEnv::rep_get_request</b> 86<p>The DbEnv::rep_get_request method returns the minimum and maximum number of 87microseconds a client waits before requesting retransmission.</p> 88<p>The DbEnv::rep_get_request method may be called at any time during the life of the 89application.</p> 90<p>The DbEnv::rep_get_request method 91either returns a non-zero error value 92or throws an exception that encapsulates a non-zero error value on 93failure, and returns 0 on success. 94</p> 95<b>Parameters</b> <br> 96 <b>maxp</b><ul compact><li>The <b>maxp</b> parameter references memory into which 97 the maximum number of microseconds a client will wait before requesting 98retransmission is copied.</ul> 99 <b>minp</b><ul compact><li>The <b>minp</b> parameter references memory into which 100 the minimum number of microseconds a client will wait before requesting 101retransmission is copied.</ul> 102<br> 103<hr size=1 noshade> 104<br><b>Class</b> 105<a href="../api_cxx/env_class.html">DbEnv</a> 106<br><b>See Also</b> 107<a href="../api_cxx/rep_list.html">Replication and Related Methods</a> 108</tt> 109<table width="100%"><tr><td><br></td><td align=right> 110<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> 111</td></tr></table> 112<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 113</body> 114</html> 115