blob: bca7405147eb4d4d553db6df721d1cebbdc6bbc9 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>&nbsp; Apache Ignite C++: ignite::cache::CacheAffinity&lt; K &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="ignite_logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">&nbsp; Apache Ignite C++
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespaceignite.html">ignite</a></li><li class="navelem"><a class="el" href="namespaceignite_1_1cache.html">cache</a></li><li class="navelem"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">CacheAffinity</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classignite_1_1cache_1_1CacheAffinity-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">ignite::cache::CacheAffinity&lt; K &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Provides affinity information to detect which node is primary and which nodes are backups for a partitioned or replicated cache.
<a href="classignite_1_1cache_1_1CacheAffinity.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="cache__affinity_8h_source.html">cache_affinity.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:accaf60de01c8528522005c56389a0adf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#accaf60de01c8528522005c56389a0adf">CacheAffinity</a> (impl::cache::SP_CacheAffinityImpl impl)</td></tr>
<tr class="memdesc:accaf60de01c8528522005c56389a0adf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <a href="classignite_1_1cache_1_1CacheAffinity.html#accaf60de01c8528522005c56389a0adf">More...</a><br /></td></tr>
<tr class="separator:accaf60de01c8528522005c56389a0adf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dbd0b4576f2d364c7d14d12959acc95"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a1dbd0b4576f2d364c7d14d12959acc95">GetPartitions</a> ()</td></tr>
<tr class="memdesc:a1dbd0b4576f2d364c7d14d12959acc95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get number of partitions in cache according to configured affinity function. <a href="classignite_1_1cache_1_1CacheAffinity.html#a1dbd0b4576f2d364c7d14d12959acc95">More...</a><br /></td></tr>
<tr class="separator:a1dbd0b4576f2d364c7d14d12959acc95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b2cfe47ec67838b71a5f1fef49ebf0e"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a5b2cfe47ec67838b71a5f1fef49ebf0e">GetPartition</a> (const K &amp;key)</td></tr>
<tr class="memdesc:a5b2cfe47ec67838b71a5f1fef49ebf0e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get partition id for the given key. <a href="classignite_1_1cache_1_1CacheAffinity.html#a5b2cfe47ec67838b71a5f1fef49ebf0e">More...</a><br /></td></tr>
<tr class="separator:a5b2cfe47ec67838b71a5f1fef49ebf0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab07b5a7df158144ca9234eb76cff9655"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#ab07b5a7df158144ca9234eb76cff9655">IsPrimary</a> (<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node, const K &amp;key)</td></tr>
<tr class="memdesc:ab07b5a7df158144ca9234eb76cff9655"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if given node is the primary node for given key. <a href="classignite_1_1cache_1_1CacheAffinity.html#ab07b5a7df158144ca9234eb76cff9655">More...</a><br /></td></tr>
<tr class="separator:ab07b5a7df158144ca9234eb76cff9655"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3424118df8325fb2d2a9123252599d3f"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a3424118df8325fb2d2a9123252599d3f">IsBackup</a> (<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node, const K &amp;key)</td></tr>
<tr class="memdesc:a3424118df8325fb2d2a9123252599d3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if local node is one of the backup nodes for given key. <a href="classignite_1_1cache_1_1CacheAffinity.html#a3424118df8325fb2d2a9123252599d3f">More...</a><br /></td></tr>
<tr class="separator:a3424118df8325fb2d2a9123252599d3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58c6fd46ff1a01e3720ee1067bc01e11"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a58c6fd46ff1a01e3720ee1067bc01e11">IsPrimaryOrBackup</a> (<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node, const K &amp;key)</td></tr>
<tr class="memdesc:a58c6fd46ff1a01e3720ee1067bc01e11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if local node is primary or one of the backup nodes. <a href="classignite_1_1cache_1_1CacheAffinity.html#a58c6fd46ff1a01e3720ee1067bc01e11">More...</a><br /></td></tr>
<tr class="separator:a58c6fd46ff1a01e3720ee1067bc01e11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51ea207c3d275f3e04201960cbb5e9f2"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a51ea207c3d275f3e04201960cbb5e9f2">GetPrimaryPartitions</a> (<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node)</td></tr>
<tr class="memdesc:a51ea207c3d275f3e04201960cbb5e9f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get partition ids for which the given cluster node has primary ownership. <a href="classignite_1_1cache_1_1CacheAffinity.html#a51ea207c3d275f3e04201960cbb5e9f2">More...</a><br /></td></tr>
<tr class="separator:a51ea207c3d275f3e04201960cbb5e9f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b38290ebc087346067582282be106d2"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a7b38290ebc087346067582282be106d2">GetBackupPartitions</a> (<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node)</td></tr>
<tr class="memdesc:a7b38290ebc087346067582282be106d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get partition ids for which given cluster node has backup ownership. <a href="classignite_1_1cache_1_1CacheAffinity.html#a7b38290ebc087346067582282be106d2">More...</a><br /></td></tr>
<tr class="separator:a7b38290ebc087346067582282be106d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a98c7765a84bde95a157fd466c05454"><td class="memItemLeft" align="right" valign="top">std::vector&lt; int32_t &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a5a98c7765a84bde95a157fd466c05454">GetAllPartitions</a> (<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node)</td></tr>
<tr class="memdesc:a5a98c7765a84bde95a157fd466c05454"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get partition ids for which given cluster node has any ownership (either primary or backup). <a href="classignite_1_1cache_1_1CacheAffinity.html#a5a98c7765a84bde95a157fd466c05454">More...</a><br /></td></tr>
<tr class="separator:a5a98c7765a84bde95a157fd466c05454"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a451b14193f627a15308f6a54b97f00ba"><td class="memTemplParams" colspan="2">template&lt;typename TR &gt; </td></tr>
<tr class="memitem:a451b14193f627a15308f6a54b97f00ba"><td class="memTemplItemLeft" align="right" valign="top">TR&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a451b14193f627a15308f6a54b97f00ba">GetAffinityKey</a> (const K &amp;key)</td></tr>
<tr class="memdesc:a451b14193f627a15308f6a54b97f00ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Map passed in key to a key which will be used for node affinity. <a href="classignite_1_1cache_1_1CacheAffinity.html#a451b14193f627a15308f6a54b97f00ba">More...</a><br /></td></tr>
<tr class="separator:a451b14193f627a15308f6a54b97f00ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ee17ede8472a156c68d49eee1b5a974"><td class="memItemLeft" align="right" valign="top">std::map&lt; <a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>, std::vector&lt; K &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a0ee17ede8472a156c68d49eee1b5a974">MapKeysToNodes</a> (const std::vector&lt; K &gt; &amp;keys)</td></tr>
<tr class="memdesc:a0ee17ede8472a156c68d49eee1b5a974"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method provides ability to detect which keys are mapped to which nodes. <a href="classignite_1_1cache_1_1CacheAffinity.html#a0ee17ede8472a156c68d49eee1b5a974">More...</a><br /></td></tr>
<tr class="separator:a0ee17ede8472a156c68d49eee1b5a974"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac540f4e1e24c9557d3ef746c12573d2b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#ac540f4e1e24c9557d3ef746c12573d2b">MapKeyToNode</a> (const K &amp;key)</td></tr>
<tr class="memdesc:ac540f4e1e24c9557d3ef746c12573d2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method provides ability to detect to which primary node the given key is mapped. <a href="classignite_1_1cache_1_1CacheAffinity.html#ac540f4e1e24c9557d3ef746c12573d2b">More...</a><br /></td></tr>
<tr class="separator:ac540f4e1e24c9557d3ef746c12573d2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc1dcb54eccd4ff731bf09502ce1231f"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#abc1dcb54eccd4ff731bf09502ce1231f">MapKeyToPrimaryAndBackups</a> (const K &amp;key)</td></tr>
<tr class="memdesc:abc1dcb54eccd4ff731bf09502ce1231f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get primary and backup nodes for the key. <a href="classignite_1_1cache_1_1CacheAffinity.html#abc1dcb54eccd4ff731bf09502ce1231f">More...</a><br /></td></tr>
<tr class="separator:abc1dcb54eccd4ff731bf09502ce1231f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aab064b93b74c35f41e7b0bb4dbeb47db"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#aab064b93b74c35f41e7b0bb4dbeb47db">MapPartitionToNode</a> (int32_t part)</td></tr>
<tr class="memdesc:aab064b93b74c35f41e7b0bb4dbeb47db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get primary node for the given partition. <a href="classignite_1_1cache_1_1CacheAffinity.html#aab064b93b74c35f41e7b0bb4dbeb47db">More...</a><br /></td></tr>
<tr class="separator:aab064b93b74c35f41e7b0bb4dbeb47db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e1d1088d8dc6065e1062ddefaf1942d"><td class="memItemLeft" align="right" valign="top">std::map&lt; int32_t, <a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#a7e1d1088d8dc6065e1062ddefaf1942d">MapPartitionsToNodes</a> (const std::vector&lt; int32_t &gt; &amp;parts)</td></tr>
<tr class="memdesc:a7e1d1088d8dc6065e1062ddefaf1942d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get primary nodes for the given partitions. <a href="classignite_1_1cache_1_1CacheAffinity.html#a7e1d1088d8dc6065e1062ddefaf1942d">More...</a><br /></td></tr>
<tr class="separator:a7e1d1088d8dc6065e1062ddefaf1942d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa39489d9bdc4dfd9963cae85fe1f0b58"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html#aa39489d9bdc4dfd9963cae85fe1f0b58">MapPartitionToPrimaryAndBackups</a> (int32_t part)</td></tr>
<tr class="memdesc:aa39489d9bdc4dfd9963cae85fe1f0b58"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get primary and backup nodes for partition. <a href="classignite_1_1cache_1_1CacheAffinity.html#aa39489d9bdc4dfd9963cae85fe1f0b58">More...</a><br /></td></tr>
<tr class="separator:aa39489d9bdc4dfd9963cae85fe1f0b58"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename K&gt;<br />
class ignite::cache::CacheAffinity&lt; K &gt;</h3>
<p>Provides affinity information to detect which node is primary and which nodes are backups for a partitioned or replicated cache. </p>
<p>You can get an instance of this interface by calling Ignite.GetAffinity(cacheName) method.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">K</td><td><a class="el" href="classignite_1_1cache_1_1Cache.html" title="Main entry point for all Data Grid APIs.">Cache</a> affinity key type. </td></tr>
</table>
</dd>
</dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="accaf60de01c8528522005c56389a0adf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#accaf60de01c8528522005c56389a0adf">&#9670;&nbsp;</a></span>CacheAffinity()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::<a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">CacheAffinity</a> </td>
<td>(</td>
<td class="paramtype">impl::cache::SP_CacheAffinityImpl&#160;</td>
<td class="paramname"><em>impl</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">impl</td><td>Pointer to cache affinity implementation. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a451b14193f627a15308f6a54b97f00ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a451b14193f627a15308f6a54b97f00ba">&#9670;&nbsp;</a></span>GetAffinityKey()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<div class="memtemplate">
template&lt;typename TR &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">TR <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::GetAffinityKey </td>
<td>(</td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Map passed in key to a key which will be used for node affinity. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
<table class="tparams">
<tr><td class="paramname">TR</td><td>Key to be used for node-to-affinity mapping type.</td></tr>
</table>
</dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>Key to map. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Key to be used for node-to-affinity mapping (may be the same key as passed in). </dd></dl>
</div>
</div>
<a id="a5a98c7765a84bde95a157fd466c05454"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a98c7765a84bde95a157fd466c05454">&#9670;&nbsp;</a></span>GetAllPartitions()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;int32_t&gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::GetAllPartitions </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td>
<td class="paramname"><em>node</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get partition ids for which given cluster node has any ownership (either primary or backup). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Cluster node. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Container of partition ids for which given cluster node has any ownership (either primary or backup). </dd></dl>
</div>
</div>
<a id="a7b38290ebc087346067582282be106d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b38290ebc087346067582282be106d2">&#9670;&nbsp;</a></span>GetBackupPartitions()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;int32_t&gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::GetBackupPartitions </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td>
<td class="paramname"><em>node</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get partition ids for which given cluster node has backup ownership. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Cluster node. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Container of partition ids for which given cluster node has backup ownership. </dd></dl>
</div>
</div>
<a id="a5b2cfe47ec67838b71a5f1fef49ebf0e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b2cfe47ec67838b71a5f1fef49ebf0e">&#9670;&nbsp;</a></span>GetPartition()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::GetPartition </td>
<td>(</td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get partition id for the given key. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>Key to get partition id for. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Partition id. </dd></dl>
</div>
</div>
<a id="a1dbd0b4576f2d364c7d14d12959acc95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1dbd0b4576f2d364c7d14d12959acc95">&#9670;&nbsp;</a></span>GetPartitions()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::GetPartitions </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get number of partitions in cache according to configured affinity function. </p>
<dl class="section return"><dt>Returns</dt><dd>Number of partitions. </dd></dl>
</div>
</div>
<a id="a51ea207c3d275f3e04201960cbb5e9f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51ea207c3d275f3e04201960cbb5e9f2">&#9670;&nbsp;</a></span>GetPrimaryPartitions()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;int32_t&gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::GetPrimaryPartitions </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td>
<td class="paramname"><em>node</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get partition ids for which the given cluster node has primary ownership. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Cluster node. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Container of partition ids for which the given cluster node has primary ownership. </dd></dl>
</div>
</div>
<a id="a3424118df8325fb2d2a9123252599d3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3424118df8325fb2d2a9123252599d3f">&#9670;&nbsp;</a></span>IsBackup()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::IsBackup </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return true if local node is one of the backup nodes for given key. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Cluster node. </td></tr>
<tr><td class="paramname">key</td><td>Key to check. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if local node is one of the backup nodes for given key. </dd></dl>
</div>
</div>
<a id="ab07b5a7df158144ca9234eb76cff9655"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab07b5a7df158144ca9234eb76cff9655">&#9670;&nbsp;</a></span>IsPrimary()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::IsPrimary </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return true if given node is the primary node for given key. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Cluster node. </td></tr>
<tr><td class="paramname">key</td><td>Key to check. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if given node is primary node for given key. </dd></dl>
</div>
</div>
<a id="a58c6fd46ff1a01e3720ee1067bc01e11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a58c6fd46ff1a01e3720ee1067bc01e11">&#9670;&nbsp;</a></span>IsPrimaryOrBackup()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::IsPrimaryOrBackup </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&#160;</td>
<td class="paramname"><em>node</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns true if local node is primary or one of the backup nodes. </p>
<p>This method is essentially equivalent to calling "isPrimary(ClusterNode, Object) || isBackup(ClusterNode, Object))", however it is more efficient as it makes both checks at once.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">node</td><td>Cluster node. </td></tr>
<tr><td class="paramname">key</td><td>Key to check. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if local node is primary or one of the backup nodes. </dd></dl>
</div>
</div>
<a id="a0ee17ede8472a156c68d49eee1b5a974"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ee17ede8472a156c68d49eee1b5a974">&#9670;&nbsp;</a></span>MapKeysToNodes()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::map&lt;<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>, std::vector&lt;K&gt; &gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::MapKeysToNodes </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; K &gt; &amp;&#160;</td>
<td class="paramname"><em>keys</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method provides ability to detect which keys are mapped to which nodes. </p>
<p>Use it to determine which nodes are storing which keys prior to sending jobs that access these keys.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">keys</td><td>Keys to map to nodes. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Map of nodes to keys or empty map if there are no alive nodes for this cache. </dd></dl>
</div>
</div>
<a id="ac540f4e1e24c9557d3ef746c12573d2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac540f4e1e24c9557d3ef746c12573d2b">&#9670;&nbsp;</a></span>MapKeyToNode()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::MapKeyToNode </td>
<td>(</td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>This method provides ability to detect to which primary node the given key is mapped. </p>
<p>Use it to determine which nodes are storing which keys prior to sending jobs that access these keys.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>Key to map to node. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Primary node for the key. </dd></dl>
</div>
</div>
<a id="abc1dcb54eccd4ff731bf09502ce1231f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc1dcb54eccd4ff731bf09502ce1231f">&#9670;&nbsp;</a></span>MapKeyToPrimaryAndBackups()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::MapKeyToPrimaryAndBackups </td>
<td>(</td>
<td class="paramtype">const K &amp;&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get primary and backup nodes for the key. </p>
<p>Note that primary node is always first in the returned collection.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>Key to map to nodes. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Collection of cluster nodes. </dd></dl>
</div>
</div>
<a id="a7e1d1088d8dc6065e1062ddefaf1942d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e1d1088d8dc6065e1062ddefaf1942d">&#9670;&nbsp;</a></span>MapPartitionsToNodes()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::map&lt;int32_t, <a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::MapPartitionsToNodes </td>
<td>(</td>
<td class="paramtype">const std::vector&lt; int32_t &gt; &amp;&#160;</td>
<td class="paramname"><em>parts</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get primary nodes for the given partitions. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">parts</td><td>Partition ids. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Mapping of given partitions to their primary nodes. </dd></dl>
</div>
</div>
<a id="aab064b93b74c35f41e7b0bb4dbeb47db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aab064b93b74c35f41e7b0bb4dbeb47db">&#9670;&nbsp;</a></span>MapPartitionToNode()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::MapPartitionToNode </td>
<td>(</td>
<td class="paramtype">int32_t&#160;</td>
<td class="paramname"><em>part</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get primary node for the given partition. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">part</td><td>Partition id. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Primary node for the given partition. </dd></dl>
</div>
</div>
<a id="aa39489d9bdc4dfd9963cae85fe1f0b58"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa39489d9bdc4dfd9963cae85fe1f0b58">&#9670;&nbsp;</a></span>MapPartitionToPrimaryAndBackups()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename K &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a>&gt; <a class="el" href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a>&lt; K &gt;::MapPartitionToPrimaryAndBackups </td>
<td>(</td>
<td class="paramtype">int32_t&#160;</td>
<td class="paramname"><em>part</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get primary and backup nodes for partition. </p>
<p>Note that primary node is always first in the returned collection.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">part</td><td>Partition to get affinity nodes for. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Collection of primary and backup nodes for partition with primary node always first. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="cache__affinity_8h_source.html">cache_affinity.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 10 2022 11:02:04 for &nbsp; Apache Ignite C++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>