blob: e56c9748c3c34c56958987c437d31fadcab24765 [file] [log] [blame]
<!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_261) on Sat Sep 11 21:20:01 MSK 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ClusterNodeAttributeColocatedBackupFilter (Ignite 2.11.0)</title>
<meta name="date" content="2021-09-11">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<link rel='shortcut icon' href='https://ignite.apache.org/favicon.ico'/>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ClusterNodeAttributeColocatedBackupFilter (Ignite 2.11.0)";
}
}
catch(err) {
}
//-->
var methods = {"i0":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/ClusterNodeAttributeColocatedBackupFilter.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/ignite/cache/affinity/rendezvous/ClusterNodeAttributeAffinityBackupFilter.html" title="class in org.apache.ignite.cache.affinity.rendezvous"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.html" title="class in org.apache.ignite.cache.affinity.rendezvous"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/ignite/cache/affinity/rendezvous/ClusterNodeAttributeColocatedBackupFilter.html" target="_top">Frames</a></li>
<li><a href="ClusterNodeAttributeColocatedBackupFilter.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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">org.apache.ignite.cache.affinity.rendezvous</div>
<h2 title="Class ClusterNodeAttributeColocatedBackupFilter" class="title">Class ClusterNodeAttributeColocatedBackupFilter</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.ignite.cache.affinity.rendezvous.ClusterNodeAttributeColocatedBackupFilter</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a>, <a href="../../../../../../org/apache/ignite/lang/IgniteBiPredicate.html" title="interface in org.apache.ignite.lang">IgniteBiPredicate</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a><span class='angle_bracket'>&gt;</span><span class='angle_bracket'>&gt;</span></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">ClusterNodeAttributeColocatedBackupFilter</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../../org/apache/ignite/lang/IgniteBiPredicate.html" title="interface in org.apache.ignite.lang">IgniteBiPredicate</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a><span class='angle_bracket'>&gt;</span><span class='angle_bracket'>&gt;</span></pre>
<div class="block">This class can be used as a <a href="../../../../../../org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.html#affinityBackupFilter"><code>RendezvousAffinityFunction.affinityBackupFilter</code></a> to create
cache templates in Spring that force each partition's primary and backup to be co-located on nodes with the same
attribute value.
<p>
Partition copies co-location can be helpful to group nodes into cells when fixed baseline topology is used. If all
copies of each partition are located inside only one cell, in case of <code>backup + 1</code> nodes leave the cluster
there will be data lost only if all leaving nodes belong to the same cell. Without partition copies co-location
within a cell, most probably there will be data lost if any <code>backup + 1</code> nodes leave the cluster.
Note: Baseline topology change can lead to inter-cell partitions migration, i.e. rebalance can affect all copies
of some partitions even if only one node is changed in the baseline topology.
<p>
This implementation will discard backups rather than place copies on nodes with different attribute values. This
avoids trying to cram more data onto remaining nodes when some have failed.
<p>
A node attribute to compare is provided on construction. Attribute name shouldn't be null.
Note: All cluster nodes, on startup, automatically register all the environment and system properties as node
attributes.
Note: All nodes should have not an empty co-location attribute value. The absence of the attribute on some nodes
will trigger the failure handler.
Note: Node attributes persisted in baseline topology at the time of baseline topology change. If the co-location
attribute of some node was updated, but the baseline topology wasn't changed, the outdated attribute value can be
used by the backup filter when this node left the cluster. To avoid this, the baseline topology should be updated
after changing the co-location attribute.
<p>
This class is constructed with a node attribute name, and a candidate node will be rejected if previously selected
nodes for a partition have a different value for attribute on the candidate node.
</pre>
<h2 class="header">Spring Example</h2>
Create a partitioned cache template plate with 1 backup, where the backup will be placed in the same cell
as the primary. Note: This example requires that the environment variable "CELL" be set appropriately on
each node via some means external to Ignite.
<pre name="code" class="xml">
&lt;property name="cacheConfiguration"&gt;
&lt;list&gt;
&lt;bean id="cache-template-bean" abstract="true" class="org.apache.ignite.configuration.CacheConfiguration"&gt;
&lt;property name="name" value="JobcaseDefaultCacheConfig*"/&gt;
&lt;property name="cacheMode" value="PARTITIONED" /&gt;
&lt;property name="backups" value="1" /&gt;
&lt;property name="affinity"&gt;
&lt;bean class="org.apache.ignite.cache.affinity.rendezvous.RendezvousAffinityFunction"&gt;
&lt;property name="affinityBackupFilter"&gt;
&lt;bean class="org.apache.ignite.cache.affinity.rendezvous.ClusterNodeAttributeColocatedBackupFilter"&gt;
&lt;!-- Backups must go to the same CELL as primary --&gt;
&lt;constructor-arg value="CELL" /&gt;
&lt;/bean&gt;
&lt;/property&gt;
&lt;/bean&gt;
&lt;/property&gt;
&lt;/bean&gt;
&lt;/list&gt;
&lt;/property&gt;
</pre>
<p></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../serialized-form.html#org.apache.ignite.cache.affinity.rendezvous.ClusterNodeAttributeColocatedBackupFilter">Serialized Form</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">&nbsp;</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="../../../../../../org/apache/ignite/cache/affinity/rendezvous/ClusterNodeAttributeColocatedBackupFilter.html#ClusterNodeAttributeColocatedBackupFilter-java.lang.String-">ClusterNodeAttributeColocatedBackupFilter</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attrName)</code>&nbsp;</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">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</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>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/ignite/cache/affinity/rendezvous/ClusterNodeAttributeColocatedBackupFilter.html#apply-org.apache.ignite.cluster.ClusterNode-java.util.List-">apply</a></span>(<a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a>&nbsp;candidate,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a><span class='angle_bracket'>&gt;</span>&nbsp;previouslySelected)</code>
<div class="block">Defines a predicate which returns <code>true</code> if a node is acceptable for a backup
or <code>false</code> otherwise.</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&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.ignite.lang.IgniteBiPredicate">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.ignite.lang.<a href="../../../../../../org/apache/ignite/lang/IgniteBiPredicate.html" title="interface in org.apache.ignite.lang">IgniteBiPredicate</a></h3>
<code><a href="../../../../../../org/apache/ignite/lang/IgniteBiPredicate.html#and-org.apache.ignite.lang.IgniteBiPredicate-">and</a></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="ClusterNodeAttributeColocatedBackupFilter-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ClusterNodeAttributeColocatedBackupFilter</h4>
<pre>public&nbsp;ClusterNodeAttributeColocatedBackupFilter(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attrName)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>attrName</code> - The attribute name for the attribute to compare.</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="apply-org.apache.ignite.cluster.ClusterNode-java.util.List-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>apply</h4>
<pre>public&nbsp;boolean&nbsp;apply(<a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a>&nbsp;candidate,
<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a><span class='angle_bracket'>&gt;</span>&nbsp;previouslySelected)</pre>
<div class="block">Defines a predicate which returns <code>true</code> if a node is acceptable for a backup
or <code>false</code> otherwise. An acceptable node is one where its attribute value
is exact match with previously selected nodes. If an attribute does not
exist on candidate node, then the attribute matches any attribute values of previously
selected nodes. If the attribute does not exist on primary node, then the attribute matches
any attribute value of candidate node.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../org/apache/ignite/lang/IgniteBiPredicate.html#apply-E1-E2-">apply</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../org/apache/ignite/lang/IgniteBiPredicate.html" title="interface in org.apache.ignite.lang">IgniteBiPredicate</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><span class='angle_bracket'>&lt;</span><a href="../../../../../../org/apache/ignite/cluster/ClusterNode.html" title="interface in org.apache.ignite.cluster">ClusterNode</a><span class='angle_bracket'>&gt;</span><span class='angle_bracket'>&gt;</span></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>candidate</code> - A node that is a candidate for becoming a backup node for a partition.</dd>
<dd><code>previouslySelected</code> - A list of primary/backup nodes already chosen for a partition.
The primary is first.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Return value.</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/ClusterNodeAttributeColocatedBackupFilter.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/ignite/cache/affinity/rendezvous/ClusterNodeAttributeAffinityBackupFilter.html" title="class in org.apache.ignite.cache.affinity.rendezvous"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/ignite/cache/affinity/rendezvous/RendezvousAffinityFunction.html" title="class in org.apache.ignite.cache.affinity.rendezvous"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/ignite/cache/affinity/rendezvous/ClusterNodeAttributeColocatedBackupFilter.html" target="_top">Frames</a></li>
<li><a href="ClusterNodeAttributeColocatedBackupFilter.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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><table width="100%" border="0" cellspacing=0 cellpadding=0 style="padding: 5px"> <tr> <td> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <a target=_blank href="https://ignite.apache.org"><nobr>2021 Copyright &#169; Apache Software Foundation</nobr></a> </td> </tr> </tbody> </table> </td> <td width="100%" align="right" valign="center"> <a href="https://twitter.com/ApacheIgnite" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @ApacheIgnite</a> </td> </tr> <tr> <td colspan="2" valign="top" align="left"> <table style="padding-left: 0; margin: 0"> <tbody style="padding: 0; margin: 0"> <tr style="padding: 0; margin: 0"> <td> <b>Ignite Database and Caching Platform</b> </td> <td>:&nbsp;&nbsp; ver. <strong>2.11.0</strong> </td> </tr> <tr style="padding: 0; margin: 0"> <td> <b>Release Date</b> </td> <td>:&nbsp;&nbsp; September 11 2021 </td> </tr> </tbody> </table> </td> </tr> </table></small></p>
</body>
</html>