blob: df5c5ce3d455c5d5cf994f1faf58cff7d91bce24 [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 C++ Reference: apache::geode::client::ResultCollector 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">
/* @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 C++ 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('a00843.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::ResultCollector Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Defines the interface for a container that gathers results from function execution.
<a href="a00843.html#details">More...</a></p>
<p>Inherited by apache::geode::client::DefaultResultCollector.</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:adfb3fb793a4dd7fcec334a083b4f6967"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00843.html#adfb3fb793a4dd7fcec334a083b4f6967">addResult</a> (const std::shared_ptr&lt; <a class="el" href="a00855.html">Cacheable</a> &gt; &amp;resultOfSingleExecution)=0</td></tr>
<tr class="memdesc:adfb3fb793a4dd7fcec334a083b4f6967"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a single function execution result to the <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>. <a href="#adfb3fb793a4dd7fcec334a083b4f6967">More...</a><br /></td></tr>
<tr class="separator:adfb3fb793a4dd7fcec334a083b4f6967"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8454297e6d0407859a1d57a6f95a5d4a"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00843.html#a8454297e6d0407859a1d57a6f95a5d4a">clearResults</a> ()=0</td></tr>
<tr class="memdesc:a8454297e6d0407859a1d57a6f95a5d4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Geode will invoke this method before re-executing function (in case of Function <a class="el" href="a00727.html" title="gathers results from function execution">Execution</a> HA) This is to clear the previous execution results from the result collector. <a href="#a8454297e6d0407859a1d57a6f95a5d4a">More...</a><br /></td></tr>
<tr class="separator:a8454297e6d0407859a1d57a6f95a5d4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a599979d80e433a8e26fb25c29a43e0b3"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00843.html#a599979d80e433a8e26fb25c29a43e0b3">endResults</a> ()=0</td></tr>
<tr class="memdesc:a599979d80e433a8e26fb25c29a43e0b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Geode will invoke this method when function execution has completed and all results for the execution have been obtained and added to the <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>}. <a href="#a599979d80e433a8e26fb25c29a43e0b3">More...</a><br /></td></tr>
<tr class="separator:a599979d80e433a8e26fb25c29a43e0b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9eb6f392dcc27a6053db46bb26508b15"><td class="memItemLeft" align="right" valign="top">virtual std::shared_ptr&lt; <a class="el" href="a00291.html">CacheableVector</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00843.html#a9eb6f392dcc27a6053db46bb26508b15">getResult</a> (std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)=0</td></tr>
<tr class="memdesc:a9eb6f392dcc27a6053db46bb26508b15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the result of function execution, potentially blocking until all the results are available. <a href="#a9eb6f392dcc27a6053db46bb26508b15">More...</a><br /></td></tr>
<tr class="separator:a9eb6f392dcc27a6053db46bb26508b15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f2a157b14b8c21f586c2325776e6e03"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00843.html#a3f2a157b14b8c21f586c2325776e6e03">ResultCollector</a> ()=default</td></tr>
<tr class="memdesc:a3f2a157b14b8c21f586c2325776e6e03"><td class="mdescLeft">&#160;</td><td class="mdescRight">public methods <a href="#a3f2a157b14b8c21f586c2325776e6e03">More...</a><br /></td></tr>
<tr class="separator:a3f2a157b14b8c21f586c2325776e6e03"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Defines the interface for a container that gathers results from function execution. </p>
<p><br />
Geode provides a default implementation for <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>. Applications can choose to implement their own custom <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>. A custom <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a> facilitates result sorting or aggregation. Aggregation functions like sum, minimum, maximum and average can also be applied to the result using a custom <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>. Example: <br />
</p><pre>
auto rc = FunctionService::onRegion(region)
.withArgs(args)
.withFilter(keySet)
.withCollector(new
MyCustomResultCollector())
.execute(Function);
//Application can do something else here before retrieving the result
auto functionResult = rc.getResult();
</pre><dl class="section see"><dt>See also</dt><dd><a class="el" href="a00739.html" title="entry point for function execution">FunctionService</a> </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a3f2a157b14b8c21f586c2325776e6e03"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f2a157b14b8c21f586c2325776e6e03">&#9670;&nbsp;</a></span>ResultCollector()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">apache::geode::client::ResultCollector::ResultCollector </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>public methods </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="adfb3fb793a4dd7fcec334a083b4f6967"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adfb3fb793a4dd7fcec334a083b4f6967">&#9670;&nbsp;</a></span>addResult()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void apache::geode::client::ResultCollector::addResult </td>
<td>(</td>
<td class="paramtype">const std::shared_ptr&lt; <a class="el" href="a00855.html">Cacheable</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>resultOfSingleExecution</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Adds a single function execution result to the <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">resultOfSingleExecution</td><td></td></tr>
</table>
</dd>
</dl>
<dl class="section since"><dt>Since</dt><dd>5.8LA </dd></dl>
</div>
</div>
<a id="a8454297e6d0407859a1d57a6f95a5d4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8454297e6d0407859a1d57a6f95a5d4a">&#9670;&nbsp;</a></span>clearResults()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void apache::geode::client::ResultCollector::clearResults </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Geode will invoke this method before re-executing function (in case of Function <a class="el" href="a00727.html" title="gathers results from function execution">Execution</a> HA) This is to clear the previous execution results from the result collector. </p>
<dl class="section since"><dt>Since</dt><dd>6.5 </dd></dl>
</div>
</div>
<a id="a599979d80e433a8e26fb25c29a43e0b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a599979d80e433a8e26fb25c29a43e0b3">&#9670;&nbsp;</a></span>endResults()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void apache::geode::client::ResultCollector::endResults </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Geode will invoke this method when function execution has completed and all results for the execution have been obtained and added to the <a class="el" href="a00843.html" title="Defines the interface for a container that gathers results from function execution.">ResultCollector</a>}. </p>
</div>
</div>
<a id="a9eb6f392dcc27a6053db46bb26508b15"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9eb6f392dcc27a6053db46bb26508b15">&#9670;&nbsp;</a></span>getResult()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual std::shared_ptr&lt;<a class="el" href="a00291.html">CacheableVector</a>&gt; apache::geode::client::ResultCollector::getResult </td>
<td>(</td>
<td class="paramtype">std::chrono::milliseconds&#160;</td>
<td class="paramname"><em>timeout</em> = <code>DEFAULT_QUERY_RESPONSE_TIMEOUT</code></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the result of function execution, potentially blocking until all the results are available. </p>
<p>If geode sendException is called then <a class="el" href="a00843.html#a9eb6f392dcc27a6053db46bb26508b15">ResultCollector.getResult</a> will not throw exception but will have exception {<a class="el" href="a00879.html">} as a part of results received. timeout if result is not ready within this time, exception will be thrown the result FunctionException if result retrieval fails UserFunctionExecutionException </a></p>
</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 API Documentation</small></address>