Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > c07f89287b8745f052fcf9bc1067c5c0 > files > 91

kyotocabinet-1.2.29-1.fc14.x86_64.rpm

<!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"/>
<title>Kyoto Cabinet: kyotocabinet::MapReduce Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;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>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespacekyotocabinet.html">kyotocabinet</a>::<a class="el" href="classkyotocabinet_1_1MapReduce.html">MapReduce</a>
  </div>
</div>
<div class="contents">
<h1>kyotocabinet::MapReduce Class Reference</h1><!-- doxytag: class="kyotocabinet::MapReduce" -->
<p><a class="el" href="classkyotocabinet_1_1MapReduce.html" title="MapReduce framework.">MapReduce</a> framework.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;kcdbext.h&gt;</code></p>

<p><a href="classkyotocabinet_1_1MapReduce-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><b>MapChecker</b></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checker for the map process. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce_1_1MapEmitter.html">MapEmitter</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Data emitter for the mapper.  <a href="classkyotocabinet_1_1MapReduce_1_1MapEmitter.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><b>MapVisitor</b></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Visitor for the map process. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><b>MergeLine</b></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Front line of a merging list. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce_1_1ValueIterator.html">ValueIterator</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Value iterator for the reducer.  <a href="classkyotocabinet_1_1MapReduce_1_1ValueIterator.html#_details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201dd">Option</a> { <a class="el" href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201dda7755be537e266017d8b78b3bafb5f1dd">XNOLOCK</a> =  1 &lt;&lt; 0, 
<a class="el" href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201ddaa36e72ad9da0e9ce2a8c31a3a44b9716">XNOCOMP</a> =  1 &lt;&lt; 1
 }</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>Execution options. </p>
 <a href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201dd">More...</a><br/></td></tr>
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#ad94405a7bd1231c5369bdf624eae48ab">MapReduce</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor.  <a href="#ad94405a7bd1231c5369bdf624eae48ab"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#af1add4677e3fe4eae7ac799f8cf110ce">~MapReduce</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#af1add4677e3fe4eae7ac799f8cf110ce"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#a5cba394fcb6361902f12ecc710392ade">map</a> (const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz, <a class="el" href="classkyotocabinet_1_1MapReduce_1_1MapEmitter.html">MapEmitter</a> *emitter)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Map a record data.  <a href="#a5cba394fcb6361902f12ecc710392ade"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#aeab1043e26d29c1cb37c2582ab359821">reduce</a> (const char *kbuf, size_t ksiz, <a class="el" href="classkyotocabinet_1_1MapReduce_1_1ValueIterator.html">ValueIterator</a> *iter)=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Reduce a record data.  <a href="#aeab1043e26d29c1cb37c2582ab359821"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#acf8b6e8bfbd50ca3a226624fac04091d">log</a> (const char *name, const char *message)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Process a log message.  <a href="#acf8b6e8bfbd50ca3a226624fac04091d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#a7aa3490fcb749154f158aec35234b4ce">execute</a> (<a class="el" href="classkyotocabinet_1_1BasicDB.html">BasicDB</a> *db, const std::string &amp;tmppath=&quot;&quot;, uint32_t opts=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Execute the <a class="el" href="classkyotocabinet_1_1MapReduce.html" title="MapReduce framework.">MapReduce</a> process about a database.  <a href="#a7aa3490fcb749154f158aec35234b4ce"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1MapReduce.html#ab8d38fb10c49d2c26d9681910d96dd77">tune_storage</a> (int32_t dbnum, int64_t clim, int64_t cbnum)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the storage configurations.  <a href="#ab8d38fb10c49d2c26d9681910d96dd77"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="classkyotocabinet_1_1MapReduce.html" title="MapReduce framework.">MapReduce</a> framework. </p>
<dl class="note"><dt><b>Note:</b></dt><dd>Although this framework is not distributed or concurrent, it is useful for aggregate calculation with less CPU loading and less memory usage. </dd></dl>
<hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="a59a43dbd3b73c163942960cf87b201dd"></a><!-- doxytag: member="kyotocabinet::MapReduce::Option" ref="a59a43dbd3b73c163942960cf87b201dd" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201dd">kyotocabinet::MapReduce::Option</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Execution options. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="a59a43dbd3b73c163942960cf87b201dda7755be537e266017d8b78b3bafb5f1dd"></a><!-- doxytag: member="XNOLOCK" ref="a59a43dbd3b73c163942960cf87b201dda7755be537e266017d8b78b3bafb5f1dd" args="" -->XNOLOCK</em>&nbsp;</td><td>
<p>avoid locking against update operations </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="a59a43dbd3b73c163942960cf87b201ddaa36e72ad9da0e9ce2a8c31a3a44b9716"></a><!-- doxytag: member="XNOCOMP" ref="a59a43dbd3b73c163942960cf87b201ddaa36e72ad9da0e9ce2a8c31a3a44b9716" args="" -->XNOCOMP</em>&nbsp;</td><td>
<p>avoid compression of temporary databases </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad94405a7bd1231c5369bdf624eae48ab"></a><!-- doxytag: member="kyotocabinet::MapReduce::MapReduce" ref="ad94405a7bd1231c5369bdf624eae48ab" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">kyotocabinet::MapReduce::MapReduce </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constructor. </p>

</div>
</div>
<a class="anchor" id="af1add4677e3fe4eae7ac799f8cf110ce"></a><!-- doxytag: member="kyotocabinet::MapReduce::~MapReduce" ref="af1add4677e3fe4eae7ac799f8cf110ce" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual kyotocabinet::MapReduce::~MapReduce </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a5cba394fcb6361902f12ecc710392ade"></a><!-- doxytag: member="kyotocabinet::MapReduce::map" ref="a5cba394fcb6361902f12ecc710392ade" args="(const char *kbuf, size_t ksiz, const char *vbuf, size_t vsiz, MapEmitter *emitter)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool kyotocabinet::MapReduce::map </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>kbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>ksiz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>vbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>vsiz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classkyotocabinet_1_1MapReduce_1_1MapEmitter.html">MapEmitter</a> *&nbsp;</td>
          <td class="paramname"> <em>emitter</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Map a record data. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>kbuf</em>&nbsp;</td><td>the pointer to the key region. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ksiz</em>&nbsp;</td><td>the size of the key region. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>vbuf</em>&nbsp;</td><td>the pointer to the value region. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>vsiz</em>&nbsp;</td><td>the size of the value region. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>emitter</em>&nbsp;</td><td>the emitter object. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on success, or false on failure. </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>To avoid deadlock, any database operation must not be performed in this function. </dd></dl>

</div>
</div>
<a class="anchor" id="aeab1043e26d29c1cb37c2582ab359821"></a><!-- doxytag: member="kyotocabinet::MapReduce::reduce" ref="aeab1043e26d29c1cb37c2582ab359821" args="(const char *kbuf, size_t ksiz, ValueIterator *iter)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool kyotocabinet::MapReduce::reduce </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>kbuf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>ksiz</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classkyotocabinet_1_1MapReduce_1_1ValueIterator.html">ValueIterator</a> *&nbsp;</td>
          <td class="paramname"> <em>iter</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reduce a record data. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>kbuf</em>&nbsp;</td><td>the pointer to the key region. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>ksiz</em>&nbsp;</td><td>the size of the key region. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>iter</em>&nbsp;</td><td>the iterator to get the values. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on success, or false on failure. </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>Database operations can be performed in this function. </dd></dl>

</div>
</div>
<a class="anchor" id="acf8b6e8bfbd50ca3a226624fac04091d"></a><!-- doxytag: member="kyotocabinet::MapReduce::log" ref="acf8b6e8bfbd50ca3a226624fac04091d" args="(const char *name, const char *message)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool kyotocabinet::MapReduce::log </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>message</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process a log message. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>the name of the event. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>message</em>&nbsp;</td><td>a supplement message. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on success, or false on failure. </dd></dl>

</div>
</div>
<a class="anchor" id="a7aa3490fcb749154f158aec35234b4ce"></a><!-- doxytag: member="kyotocabinet::MapReduce::execute" ref="a7aa3490fcb749154f158aec35234b4ce" args="(BasicDB *db, const std::string &amp;tmppath=&quot;&quot;, uint32_t opts=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool kyotocabinet::MapReduce::execute </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classkyotocabinet_1_1BasicDB.html">BasicDB</a> *&nbsp;</td>
          <td class="paramname"> <em>db</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>tmppath</em> = <code>&quot;&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&nbsp;</td>
          <td class="paramname"> <em>opts</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Execute the <a class="el" href="classkyotocabinet_1_1MapReduce.html" title="MapReduce framework.">MapReduce</a> process about a database. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>db</em>&nbsp;</td><td>the source database. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>tmppath</em>&nbsp;</td><td>the path of a directory for the temporary data storage. If it is an empty string, temporary data are handled on memory. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>opts</em>&nbsp;</td><td>the optional features by bitwise-or: <a class="el" href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201dda7755be537e266017d8b78b3bafb5f1dd" title="avoid locking against update operations">MapReduce::XNOLOCK</a> to avoid locking against update operations by other threads, <a class="el" href="classkyotocabinet_1_1MapReduce.html#a59a43dbd3b73c163942960cf87b201ddaa36e72ad9da0e9ce2a8c31a3a44b9716" title="avoid compression of temporary databases">MapReduce::XNOCOMP</a> to avoid compression of temporary databases. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on success, or false on failure. </dd></dl>

</div>
</div>
<a class="anchor" id="ab8d38fb10c49d2c26d9681910d96dd77"></a><!-- doxytag: member="kyotocabinet::MapReduce::tune_storage" ref="ab8d38fb10c49d2c26d9681910d96dd77" args="(int32_t dbnum, int64_t clim, int64_t cbnum)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void kyotocabinet::MapReduce::tune_storage </td>
          <td>(</td>
          <td class="paramtype">int32_t&nbsp;</td>
          <td class="paramname"> <em>dbnum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int64_t&nbsp;</td>
          <td class="paramname"> <em>clim</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int64_t&nbsp;</td>
          <td class="paramname"> <em>cbnum</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set the storage configurations. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dbnum</em>&nbsp;</td><td>the number of temporary databases. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>clim</em>&nbsp;</td><td>the limit size of the internal cache. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cbnum</em>&nbsp;</td><td>the bucket number of the internal cache. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Sat Dec 11 01:50:27 2010 for Kyoto Cabinet by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>