| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <link rel="canonical" href="https://ignite.apache.org/releases/2.2.0/dotnetdoc/class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html" /> |
| <META NAME="ROBOTS" CONTENT="NOINDEX"> |
| |
| <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.9.1"/> |
| <title>Apache Ignite.NET: Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase Class 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="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtreedata.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(initResizable); |
| $(window).load(resizeHeight); |
| </script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| |
| <script> |
| (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| |
| ga('create', 'UA-61232409-1', 'auto'); |
| ga('send', 'pageview'); |
| |
| </script></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 style="padding-left: 0.5em;"> |
| <div id="projectname">Apache Ignite.NET |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.9.1 --> |
| </div><!-- top --> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| <div id="nav-sync" class="sync"></div> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| $(document).ready(function(){initNavTree('class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html','');}); |
| </script> |
| <div id="doc-content"> |
| <div class="header"> |
| <div class="summary"> |
| <a href="#pub-methods">Public Member Functions</a> | |
| <a href="#pub-attribs">Public Attributes</a> | |
| <a href="#properties">Properties</a> | |
| <a href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base-members.html">List of all members</a> </div> |
| <div class="headertitle"> |
| <div class="title">Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase Class Reference</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| |
| <p>Base class for predefined affinity functions. |
| <a href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#details">More...</a></p> |
| <div class="dynheader"> |
| Inheritance diagram for Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase:</div> |
| <div class="dyncontent"> |
| <div class="center"> |
| <img src="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.png" usemap="#Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase_map" alt=""/> |
| <map id="Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase_map" name="Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase_map"> |
| <area href="interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function.html" title="Represents a function that maps cache keys to cluster nodes. " alt="Apache.Ignite.Core.Cache.Affinity.IAffinityFunction" shape="rect" coords="0,0,442,24"/> |
| <area href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_rendezvous_1_1_rendezvous_affinity_function.html" title="Affinity function for partitioned cache based on Highest Random Weight algorithm. ..." alt="Apache.Ignite.Core.Cache.Affinity.Rendezvous.RendezvousAffinityFunction" shape="rect" coords="0,112,442,136"/> |
| </map> |
| </div></div> |
| <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:a30f28dd37716dabd74fdb0e5894cdafc"><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#a30f28dd37716dabd74fdb0e5894cdafc">GetPartition</a> (object key)</td></tr> |
| <tr class="memdesc:a30f28dd37716dabd74fdb0e5894cdafc"><td class="mdescLeft"> </td><td class="mdescRight">Gets partition number for a given key starting from 0. Partitioned caches should make sure that keys are about evenly distributed across all partitions from 0 to <a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#af0941ad1f24436b01af2e5d0383f5443" title="Gets or sets the total number of partitions. ">Partitions</a> for best performance. <a href="#a30f28dd37716dabd74fdb0e5894cdafc">More...</a><br /></td></tr> |
| <tr class="separator:a30f28dd37716dabd74fdb0e5894cdafc"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a383a7b592fe341166f281a8475c0f4b6"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#a383a7b592fe341166f281a8475c0f4b6">RemoveNode</a> (Guid nodeId)</td></tr> |
| <tr class="memdesc:a383a7b592fe341166f281a8475c0f4b6"><td class="mdescLeft"> </td><td class="mdescRight">Removes node from affinity. This method is called when it is safe to remove disconnected node from affinity mapping. <a href="#a383a7b592fe341166f281a8475c0f4b6">More...</a><br /></td></tr> |
| <tr class="separator:a383a7b592fe341166f281a8475c0f4b6"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a3716526edffe67a4d8b3ac057e614cf6"><td class="memItemLeft" align="right" valign="top">virtual IEnumerable< IEnumerable< <a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cluster_1_1_i_cluster_node.html">IClusterNode</a> > > </td><td class="memItemRight" valign="bottom"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#a3716526edffe67a4d8b3ac057e614cf6">AssignPartitions</a> (<a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_context.html">AffinityFunctionContext</a> context)</td></tr> |
| <tr class="memdesc:a3716526edffe67a4d8b3ac057e614cf6"><td class="mdescLeft"> </td><td class="mdescRight">Gets affinity nodes for a partition. In case of replicated cache, all returned nodes are updated in the same manner. In case of partitioned cache, the returned list should contain only the primary and back up nodes with primary node being always first. <pare> Note that partitioned affinity must obey the following contract: given that node <a href="#a3716526edffe67a4d8b3ac057e614cf6">More...</a><br /></td></tr> |
| <tr class="separator:a3716526edffe67a4d8b3ac057e614cf6"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> |
| Public Attributes</h2></td></tr> |
| <tr class="memitem:aa48ff9f371c8e6a026d02b9d24df1a91"><td class="memItemLeft" align="right" valign="top">const int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#aa48ff9f371c8e6a026d02b9d24df1a91">DefaultPartitions</a> = 1024</td></tr> |
| <tr class="memdesc:aa48ff9f371c8e6a026d02b9d24df1a91"><td class="mdescLeft"> </td><td class="mdescRight">The default value for <a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#af0941ad1f24436b01af2e5d0383f5443" title="Gets or sets the total number of partitions. ">Partitions</a> property. <a href="#aa48ff9f371c8e6a026d02b9d24df1a91">More...</a><br /></td></tr> |
| <tr class="separator:aa48ff9f371c8e6a026d02b9d24df1a91"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="properties"></a> |
| Properties</h2></td></tr> |
| <tr class="memitem:af0941ad1f24436b01af2e5d0383f5443"><td class="memItemLeft" align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#af0941ad1f24436b01af2e5d0383f5443">Partitions</a><code> [get, set]</code></td></tr> |
| <tr class="memdesc:af0941ad1f24436b01af2e5d0383f5443"><td class="mdescLeft"> </td><td class="mdescRight">Gets or sets the total number of partitions. <a href="#af0941ad1f24436b01af2e5d0383f5443">More...</a><br /></td></tr> |
| <tr class="separator:af0941ad1f24436b01af2e5d0383f5443"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="memitem:a711f4498579a993203893833687204af"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html#a711f4498579a993203893833687204af">ExcludeNeighbors</a><code> [get, set]</code></td></tr> |
| <tr class="memdesc:a711f4498579a993203893833687204af"><td class="mdescLeft"> </td><td class="mdescRight">Gets or sets a value indicating whether to exclude same-host-neighbors from being backups of each other. <a href="#a711f4498579a993203893833687204af">More...</a><br /></td></tr> |
| <tr class="separator:a711f4498579a993203893833687204af"><td class="memSeparator" colspan="2"> </td></tr> |
| <tr class="inherit_header properties_interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function"><td colspan="2" onclick="javascript:toggleInherit('properties_interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function')"><img src="closed.png" alt="-"/> Properties inherited from <a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function.html">Apache.Ignite.Core.Cache.Affinity.IAffinityFunction</a></td></tr> |
| <tr class="memitem:a35d160ca20050641171048473746306f inherit properties_interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function.html#a35d160ca20050641171048473746306f">Partitions</a><code> [get]</code></td></tr> |
| <tr class="memdesc:a35d160ca20050641171048473746306f inherit properties_interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function"><td class="mdescLeft"> </td><td class="mdescRight">Gets the total number of partitions. <a href="#a35d160ca20050641171048473746306f">More...</a><br /></td></tr> |
| <tr class="separator:a35d160ca20050641171048473746306f inherit properties_interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function"><td class="memSeparator" colspan="2"> </td></tr> |
| </table> |
| <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| <div class="textblock"></div><h2 class="groupheader">Member Function Documentation</h2> |
| <a class="anchor" id="a3716526edffe67a4d8b3ac057e614cf6"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual IEnumerable<IEnumerable<<a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cluster_1_1_i_cluster_node.html">IClusterNode</a>> > Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.AssignPartitions </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_context.html">AffinityFunctionContext</a> </td> |
| <td class="paramname"><em>context</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">virtual</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p><code>N</code> is primary for some key <code>K</code>, if any other node(s) leave grid and no node joins grid, node <code>N</code> will remain primary for key <code>K</code>. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">context</td><td>The affinity function context.</td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>A collection of partitions, where each partition is a collection of nodes, where first node is a primary node, and other nodes are backup nodes. </dd></dl> |
| |
| <p>Implements <a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function.html#a6c72007bd20c58de58c8a194fbbc690f">Apache.Ignite.Core.Cache.Affinity.IAffinityFunction</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a30f28dd37716dabd74fdb0e5894cdafc"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual int Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.GetPartition </td> |
| <td>(</td> |
| <td class="paramtype">object </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">virtual</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Note that for fully replicated caches it is possible to segment key sets among different grid node groups. In that case each node group should return a unique partition number. However, unlike partitioned cache, mappings of keys to nodes in replicated caches are constant and a node cannot migrate from one partition to another. </p> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">key</td><td>Key to get partition for.</td></tr> |
| </table> |
| </dd> |
| </dl> |
| <dl class="section return"><dt>Returns</dt><dd>Partition number for a given key. </dd></dl> |
| |
| <p>Implements <a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function.html#ab925b9d86321a855499acb36f5d734eb">Apache.Ignite.Core.Cache.Affinity.IAffinityFunction</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="a383a7b592fe341166f281a8475c0f4b6"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual void Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.RemoveNode </td> |
| <td>(</td> |
| <td class="paramtype">Guid </td> |
| <td class="paramname"><em>nodeId</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">virtual</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <dl class="params"><dt>Parameters</dt><dd> |
| <table class="params"> |
| <tr><td class="paramname">nodeId</td><td>The node identifier.</td></tr> |
| </table> |
| </dd> |
| </dl> |
| |
| <p>Implements <a class="el" href="interface_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_i_affinity_function.html#ad72080a914f72e057787487b6d02ed24">Apache.Ignite.Core.Cache.Affinity.IAffinityFunction</a>.</p> |
| |
| </div> |
| </div> |
| <h2 class="groupheader">Member Data Documentation</h2> |
| <a class="anchor" id="aa48ff9f371c8e6a026d02b9d24df1a91"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">const int Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.DefaultPartitions = 1024</td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| </div> |
| </div> |
| <h2 class="groupheader">Property Documentation</h2> |
| <a class="anchor" id="a711f4498579a993203893833687204af"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual bool Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.ExcludeNeighbors</td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| </div> |
| </div> |
| <a class="anchor" id="af0941ad1f24436b01af2e5d0383f5443"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">virtual int Apache.Ignite.Core.Cache.Affinity.AffinityFunctionBase.Partitions</td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">get</span><span class="mlabel">set</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| </div> |
| </div> |
| </div><!-- contents --> |
| </div><!-- doc-content --> |
| <!-- start footer part --> |
| <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| <ul> |
| <li class="navelem"><a class="el" href="namespace_apache.html">Apache</a></li><li class="navelem"><a class="el" href="namespace_apache_1_1_ignite.html">Ignite</a></li><li class="navelem"><a class="el" href="namespace_apache_1_1_ignite_1_1_core.html">Core</a></li><li class="navelem"><a class="el" href="namespace_apache_1_1_ignite_1_1_core_1_1_cache.html">Cache</a></li><li class="navelem"><a class="el" href="namespace_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity.html">Affinity</a></li><li class="navelem"><a class="el" href="class_apache_1_1_ignite_1_1_core_1_1_cache_1_1_affinity_1_1_affinity_function_base.html">AffinityFunctionBase</a></li> |
| <li class="footer">Generated on Fri Sep 15 2017 11:37:29 for Apache Ignite.NET by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |