blob: 864e3cd70e9a2823ed74f1b3ee8a019cf8365def [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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Apache Geode Native .NET Reference: Apache::Geode::Client::IPartitionResolver&lt; TKey, TValue &gt; Interface 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="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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Apache Geode Native .NET Reference
&#160;<span id="projectnumber">1.13.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<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>
</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00962.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> </div>
<div class="headertitle">
<div class="title">Apache::Geode::Client::IPartitionResolver&lt; TKey, TValue &gt; Interface Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Implementers of interface </p><div class="fragment"><div class="line">PartitionResolver</div></div><!-- fragment --><p> enable custom partitioning on the </p><div class="fragment"><div class="line">PartitionedRegion</div></div><!-- fragment --><p>.
<a href="a00962.html#details">More...</a></p>
<p>Inherited by <a class="el" href="a00954.html">Apache::Geode::Client::IFixedPartitionResolver&lt; TKey, TValue &gt;</a>.</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:a8cfa8860467fe4377c35702bf9cd19f5"><td class="memItemLeft" align="right" valign="top">String ^&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00962.html#a8cfa8860467fe4377c35702bf9cd19f5">GetName</a> ()</td></tr>
<tr class="memdesc:a8cfa8860467fe4377c35702bf9cd19f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the PartitionResolver. <a href="#a8cfa8860467fe4377c35702bf9cd19f5">More...</a><br /></td></tr>
<tr class="separator:a8cfa8860467fe4377c35702bf9cd19f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd71c9276c372ad5a4493209679c8c2c"><td class="memItemLeft" align="right" valign="top">Object ^&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00962.html#abd71c9276c372ad5a4493209679c8c2c">GetRoutingObject</a> (<a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^ key)</td></tr>
<tr class="memdesc:abd71c9276c372ad5a4493209679c8c2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">return object associated with entry event which allows the Partitioned Region to store associated data together. <a href="#abd71c9276c372ad5a4493209679c8c2c">More...</a><br /></td></tr>
<tr class="separator:abd71c9276c372ad5a4493209679c8c2c"><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;class TKey, class TValue&gt;<br />
interface Apache::Geode::Client::IPartitionResolver&lt; TKey, TValue &gt;</h3>
<p>Implementers of interface </p><div class="fragment"><div class="line">PartitionResolver</div></div><!-- fragment --><p> enable custom partitioning on the </p><div class="fragment"><div class="line">PartitionedRegion</div></div><!-- fragment --><p>. </p>
<ol type="1">
<li>The Key class or callback arg can implement PartitionResolver interface to enable custom partitioning OR</li>
<li>Configure your own PartitionResolver class in partition attributes (For instance when the Key is a primitive type or String) Implement the appropriate equals - For all implementations, you need to be sure to code the class equals method so it properly verifies equality for the PartitionResolver implementation. This might mean verifying that class names are the same or that the returned routing objects are the same etc.. When you initiate the partitioned region on multiple nodes, <a class="el" href="a00381.html" title="This namespace contains all the Geode .NET classes and utility classes.">Geode</a> uses the equals method to ensure you are using the same PartitionResolver implementation for all of the nodes for the region. <a class="el" href="a00381.html" title="This namespace contains all the Geode .NET classes and utility classes.">Geode</a> uses the routing object's hashCode to determine where the data is being managed. Say, for example, you want to colocate all Trades by month and year.The key is implemented by TradeKey class which also implements the PartitionResolver interface. public class TradeKey implements PartitionResolver {<br />
&amp;nbsp &amp;nbsp private String tradeID;<br />
&amp;nbsp &amp;nbsp private Month month ;<br />
&amp;nbsp &amp;nbsp private Year year ;<br />
</li>
</ol>
<p>&amp;nbsp &amp;nbsp public TradingKey(){ } <br />
&amp;nbsp &amp;nbsp public TradingKey(Month month, Year year){<br />
&amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp this.month = month;<br />
&amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp this.year = year;<br />
&amp;nbsp &amp;nbsp } <br />
&amp;nbsp &amp;nbsp public <a class="el" href="a01114.html" title="This class wraps the native C++ native::Serializable objects as managed ISerializable objects.">Serializable</a> getRoutingObject(EntryOperation key){<br />
&amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp return this.month + this.year;<br />
&amp;nbsp &amp;nbsp }<br />
}<br />
</p>
<p>In the example above, all trade entries with the same month and year are guaranteed to be colocated. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="a01098.html#a89a9e9380e99812e9904e444087b8f3a" title="Sets the PartitionResolver for the RegionAttributes being created.">RegionAttributesFactory.SetPartitionResolver</a>, <a class="el" href="a01010.html#a3593c122dfe46921a119a12081b6ad81" title="Gets the partition resolver for the region.">RegionAttributes.PartitionResolver</a></dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a8cfa8860467fe4377c35702bf9cd19f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8cfa8860467fe4377c35702bf9cd19f5">&#9670;&nbsp;</a></span>GetName()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class TKey , class TValue &gt; </div>
<table class="memname">
<tr>
<td class="memname">String ^ <a class="el" href="a00962.html">Apache::Geode::Client::IPartitionResolver</a>&lt; TKey, TValue &gt;::GetName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the name of the PartitionResolver. </p>
<p>This function does not throw any exception. </p>
<dl class="section return"><dt>Returns</dt><dd>the name of the PartitionResolver </dd></dl>
</div>
</div>
<a id="abd71c9276c372ad5a4493209679c8c2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abd71c9276c372ad5a4493209679c8c2c">&#9670;&nbsp;</a></span>GetRoutingObject()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class TKey , class TValue &gt; </div>
<table class="memname">
<tr>
<td class="memname">Object ^ <a class="el" href="a00962.html">Apache::Geode::Client::IPartitionResolver</a>&lt; TKey, TValue &gt;::GetRoutingObject </td>
<td>(</td>
<td class="paramtype"><a class="el" href="a00618.html">EntryEvent</a>&lt; TKey, TValue &gt;^&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>return object associated with entry event which allows the Partitioned Region to store associated data together. </p>
<p>throws RuntimeException - any exception thrown will terminate the operation and the exception will be passed to the calling thread. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">key</td><td>key the detail of the entry event. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<HR><address style="align: right;"><small>Apache Geode C++ Cache .NET API Documentation</small></address>