| <!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> |
| <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.6"/> |
| <title>Impala: impala::ParallelExecutor 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="navtree.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(initResizable); |
| $(window).load(resizeHeight); |
| </script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/search.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(function() { searchBox.OnSelectItem(0); }); |
| </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 style="padding-left: 0.5em;"> |
| <div id="projectname">Impala |
| </div> |
| <div id="projectbrief">Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.</div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.6 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
| <li><a href="files.html"><span>Files</span></a></li> |
| <li> |
| <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.png" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| </span> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div id="navrow2" class="tabs2"> |
| <ul class="tablist"> |
| <li><a href="annotated.html"><span>Class List</span></a></li> |
| <li><a href="classes.html"><span>Class Index</span></a></li> |
| <li><a href="inherits.html"><span>Class Hierarchy</span></a></li> |
| <li><a href="functions.html"><span>Class Members</span></a></li> |
| </ul> |
| </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"> |
| $(document).ready(function(){initNavTree('classimpala_1_1ParallelExecutor.html','');}); |
| </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)"> |
| <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Macros</a></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-types">Public Types</a> | |
| <a href="#pub-static-methods">Static Public Member Functions</a> | |
| <a href="#pri-static-methods">Static Private Member Functions</a> | |
| <a href="classimpala_1_1ParallelExecutor-members.html">List of all members</a> </div> |
| <div class="headertitle"> |
| <div class="title">impala::ParallelExecutor Class Reference</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| |
| <p><code>#include <<a class="el" href="parallel-executor_8h_source.html">parallel-executor.h</a>></code></p> |
| <div class="dynheader"> |
| Collaboration diagram for impala::ParallelExecutor:</div> |
| <div class="dyncontent"> |
| <div class="center"><iframe scrolling="no" frameborder="0" src="classimpala_1_1ParallelExecutor__coll__graph.svg" width="174" height="104"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div> |
| </div> |
| <table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> |
| Public Types</h2></td></tr> |
| <tr class="memitem:aec48068e9c457c60ccde9b5f20a2e9de"><td class="memItemLeft" align="right" valign="top">typedef boost::function<br class="typebreak"/> |
| < <a class="el" href="classimpala_1_1Status.html">Status</a>(void *arg)> </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1ParallelExecutor.html#aec48068e9c457c60ccde9b5f20a2e9de">Function</a></td></tr> |
| <tr class="separator:aec48068e9c457c60ccde9b5f20a2e9de"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> |
| Static Public Member Functions</h2></td></tr> |
| <tr class="memitem:abad564e6b67909483e30f0ac1c0f30cc"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classimpala_1_1Status.html">Status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1ParallelExecutor.html#abad564e6b67909483e30f0ac1c0f30cc">Exec</a> (<a class="el" href="classimpala_1_1ParallelExecutor.html#aec48068e9c457c60ccde9b5f20a2e9de">Function</a> function, void **args, int num_args, <a class="el" href="classimpala_1_1StatsMetric.html">StatsMetric</a>< double > *latencies=NULL)</td></tr> |
| <tr class="memdesc:abad564e6b67909483e30f0ac1c0f30cc"><td class="mdescLeft"> </td><td class="mdescRight">Callers may pass a <a class="el" href="classimpala_1_1StatsMetric.html">StatsMetric</a> to gather the latency distribution of task execution. <a href="#abad564e6b67909483e30f0ac1c0f30cc">More...</a><br/></td></tr> |
| <tr class="separator:abad564e6b67909483e30f0ac1c0f30cc"><td class="memSeparator" colspan="2"> </td></tr> |
| </table><table class="memberdecls"> |
| <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-static-methods"></a> |
| Static Private Member Functions</h2></td></tr> |
| <tr class="memitem:acd21d8abab7bda0b40c26d7250651e6f"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classimpala_1_1ParallelExecutor.html#acd21d8abab7bda0b40c26d7250651e6f">Worker</a> (<a class="el" href="classimpala_1_1ParallelExecutor.html#aec48068e9c457c60ccde9b5f20a2e9de">Function</a> function, void *arg, boost::mutex *lock, <a class="el" href="classimpala_1_1Status.html">Status</a> *status, <a class="el" href="classimpala_1_1StatsMetric.html">StatsMetric</a>< double > *latencies)</td></tr> |
| <tr class="separator:acd21d8abab7bda0b40c26d7250651e6f"><td class="memSeparator" colspan="2"> </td></tr> |
| </table> |
| <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| <div class="textblock"><p>This is a class that executes multiple functions in parallel with different arguments using a thread pool. TODO: look into an API for this. Boost has one that is in review but not yet official. TODO: use a shared pool? <a class="el" href="classimpala_1_1Thread.html" title="TODO: Consider allowing fragment IDs as category parameters. ">Thread</a> creation is pretty cheap so this might not be worth it TODO: Consider rewriting in terms of <a class="el" href="classimpala_1_1ThreadPool.html">ThreadPool</a> </p> |
| |
| <p>Definition at line <a class="el" href="parallel-executor_8h_source.html#l00033">33</a> of file <a class="el" href="parallel-executor_8h_source.html">parallel-executor.h</a>.</p> |
| </div><h2 class="groupheader">Member Typedef Documentation</h2> |
| <a class="anchor" id="aec48068e9c457c60ccde9b5f20a2e9de"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">typedef boost::function<<a class="el" href="classimpala_1_1Status.html">Status</a> (void* arg)> <a class="el" href="classimpala_1_1ParallelExecutor.html#aec48068e9c457c60ccde9b5f20a2e9de">impala::ParallelExecutor::Function</a></td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Typedef for the underlying function for the work. The function must be thread safe. The function must return a <a class="el" href="classimpala_1_1Status.html">Status</a> indicating if it was successful or not. An example of how this function should be defined would be: static <a class="el" href="classimpala_1_1Status.html">Status</a> Foo::IssueRpc(void* arg); TODO: there might some magical template way to do this with boost that is more type safe. </p> |
| |
| <p>Definition at line <a class="el" href="parallel-executor_8h_source.html#l00042">42</a> of file <a class="el" href="parallel-executor_8h_source.html">parallel-executor.h</a>.</p> |
| |
| </div> |
| </div> |
| <h2 class="groupheader">Member Function Documentation</h2> |
| <a class="anchor" id="abad564e6b67909483e30f0ac1c0f30cc"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname"><a class="el" href="classimpala_1_1Status.html">Status</a> ParallelExecutor::Exec </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1ParallelExecutor.html#aec48068e9c457c60ccde9b5f20a2e9de">Function</a> </td> |
| <td class="paramname"><em>function</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">void ** </td> |
| <td class="paramname"><em>args</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int </td> |
| <td class="paramname"><em>num_args</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StatsMetric.html">StatsMetric</a>< double > * </td> |
| <td class="paramname"><em>latencies</em> = <code>NULL</code> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| |
| <p>Callers may pass a <a class="el" href="classimpala_1_1StatsMetric.html">StatsMetric</a> to gather the latency distribution of task execution. </p> |
| <p>Calls function(args[i]) num_args times in parallel using num_args threads. If any of the work item fails, returns the <a class="el" href="classimpala_1_1Status.html">Status</a> of the first failed work item. Otherwise, returns <a class="el" href="classimpala_1_1Status.html#a580565665ea944eb64f3f495b1bee1e0">Status::OK</a> when all work items have been executed. </p> |
| |
| <p>Definition at line <a class="el" href="parallel-executor_8cc_source.html#l00026">26</a> of file <a class="el" href="parallel-executor_8cc_source.html">parallel-executor.cc</a>.</p> |
| |
| <p>References <a class="el" href="thread_8cc_source.html#l00318">impala::ThreadGroup::AddThread()</a>, <a class="el" href="thread_8cc_source.html#l00327">impala::ThreadGroup::JoinAll()</a>, and <a class="el" href="parallel-executor_8cc_source.html#l00043">Worker()</a>.</p> |
| |
| <p>Referenced by <a class="el" href="parallel-executor-test_8cc_source.html#l00061">impala::TEST()</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="acd21d8abab7bda0b40c26d7250651e6f"></a> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="mlabels"> |
| <tr> |
| <td class="mlabels-left"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">void ParallelExecutor::Worker </td> |
| <td>(</td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1ParallelExecutor.html#aec48068e9c457c60ccde9b5f20a2e9de">Function</a> </td> |
| <td class="paramname"><em>function</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">void * </td> |
| <td class="paramname"><em>arg</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">boost::mutex * </td> |
| <td class="paramname"><em>lock</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1Status.html">Status</a> * </td> |
| <td class="paramname"><em>status</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype"><a class="el" href="classimpala_1_1StatsMetric.html">StatsMetric</a>< double > * </td> |
| <td class="paramname"><em>latencies</em> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td> |
| </tr> |
| </table> |
| </td> |
| <td class="mlabels-right"> |
| <span class="mlabels"><span class="mlabel">static</span><span class="mlabel">private</span></span> </td> |
| </tr> |
| </table> |
| </div><div class="memdoc"> |
| <p>Worker thread function which calls function(arg). This function updates *status taking *lock to synchronize results from different threads. If 'latencies' is not NULL, it is updated with the time elapsed while executing 'function'. </p> |
| |
| <p>Definition at line <a class="el" href="parallel-executor_8cc_source.html#l00043">43</a> of file <a class="el" href="parallel-executor_8cc_source.html">parallel-executor.cc</a>.</p> |
| |
| <p>References <a class="el" href="stopwatch_8h_source.html#l00105">impala::MonotonicStopWatch::ElapsedTime()</a>, <a class="el" href="status_8h_source.html#l00172">impala::Status::ok()</a>, <a class="el" href="stopwatch_8h_source.html#l00081">impala::MonotonicStopWatch::Start()</a>, and <a class="el" href="collection-metrics_8h_source.html#l00112">impala::StatsMetric< T >::Update()</a>.</p> |
| |
| <p>Referenced by <a class="el" href="parallel-executor_8cc_source.html#l00026">Exec()</a>.</p> |
| |
| </div> |
| </div> |
| <hr/>The documentation for this class was generated from the following files:<ul> |
| <li>be/src/runtime/<a class="el" href="parallel-executor_8h_source.html">parallel-executor.h</a></li> |
| <li>be/src/runtime/<a class="el" href="parallel-executor_8cc_source.html">parallel-executor.cc</a></li> |
| </ul> |
| </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="namespaceimpala.html">impala</a></li><li class="navelem"><a class="el" href="classimpala_1_1ParallelExecutor.html">ParallelExecutor</a></li> |
| <li class="footer">Generated on Thu May 7 2015 16:10:49 for Impala by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |