2
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
4
<!--See the file LICENSE for redistribution information.-->
7
<title>Berkeley DB: DbEnv::rep_stat</title>
8
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
12
<a name="2"><!--meow--></a>
13
<table width="100%"><tr valign=top>
15
<h1>DbEnv::rep_stat</h1>
18
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
23
#include <db_cxx.h>
26
DbEnv::rep_stat(DB_REP_STAT **statp, u_int32_t flags);
29
<p>The DbEnv::rep_stat method returns the replication subsystem statistics.
30
<p>The <b>flags</b> value must be set to 0 or
33
<p><dt><a name="DB_STAT_CLEAR">DB_STAT_CLEAR</a><dd>Reset statistics after returning their values.
35
<p>The DbEnv::rep_stat method creates a statistical structure of type
36
DB_REP_STAT and copies a pointer to it into a user-specified memory
38
<p>Statistical structures are created in allocated memory. If application-specific allocation
39
routines have been declared (see <a href="../api_cxx/env_set_alloc.html">DbEnv::set_alloc</a> for more
40
information), they are used to allocate the memory; otherwise, the
41
library <b>malloc</b>(3) interface is used. The caller is
42
responsible for deallocating the memory. To deallocate the memory, free
43
the memory reference; references inside the returned memory need not be
45
<p>The following DB_REP_STAT fields will be filled in:
47
<dt>u_int32_t st_stat;<dd>The current replication mode. Set to <a href="../api_cxx/rep_start.html#DB_REP_MASTER">DB_REP_MASTER</a> if the
48
environment is a replication master, <a href="../api_cxx/rep_start.html#DB_REP_CLIENT">DB_REP_CLIENT</a> if the
49
environment is a replication client, <a href="../api_cxx/rep_start.html#DB_REP_LOGSONLY">DB_REP_LOGSONLY</a> if the
50
environment is a log-files-only replica, or 0 if replication is not
52
<dt>DB_LSN st_next_lsn;<dd>In replication environments configured as masters, the next LSN expected.
53
In replication environments configured as clients, the next LSN to be used.
54
<dt>DB_LSN st_waiting_lsn;<dd>The LSN of the first missed log record being waited for, or 0 if no log
55
records are currently missing.
56
<dt>u_int32_t st_dupmasters;<dd>The number of duplicate master conditions detected.
57
<dt>u_int32_t st_env_id;<dd>The current environment ID.
58
<dt>u_int32_t st_env_priority;<dd>The current environment priority.
59
<dt>u_int32_t st_gen;<dd>The current generation number.
60
<dt>u_int32_t st_log_duplicated;<dd>The number of duplicate log records received.
61
<dt>u_int32_t st_log_queued;<dd>The number of log records currently queued.
62
<dt>u_int32_t st_log_queued_max;<dd>The maximum number of log records ever queued at once.
63
<dt>u_int32_t st_log_queued_total;<dd>The total number of log records queued.
64
<dt>u_int32_t st_log_records;<dd>The number of log records received and appended to the log.
65
<dt>u_int32_t st_log_requested;<dd>The number of log records missed and requested.
66
<dt>u_int32_t st_master;<dd>The current master environment ID.
67
<dt>u_int32_t st_master_changes;<dd>The number of times the master has changed.
68
<dt>u_int32_t st_msgs_badgen;<dd>The number of messages received with a bad generation number.
69
<dt>u_int32_t st_msgs_processed;<dd>The number of messages received and processed.
70
<dt>u_int32_t st_msgs_recover;<dd>The number of messages ignored due to pending recovery.
71
<dt>u_int32_t st_msgs_send_failures;<dd>The number of failed message sends.
72
<dt>u_int32_t st_msgs_sent;<dd>The number of messages sent.
73
<dt>u_int32_t st_newsites;<dd>The number of new site messages received.
74
<dt>u_int32_t st_outdated;<dd>The number of outdated conditions detected.
75
<dt>u_int32_t st_txns_applied;<dd>The number of transactions applied.
76
<dt>u_int32_t st_elections;<dd>The number of elections held.
77
<dt>u_int32_t st_elections_won;<dd>The number of elections won.
78
<dt>u_int32_t st_election_status;<dd>The current election phase (0 if no election is in progress).
79
<dt>u_int32_t st_election_cur_winner;<dd>The election winner.
80
<dt>u_int32_t st_election_gen;<dd>The election generation number.
81
<dt>DB_LSN st_election_lsn;<dd>The maximum LSN of election winner.
82
<dt>u_int32_t st_election_nsites;<dd>The number sites expected to participate in elections.
83
<dt>u_int32_t st_nthrottles;<dd>Transmission limited. This indicates the number of times that data
84
transmission was stopped to limit the amount of data sent in response
85
to a single call to <a href="../api_cxx/rep_message.html">DbEnv::rep_process_message</a>.
86
<dt>u_int32_t st_election_priority;<dd>The election priority.
87
<dt>u_int32_t st_election_tiebreaker;<dd>The election tiebreaker value.
88
<dt>u_int32_t st_election_votes;<dd>The votes received this election round.
90
<p>The DbEnv::rep_stat method either returns a non-zero error value or throws an exception that
91
encapsulates a non-zero error value on failure, and returns 0 on success.
93
<p>The DbEnv::rep_stat method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods.
94
If a catastrophic error has occurred, the DbEnv::rep_stat method may fail and
95
either return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw a
96
<a href="../api_cxx/runrec_class.html">DbRunRecoveryException</a>,
97
in which case all subsequent Berkeley DB calls will fail in the same way.
99
<a href="../api_cxx/env_class.html">DbEnv</a>
101
<a href="../api_cxx/rep_list.html">Replication and Related Methods</a>
103
<table width="100%"><tr><td><br></td><td align=right>
104
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
106
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>