594 lines
27 KiB
HTML
594 lines
27 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="en">
|
|
<head>
|
|
<!-- Generated by javadoc (1.8.0_151) on Tue Oct 31 17:36:46 EDT 2017 -->
|
|
<title>Monitor (Oracle - Berkeley DB Java Edition API)</title>
|
|
<meta name="date" content="2017-10-31">
|
|
<link rel="stylesheet" type="text/css" href="../../../../../style.css" title="Style">
|
|
<script type="text/javascript" src="../../../../../script.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="Monitor (Oracle - Berkeley DB Java Edition API)";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
|
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
|
|
var altColor = "altColor";
|
|
var rowColor = "rowColor";
|
|
var tableTab = "tableTab";
|
|
var activeTableTab = "activeTableTab";
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar.top">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a name="navbar.top.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/Monitor.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../../../index-all.html">Index</a></li>
|
|
<li><a href="../../../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
<div class="aboutLanguage"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
|
|
</div>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../../../com/sleepycat/je/rep/monitor/MemberChangeEvent.html" title="class in com.sleepycat.je.rep.monitor"><span class="typeNameLink">Prev Class</span></a></li>
|
|
<li><a href="../../../../../com/sleepycat/je/rep/monitor/MonitorChangeEvent.html" title="class in com.sleepycat.je.rep.monitor"><span class="typeNameLink">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../../../index.html?com/sleepycat/je/rep/monitor/Monitor.html" target="_top">Frames</a></li>
|
|
<li><a href="Monitor.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_top");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">com.sleepycat.je.rep.monitor</div>
|
|
<h2 title="Class Monitor" class="title">Class Monitor</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<ul class="inheritance">
|
|
<li>java.lang.Object</li>
|
|
<li>
|
|
<ul class="inheritance">
|
|
<li>com.sleepycat.je.rep.monitor.Monitor</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="typeNameLabel">Monitor</span>
|
|
extends java.lang.Object</pre>
|
|
<div class="block">Provides a lightweight mechanism to track the current master node and the
|
|
members of the replication group. The information provided by the monitor
|
|
can be used to route update requests to the node that is currently the
|
|
master and distribute read requests across the other members of the group.
|
|
<p>
|
|
The Monitor is typically run on a machine that participates in load
|
|
balancing, request routing or is simply serving as a basis for application
|
|
level monitoring and does not have a replicated environment. To avoid
|
|
creating a single point of failure, an application may need to create
|
|
multiple monitor instances, with each monitor running on a distinct machine.
|
|
<p>
|
|
Applications with direct access to a <a href="../../../../../com/sleepycat/je/rep/ReplicatedEnvironment.html" title="class in com.sleepycat.je.rep"><code>ReplicatedEnvironment</code></a> can use
|
|
its <a href="../../../../../../ReplicationGuide/replicawrites.html">
|
|
synchronous and asynchronous mechanisms</a> for determining the master node
|
|
and group composition changes. The Monitor class is not needed by such
|
|
applications.
|
|
<p>
|
|
The Monitor generally learns about changes to group status through events
|
|
issued by replication group members. In addition, the Monitor maintains a
|
|
daemon thread which periodically pings members of the group so that the
|
|
Monitor can proactively discover group status changes that occur when it is
|
|
down or has lost network connectivity.
|
|
<p>
|
|
The following code excerpt illustrates the typical code sequence used to
|
|
initiate a Monitor. Exception handling has been omitted to simplify the
|
|
example.
|
|
|
|
<pre class="code">
|
|
MonitorConfig monConfig = new MonitorConfig();
|
|
monConfig.setGroupName("PlanetaryRepGroup");
|
|
monConfig.setNodeName("mon1");
|
|
monConfig.setNodeHostPort("monhost1.acme.com:7000");
|
|
monConfig.setHelperHosts("mars.acme.com:5000,jupiter.acme.com:5000");
|
|
|
|
Monitor monitor = new Monitor(monConfig);
|
|
|
|
// If the monitor has not been registered as a member of the group,
|
|
// register it now. register() returns the current node that is the
|
|
// master.
|
|
|
|
ReplicationNode currentMaster = monitor.register();
|
|
|
|
// Start up the listener, so that it can be used to track changes
|
|
// in the master node, or group composition. It can also be used to help
|
|
// determine the electable nodes that are currently active and participating
|
|
// in the replication group.
|
|
monitor.startListener(new MyChangeListener());
|
|
</pre></div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../../com/sleepycat/je/rep/monitor/MonitorChangeListener.html" title="interface in com.sleepycat.je.rep.monitor"><code>MonitorChangeListener</code></a>,
|
|
<a href="../../../../../../ReplicationGuide/monitors.html">Writing Monitor
|
|
Nodes</a>,
|
|
<a
|
|
href="../../../../../../examples/je/rep/quote/package-summary.html">je.rep.quote
|
|
Examples</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="summary">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Summary</h3>
|
|
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
|
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colOne" scope="col">Constructor and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#Monitor-com.sleepycat.je.rep.monitor.MonitorConfig-">Monitor</a></span>(<a href="../../../../../com/sleepycat/je/rep/monitor/MonitorConfig.html" title="class in com.sleepycat.je.rep.monitor">MonitorConfig</a> monitorConfig)</code>
|
|
<div class="block">Creates a monitor instance.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#Monitor-com.sleepycat.je.rep.ReplicationConfig-">Monitor</a></span>(<a href="../../../../../com/sleepycat/je/rep/ReplicationConfig.html" title="class in com.sleepycat.je.rep">ReplicationConfig</a> monitorConfig)</code>
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
|
|
<div class="block"><span class="deprecationComment">As of JE 5, replaced by
|
|
<a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#Monitor-com.sleepycat.je.rep.monitor.MonitorConfig-"><code>Monitor(MonitorConfig)</code></a></span></div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</li>
|
|
</ul>
|
|
<!-- ========== METHOD SUMMARY =========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.summary">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Summary</h3>
|
|
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr id="i0" class="altColor">
|
|
<td class="colFirst"><code><a href="../../../../../com/sleepycat/je/rep/ReplicationGroup.html" title="class in com.sleepycat.je.rep">ReplicationGroup</a></code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#getGroup--">getGroup</a></span>()</code>
|
|
<div class="block">Returns the current composition of the group.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#getGroupName--">getGroupName</a></span>()</code>
|
|
<div class="block">Returns the name of the group associated with the Monitor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#getMasterNodeName--">getMasterNodeName</a></span>()</code>
|
|
<div class="block">Identifies the master of the replication group, resulting from the last
|
|
successful election.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code>java.net.InetSocketAddress</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#getMonitorSocketAddress--">getMonitorSocketAddress</a></span>()</code>
|
|
<div class="block">Returns the socket used by this monitor to listen for group changes</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#getNodeName--">getNodeName</a></span>()</code>
|
|
<div class="block">Returns the group-wide unique name associated with the monitor</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../../../com/sleepycat/je/rep/ReplicationNode.html" title="interface in com.sleepycat.je.rep">ReplicationNode</a></code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#register--">register</a></span>()</code>
|
|
<div class="block">Registers the monitor with the group so that it can be kept informed
|
|
of the outcome of elections and group membership changes.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#shutdown--">shutdown</a></span>()</code>
|
|
<div class="block">Release monitor resources and shut down the monitor.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#startListener-com.sleepycat.je.rep.monitor.MonitorChangeListener-">startListener</a></span>(<a href="../../../../../com/sleepycat/je/rep/monitor/MonitorChangeListener.html" title="interface in com.sleepycat.je.rep.monitor">MonitorChangeListener</a> newListener)</code>
|
|
<div class="block">Starts the listener so it's actively listening for election results and
|
|
broadcasts of replication group changes.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from class java.lang.Object</h3>
|
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="details">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="constructor.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Constructor Detail</h3>
|
|
<a name="Monitor-com.sleepycat.je.rep.ReplicationConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>Monitor</h4>
|
|
<pre>@Deprecated
|
|
public Monitor(<a href="../../../../../com/sleepycat/je/rep/ReplicationConfig.html" title="class in com.sleepycat.je.rep">ReplicationConfig</a> monitorConfig)</pre>
|
|
<div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">As of JE 5, replaced by
|
|
<a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#Monitor-com.sleepycat.je.rep.monitor.MonitorConfig-"><code>Monitor(MonitorConfig)</code></a></span></div>
|
|
<div class="block">Deprecated as of JE5. Creates a monitor instance using a <a href="../../../../../com/sleepycat/je/rep/ReplicationConfig.html" title="class in com.sleepycat.je.rep"><code>ReplicationConfig</code></a>. Monitor-specific properties that are not available
|
|
in ReplicationConfig use default settings.</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if an invalid parameter is specified.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="Monitor-com.sleepycat.je.rep.monitor.MonitorConfig-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>Monitor</h4>
|
|
<pre>public Monitor(<a href="../../../../../com/sleepycat/je/rep/monitor/MonitorConfig.html" title="class in com.sleepycat.je.rep.monitor">MonitorConfig</a> monitorConfig)</pre>
|
|
<div class="block">Creates a monitor instance.
|
|
<p></div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>monitorConfig</code> - configuration used by a Monitor</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if an invalid parameter is specified.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="getGroupName--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getGroupName</h4>
|
|
<pre>public java.lang.String getGroupName()</pre>
|
|
<div class="block">Returns the name of the group associated with the Monitor.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the group name</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getNodeName--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getNodeName</h4>
|
|
<pre>public java.lang.String getNodeName()</pre>
|
|
<div class="block">Returns the group-wide unique name associated with the monitor</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the monitor name</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getMonitorSocketAddress--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getMonitorSocketAddress</h4>
|
|
<pre>public java.net.InetSocketAddress getMonitorSocketAddress()</pre>
|
|
<div class="block">Returns the socket used by this monitor to listen for group changes</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the monitor socket address</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="register--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>register</h4>
|
|
<pre>public <a href="../../../../../com/sleepycat/je/rep/ReplicationNode.html" title="interface in com.sleepycat.je.rep">ReplicationNode</a> register()
|
|
throws <a href="../../../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></pre>
|
|
<div class="block">Registers the monitor with the group so that it can be kept informed
|
|
of the outcome of elections and group membership changes. The
|
|
monitor, just like a replication node, is identified by its nodeName.
|
|
The Monitor uses the helper nodes to locate a master with which it can
|
|
register itself. If the helper nodes are not available the registration
|
|
will fail.
|
|
<p>
|
|
A monitor must be registered at least once in order to be informed of
|
|
ongoing election results and group changes. Attempts to re-register the
|
|
same monitor are ignored. Registration, once it has been completed
|
|
successfully, persists beyond the lifetime of the Monitor instance and
|
|
does not need to be repeated. Repeated registrations are benign and
|
|
merely confirm that the current monitor configuration is consistent with
|
|
earlier registrations of this monitor.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the node that is the current master</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
|
environment-wide failure occurs.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the monitor has been shutdown, or no
|
|
helper sockets were specified at Monitor initialization.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="startListener-com.sleepycat.je.rep.monitor.MonitorChangeListener-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>startListener</h4>
|
|
<pre>public void startListener(<a href="../../../../../com/sleepycat/je/rep/monitor/MonitorChangeListener.html" title="interface in com.sleepycat.je.rep.monitor">MonitorChangeListener</a> newListener)
|
|
throws <a href="../../../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a>,
|
|
java.io.IOException</pre>
|
|
<div class="block">Starts the listener so it's actively listening for election results and
|
|
broadcasts of replication group changes.
|
|
<p>
|
|
<a href="../../../../../com/sleepycat/je/rep/monitor/Monitor.html#register--"><code>register()</code></a> should be called before starting the listener.
|
|
If the monitor has not been registered, it will not be updated, and its
|
|
listener will not be invoked.
|
|
<p>
|
|
Once the registration has been completed, the Monitor can start
|
|
listening even if none of the other nodes in the group are available.
|
|
It will be contacted automatically by the other nodes as they come up.
|
|
<p>
|
|
If the group has a Master, invoking <code>startListener</code> results
|
|
in a synchronous callback to the application via the <a href="../../../../../com/sleepycat/je/rep/monitor/MonitorChangeListener.html#notify-com.sleepycat.je.rep.monitor.NewMasterEvent-"><code>MonitorChangeListener.notify(NewMasterEvent)</code></a> method. If there is no
|
|
Master at this time, the callback takes place asynchronously, after the
|
|
method returns, when a Master is eventually elected.
|
|
<p>
|
|
Starting the listener will start the underlying ping thread, which
|
|
proactively checks group status for changes that might have been
|
|
missed when this Monitor instance has lost network connectivity or
|
|
is down.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>newListener</code> - the listener used to monitor events of interest.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
|
environment-wide failure occurs.</dd>
|
|
<dd><code>java.io.IOException</code> - if the monitor socket could not be set up</dd>
|
|
<dd><code>java.lang.IllegalArgumentException</code> - if an invalid parameter is specified.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the monitor has been shutdown, or a
|
|
listener has already been established.</dd>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getMasterNodeName--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getMasterNodeName</h4>
|
|
<pre>public java.lang.String getMasterNodeName()
|
|
throws <a href="../../../../../com/sleepycat/je/rep/UnknownMasterException.html" title="class in com.sleepycat.je.rep">UnknownMasterException</a></pre>
|
|
<div class="block">Identifies the master of the replication group, resulting from the last
|
|
successful election. This method relies on the helper nodes supplied
|
|
to the monitor and queries them for the master.
|
|
|
|
This method is useful when a Monitor first starts up and the Master
|
|
needs to be determined. Once a Monitor is registered and the Listener
|
|
has been started, it's kept up to date via events that are delivered
|
|
to the Listener.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>the id associated with the master replication node.</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/rep/UnknownMasterException.html" title="class in com.sleepycat.je.rep">UnknownMasterException</a></code> - if the master could not be determined
|
|
from the set of helpers made available to the Monitor.</dd>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
|
environment-wide failure occurs.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the monitor has been shutdown.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getGroup--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getGroup</h4>
|
|
<pre>public <a href="../../../../../com/sleepycat/je/rep/ReplicationGroup.html" title="class in com.sleepycat.je.rep">ReplicationGroup</a> getGroup()
|
|
throws <a href="../../../../../com/sleepycat/je/rep/UnknownMasterException.html" title="class in com.sleepycat.je.rep">UnknownMasterException</a>,
|
|
<a href="../../../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></pre>
|
|
<div class="block">Returns the current composition of the group. It does so by first
|
|
querying the helpers to determine the master and then obtaining the
|
|
group information from the master.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>an instance of RepGroup denoting the current composition of the
|
|
group</dd>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/rep/UnknownMasterException.html" title="class in com.sleepycat.je.rep">UnknownMasterException</a></code> - if the master could not be determined
|
|
from the set of helpers made available to the Monitor.</dd>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/EnvironmentFailureException.html" title="class in com.sleepycat.je">EnvironmentFailureException</a></code> - if an unexpected, internal or
|
|
environment-wide failure occurs.</dd>
|
|
<dd><code>java.lang.IllegalStateException</code> - if the monitor has been shutdown.</dd>
|
|
<dd><code><a href="../../../../../com/sleepycat/je/DatabaseException.html" title="class in com.sleepycat.je">DatabaseException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="shutdown--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>shutdown</h4>
|
|
<pre>public void shutdown()
|
|
throws java.lang.InterruptedException</pre>
|
|
<div class="block">Release monitor resources and shut down the monitor.</div>
|
|
<dl>
|
|
<dt><span class="throwsLabel">Throws:</span></dt>
|
|
<dd><code>java.lang.InterruptedException</code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<!-- ========= END OF CLASS DATA ========= -->
|
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
|
<div class="bottomNav"><a name="navbar.bottom">
|
|
<!-- -->
|
|
</a>
|
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
|
<a name="navbar.bottom.firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="package-summary.html">Package</a></li>
|
|
<li class="navBarCell1Rev">Class</li>
|
|
<li><a href="class-use/Monitor.html">Use</a></li>
|
|
<li><a href="package-tree.html">Tree</a></li>
|
|
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
|
|
<li><a href="../../../../../index-all.html">Index</a></li>
|
|
<li><a href="../../../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
<div class="aboutLanguage"><b>Berkeley DB Java Edition</b><br><font size=\"-1\"> version 7.5.11</font>
|
|
</div>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../../../com/sleepycat/je/rep/monitor/MemberChangeEvent.html" title="class in com.sleepycat.je.rep.monitor"><span class="typeNameLink">Prev Class</span></a></li>
|
|
<li><a href="../../../../../com/sleepycat/je/rep/monitor/MonitorChangeEvent.html" title="class in com.sleepycat.je.rep.monitor"><span class="typeNameLink">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../../../index.html?com/sleepycat/je/rep/monitor/Monitor.html" target="_top">Frames</a></li>
|
|
<li><a href="Monitor.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
|
|
</ul>
|
|
<div>
|
|
<script type="text/javascript"><!--
|
|
allClassesLink = document.getElementById("allclasses_navbar_bottom");
|
|
if(window==top) {
|
|
allClassesLink.style.display = "block";
|
|
}
|
|
else {
|
|
allClassesLink.style.display = "none";
|
|
}
|
|
//-->
|
|
</script>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
<p class="legalCopy"><small><font size=1>Copyright (c) 2002, 2017 Oracle and/or its affiliates. All rights reserved.</font> </small></p>
|
|
</body>
|
|
</html>
|