blob: 11da869cc6c4e5758c892b3af2b86684f7e74d9f [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++: cache_affinity.h Source File</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="dir_1d5505cee217f179c88903b7091c150e.html">cache</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">cache_affinity.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="cache__affinity_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one or more</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> * this work for additional information regarding copyright ownership.</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> * the License. You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * limitations under the License.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#ifndef _IGNITE_CACHE_AFFINITY</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#define _IGNITE_CACHE_AFFINITY</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="cluster__group_8h.html">ignite/cluster/cluster_group.h</a>&gt;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;ignite/impl/cache/cache_affinity_impl.h&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceignite.html">ignite</a></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;{</div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160; <span class="keyword">namespace </span>cache</div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160; {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> K&gt;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html"> 42</a></span>&#160; <span class="keyword">class </span>IGNITE_IMPORT_EXPORT <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html">CacheAffinity</a></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; {</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#accaf60de01c8528522005c56389a0adf"> 50</a></span>&#160; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#accaf60de01c8528522005c56389a0adf">CacheAffinity</a>(impl::cache::SP_CacheAffinityImpl impl) :</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; impl(impl)</div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; {</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; <span class="comment">// No-op.</span></div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; }</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a1dbd0b4576f2d364c7d14d12959acc95"> 61</a></span>&#160; int32_t <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a1dbd0b4576f2d364c7d14d12959acc95">GetPartitions</a>()</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; {</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;GetPartitions();</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; }</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a5b2cfe47ec67838b71a5f1fef49ebf0e"> 72</a></span>&#160; int32_t <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a5b2cfe47ec67838b71a5f1fef49ebf0e">GetPartition</a>(<span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; {</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;GetPartition(key);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; }</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#ab07b5a7df158144ca9234eb76cff9655"> 84</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#ab07b5a7df158144ca9234eb76cff9655">IsPrimary</a>(<a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node, <span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; {</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;IsPrimary(node, key);</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a3424118df8325fb2d2a9123252599d3f"> 96</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a3424118df8325fb2d2a9123252599d3f">IsBackup</a>(<a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node, <span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; {</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;IsBackup(node, key);</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; }</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a58c6fd46ff1a01e3720ee1067bc01e11"> 111</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a58c6fd46ff1a01e3720ee1067bc01e11">IsPrimaryOrBackup</a>(<a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node, <span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; {</div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;IsPrimaryOrBackup(node, key);</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; }</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a51ea207c3d275f3e04201960cbb5e9f2"> 122</a></span>&#160; std::vector&lt;int32_t&gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a51ea207c3d275f3e04201960cbb5e9f2">GetPrimaryPartitions</a>(<a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node)</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; {</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;GetPrimaryPartitions(node);</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; }</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a7b38290ebc087346067582282be106d2"> 133</a></span>&#160; std::vector&lt;int32_t&gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a7b38290ebc087346067582282be106d2">GetBackupPartitions</a>(<a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node)</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; {</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;GetBackupPartitions(node);</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; }</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; </div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a5a98c7765a84bde95a157fd466c05454"> 144</a></span>&#160; std::vector&lt;int32_t&gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a5a98c7765a84bde95a157fd466c05454">GetAllPartitions</a>(<a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> node)</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; {</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;GetAllPartitions(node);</div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; }</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> TR&gt;</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a451b14193f627a15308f6a54b97f00ba"> 158</a></span>&#160; TR <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a451b14193f627a15308f6a54b97f00ba">GetAffinityKey</a>(<span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; {</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;template GetAffinityKey&lt;K, TR&gt;(key);</div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; }</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a0ee17ede8472a156c68d49eee1b5a974"> 171</a></span>&#160; std::map&lt;cluster::ClusterNode, std::vector&lt;K&gt; &gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a0ee17ede8472a156c68d49eee1b5a974">MapKeysToNodes</a>(<span class="keyword">const</span> std::vector&lt;K&gt;&amp; keys)</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; {</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;MapKeysToNodes(keys);</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; }</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#ac540f4e1e24c9557d3ef746c12573d2b"> 184</a></span>&#160; <a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#ac540f4e1e24c9557d3ef746c12573d2b">MapKeyToNode</a>(<span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; {</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;MapKeyToNode(key);</div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; }</div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; </div>
<div class="line"><a name="l00196"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#abc1dcb54eccd4ff731bf09502ce1231f"> 196</a></span>&#160; std::vector&lt;cluster::ClusterNode&gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#abc1dcb54eccd4ff731bf09502ce1231f">MapKeyToPrimaryAndBackups</a>(<span class="keyword">const</span> K&amp; key)</div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; {</div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;MapKeyToPrimaryAndBackups(key);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; }</div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; </div>
<div class="line"><a name="l00207"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#aab064b93b74c35f41e7b0bb4dbeb47db"> 207</a></span>&#160; <a class="code" href="classignite_1_1cluster_1_1ClusterNode.html">cluster::ClusterNode</a> <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#aab064b93b74c35f41e7b0bb4dbeb47db">MapPartitionToNode</a>(int32_t part)</div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; {</div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;MapPartitionToNode(part);</div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; }</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; </div>
<div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#a7e1d1088d8dc6065e1062ddefaf1942d"> 218</a></span>&#160; std::map&lt;int32_t, cluster::ClusterNode&gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#a7e1d1088d8dc6065e1062ddefaf1942d">MapPartitionsToNodes</a>(<span class="keyword">const</span> std::vector&lt;int32_t&gt;&amp; parts)</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; {</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;MapPartitionsToNodes(parts);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; }</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; </div>
<div class="line"><a name="l00230"></a><span class="lineno"><a class="line" href="classignite_1_1cache_1_1CacheAffinity.html#aa39489d9bdc4dfd9963cae85fe1f0b58"> 230</a></span>&#160; std::vector&lt;cluster::ClusterNode&gt; <a class="code" href="classignite_1_1cache_1_1CacheAffinity.html#aa39489d9bdc4dfd9963cae85fe1f0b58">MapPartitionToPrimaryAndBackups</a>(int32_t part)</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; {</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keywordflow">return</span> impl.Get()-&gt;MapPartitionToPrimaryAndBackups(part);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; }</div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; impl::cache::SP_CacheAffinityImpl impl;</div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; };</div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; }</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;}</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160;<span class="preprocessor">#endif //_IGNITE_CACHE_AFFINITY</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a3424118df8325fb2d2a9123252599d3f"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a3424118df8325fb2d2a9123252599d3f">ignite::cache::CacheAffinity::IsBackup</a></div><div class="ttdeci">bool IsBackup(cluster::ClusterNode node, const K &amp;key)</div><div class="ttdoc">Return true if local node is one of the backup nodes for given key.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:96</div></div>
<div class="ttc" id="anamespaceignite_html"><div class="ttname"><a href="namespaceignite.html">ignite</a></div><div class="ttdoc">Apache Ignite API.</div><div class="ttdef"><b>Definition:</b> cache.h:48</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a5a98c7765a84bde95a157fd466c05454"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a5a98c7765a84bde95a157fd466c05454">ignite::cache::CacheAffinity::GetAllPartitions</a></div><div class="ttdeci">std::vector&lt; int32_t &gt; GetAllPartitions(cluster::ClusterNode node)</div><div class="ttdoc">Get partition ids for which given cluster node has any ownership (either primary or backup).</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:144</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_ab07b5a7df158144ca9234eb76cff9655"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#ab07b5a7df158144ca9234eb76cff9655">ignite::cache::CacheAffinity::IsPrimary</a></div><div class="ttdeci">bool IsPrimary(cluster::ClusterNode node, const K &amp;key)</div><div class="ttdoc">Return true if given node is the primary node for given key.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:84</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a51ea207c3d275f3e04201960cbb5e9f2"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a51ea207c3d275f3e04201960cbb5e9f2">ignite::cache::CacheAffinity::GetPrimaryPartitions</a></div><div class="ttdeci">std::vector&lt; int32_t &gt; GetPrimaryPartitions(cluster::ClusterNode node)</div><div class="ttdoc">Get partition ids for which the given cluster node has primary ownership.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:122</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_abc1dcb54eccd4ff731bf09502ce1231f"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#abc1dcb54eccd4ff731bf09502ce1231f">ignite::cache::CacheAffinity::MapKeyToPrimaryAndBackups</a></div><div class="ttdeci">std::vector&lt; cluster::ClusterNode &gt; MapKeyToPrimaryAndBackups(const K &amp;key)</div><div class="ttdoc">Get primary and backup nodes for the key.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:196</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a5b2cfe47ec67838b71a5f1fef49ebf0e"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a5b2cfe47ec67838b71a5f1fef49ebf0e">ignite::cache::CacheAffinity::GetPartition</a></div><div class="ttdeci">int32_t GetPartition(const K &amp;key)</div><div class="ttdoc">Get partition id for the given key.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:72</div></div>
<div class="ttc" id="acluster__group_8h_html"><div class="ttname"><a href="cluster__group_8h.html">cluster_group.h</a></div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a7b38290ebc087346067582282be106d2"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a7b38290ebc087346067582282be106d2">ignite::cache::CacheAffinity::GetBackupPartitions</a></div><div class="ttdeci">std::vector&lt; int32_t &gt; GetBackupPartitions(cluster::ClusterNode node)</div><div class="ttdoc">Get partition ids for which given cluster node has backup ownership.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:133</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_aa39489d9bdc4dfd9963cae85fe1f0b58"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#aa39489d9bdc4dfd9963cae85fe1f0b58">ignite::cache::CacheAffinity::MapPartitionToPrimaryAndBackups</a></div><div class="ttdeci">std::vector&lt; cluster::ClusterNode &gt; MapPartitionToPrimaryAndBackups(int32_t part)</div><div class="ttdoc">Get primary and backup nodes for partition.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:230</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a1dbd0b4576f2d364c7d14d12959acc95"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a1dbd0b4576f2d364c7d14d12959acc95">ignite::cache::CacheAffinity::GetPartitions</a></div><div class="ttdeci">int32_t GetPartitions()</div><div class="ttdoc">Get number of partitions in cache according to configured affinity function.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:61</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a0ee17ede8472a156c68d49eee1b5a974"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a0ee17ede8472a156c68d49eee1b5a974">ignite::cache::CacheAffinity::MapKeysToNodes</a></div><div class="ttdeci">std::map&lt; cluster::ClusterNode, std::vector&lt; K &gt; &gt; MapKeysToNodes(const std::vector&lt; K &gt; &amp;keys)</div><div class="ttdoc">This method provides ability to detect which keys are mapped to which nodes.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:171</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html">ignite::cache::CacheAffinity</a></div><div class="ttdoc">Provides affinity information to detect which node is primary and which nodes are backups for a parti...</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:42</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_aab064b93b74c35f41e7b0bb4dbeb47db"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#aab064b93b74c35f41e7b0bb4dbeb47db">ignite::cache::CacheAffinity::MapPartitionToNode</a></div><div class="ttdeci">cluster::ClusterNode MapPartitionToNode(int32_t part)</div><div class="ttdoc">Get primary node for the given partition.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:207</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a451b14193f627a15308f6a54b97f00ba"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a451b14193f627a15308f6a54b97f00ba">ignite::cache::CacheAffinity::GetAffinityKey</a></div><div class="ttdeci">TR GetAffinityKey(const K &amp;key)</div><div class="ttdoc">Map passed in key to a key which will be used for node affinity.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:158</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a58c6fd46ff1a01e3720ee1067bc01e11"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a58c6fd46ff1a01e3720ee1067bc01e11">ignite::cache::CacheAffinity::IsPrimaryOrBackup</a></div><div class="ttdeci">bool IsPrimaryOrBackup(cluster::ClusterNode node, const K &amp;key)</div><div class="ttdoc">Returns true if local node is primary or one of the backup nodes.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:111</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_accaf60de01c8528522005c56389a0adf"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#accaf60de01c8528522005c56389a0adf">ignite::cache::CacheAffinity::CacheAffinity</a></div><div class="ttdeci">CacheAffinity(impl::cache::SP_CacheAffinityImpl impl)</div><div class="ttdoc">Constructor.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:50</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_a7e1d1088d8dc6065e1062ddefaf1942d"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#a7e1d1088d8dc6065e1062ddefaf1942d">ignite::cache::CacheAffinity::MapPartitionsToNodes</a></div><div class="ttdeci">std::map&lt; int32_t, cluster::ClusterNode &gt; MapPartitionsToNodes(const std::vector&lt; int32_t &gt; &amp;parts)</div><div class="ttdoc">Get primary nodes for the given partitions.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:218</div></div>
<div class="ttc" id="aclassignite_1_1cluster_1_1ClusterNode_html"><div class="ttname"><a href="classignite_1_1cluster_1_1ClusterNode.html">ignite::cluster::ClusterNode</a></div><div class="ttdoc">Interface representing a single cluster node.</div><div class="ttdef"><b>Definition:</b> cluster_node.h:36</div></div>
<div class="ttc" id="aclassignite_1_1cache_1_1CacheAffinity_html_ac540f4e1e24c9557d3ef746c12573d2b"><div class="ttname"><a href="classignite_1_1cache_1_1CacheAffinity.html#ac540f4e1e24c9557d3ef746c12573d2b">ignite::cache::CacheAffinity::MapKeyToNode</a></div><div class="ttdeci">cluster::ClusterNode MapKeyToNode(const K &amp;key)</div><div class="ttdoc">This method provides ability to detect to which primary node the given key is mapped.</div><div class="ttdef"><b>Definition:</b> cache_affinity.h:184</div></div>
<!-- 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>