Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > 91128064e1b251eab84e1c0e3ea0dd7a > files > 104

lib64mysql-devel-5.0.51a-8mdv2008.1.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Ndb Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="contents">
<h1>Ndb Class Reference</h1><!-- doxytag: class="Ndb" --><code>#include &lt;Ndb.hpp&gt;</code>
<p>

<p>
<a href="classNdb-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Represents the NDB kernel and is the main class of the NDB API. 
<p>
Always start your application program by creating an <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object. By using several <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> objects it is possible to design a multi-threaded application, but note that <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> objects cannot be shared by several threads. Different threads should use different <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> objects. A thread might however use multiple <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> objects. Currently there is a limit of maximum 128 <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> objects per application process.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>It is not allowed to call methods in the NDB API on the same <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object in different threads simultaneously (without special handling of the <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object).<p>
The <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object is multi-thread safe in the following manner. Each <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object can ONLY be handled in one thread. If an <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object is handed over to another thread then the application must ensure that a memory barrier is used to ensure that the new thread see all updates performed by the previous thread. Semaphores, mutexes and so forth are easy ways of issuing memory barriers without having to bother about the memory barrier concept. </dd></dl>
<h2>Public Member Functions</h2>
<tr><td colspan="2"><div class="groupHeader">General</div></td></tr>
<ul>
<li><a class="el" href="classNdb.html#ceb6090a4c9b6a8b41a3efeba8652090">Ndb</a> (<a class="el" href="classNdb__cluster__connection.html">Ndb_cluster_connection</a> *ndb_cluster_connection, const char *aCatalogName=&quot;&quot;, const char *aSchemaName=&quot;def&quot;)
<li><a class="anchor" name="8446418395a07c251ce0c0303bee6e93"></a><!-- doxytag: member="Ndb::~Ndb" ref="8446418395a07c251ce0c0303bee6e93" args="()" -->
<b>~Ndb</b> ()
<li>const char * <a class="el" href="classNdb.html#b138d98810507b696e609114b1be4b86">getDatabaseName</a> () const 
<li>int <a class="el" href="classNdb.html#2591e483152aacee07ab30de99bbf85b">setDatabaseName</a> (const char *aDatabaseName)
<li>const char * <a class="el" href="classNdb.html#e140a3b363c0d544fa34ef1e9b89aaec">getDatabaseSchemaName</a> () const 
<li>int <a class="el" href="classNdb.html#a6182eaa239d12e003511feedda9aac2">setDatabaseSchemaName</a> (const char *aDatabaseSchemaName)
<li>int <a class="el" href="classNdb.html#b938638f0ced10e31ab67b3a80901270">init</a> (int maxNoOfTransactions=4)
</ul>
<tr><td colspan="2"><div class="groupHeader">Meta Information</div></td></tr>
<ul>
<li>class <a class="el" href="classNdbDictionary_1_1Dictionary.html">NdbDictionary::Dictionary</a> * <a class="el" href="classNdb.html#f27ca0f4e5c074211252a7c83060a3a4">getDictionary</a> () const 
</ul>
<tr><td colspan="2"><div class="groupHeader">Starting and Closing Transactions</div></td></tr>
<ul>
<li><a class="el" href="classNdbTransaction.html">NdbTransaction</a> * <a class="el" href="classNdb.html#7e34bb5d8e3d878a54ebb7c0e6d0c5f1">startTransaction</a> (const <a class="el" href="classNdbDictionary_1_1Table.html">NdbDictionary::Table</a> *table=0, const char *keyData=0, Uint32 keyLen=0)
<li>void <a class="el" href="classNdb.html#afbf5620c516bf18e0a3d3bacaf38e67">closeTransaction</a> (<a class="el" href="classNdbTransaction.html">NdbTransaction</a> *)
</ul>
<tr><td colspan="2"><div class="groupHeader">Error Handling</div></td></tr>
<ul>
<li>const <a class="el" href="structNdbError.html">NdbError</a> &amp; <a class="el" href="classNdb.html#80b53a037bb2e93b3cd6830eda58643a">getNdbError</a> () const 
<li>const <a class="el" href="structNdbError.html">NdbError</a> &amp; <a class="el" href="classNdb.html#5fe6c6cda7ceb492572b6412274766b0">getNdbError</a> (int errorCode)
</ul>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="ceb6090a4c9b6a8b41a3efeba8652090"></a><!-- doxytag: member="Ndb::Ndb" ref="ceb6090a4c9b6a8b41a3efeba8652090" args="(Ndb_cluster_connection *ndb_cluster_connection, const char *aCatalogName=&quot;&quot;, const char *aSchemaName=&quot;def&quot;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Ndb::Ndb           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classNdb__cluster__connection.html">Ndb_cluster_connection</a> *&nbsp;</td>
          <td class="paramname"> <em>ndb_cluster_connection</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>aCatalogName</em> = <code>&quot;&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>aSchemaName</em> = <code>&quot;def&quot;</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object represents a connection to a database.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The <a class="el" href="classNdb.html#b938638f0ced10e31ab67b3a80901270">init()</a> method must be called before the <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object may actually be used.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ndb_cluster_connection</em>&nbsp;</td><td>is a connection to the cluster containing the database to be used </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>aCatalogName</em>&nbsp;</td><td>is the name of the catalog to be used. </td></tr>
  </table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The catalog name provides a namespace for the tables and indexes created in any connection from the <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object. </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aSchemaName</em>&nbsp;</td><td>is the name of the schema you want to use. </td></tr>
  </table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The schema name provides an additional namespace for the tables and indexes created in a given catalog. </dd></dl>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="b138d98810507b696e609114b1be4b86"></a><!-- doxytag: member="Ndb::getDatabaseName" ref="b138d98810507b696e609114b1be4b86" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* Ndb::getDatabaseName           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The current database name can be fetched by getDatabaseName.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the current database name </dd></dl>

</div>
</div><p>
<a class="anchor" name="2591e483152aacee07ab30de99bbf85b"></a><!-- doxytag: member="Ndb::setDatabaseName" ref="2591e483152aacee07ab30de99bbf85b" args="(const char *aDatabaseName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Ndb::setDatabaseName           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>aDatabaseName</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The current database name can be set by setDatabaseName.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aDatabaseName</em>&nbsp;</td><td>is the new name of the current database </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="e140a3b363c0d544fa34ef1e9b89aaec"></a><!-- doxytag: member="Ndb::getDatabaseSchemaName" ref="e140a3b363c0d544fa34ef1e9b89aaec" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* Ndb::getDatabaseSchemaName           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The current database schema name can be fetched by getDatabaseSchemaName.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the current database schema name </dd></dl>

</div>
</div><p>
<a class="anchor" name="a6182eaa239d12e003511feedda9aac2"></a><!-- doxytag: member="Ndb::setDatabaseSchemaName" ref="a6182eaa239d12e003511feedda9aac2" args="(const char *aDatabaseSchemaName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Ndb::setDatabaseSchemaName           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>aDatabaseSchemaName</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
The current database schema name can be set by setDatabaseSchemaName.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aDatabaseSchemaName</em>&nbsp;</td><td>is the new name of the current database schema </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="b938638f0ced10e31ab67b3a80901270"></a><!-- doxytag: member="Ndb::init" ref="b938638f0ced10e31ab67b3a80901270" args="(int maxNoOfTransactions=4)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Ndb::init           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>maxNoOfTransactions</em> = <code>4</code>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Initializes the <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>maxNoOfTransactions</em>&nbsp;</td><td>Maximum number of parallel <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> objects that can be handled by the <a class="el" href="classNdb.html" title="Represents the NDB kernel and is the main class of the NDB API.">Ndb</a> object. Maximum value is 1024.</td></tr>
  </table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>each scan or index scan operation uses one extra <a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object</dd></dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful, -1 otherwise. </dd></dl>

</div>
</div><p>
<a class="anchor" name="f27ca0f4e5c074211252a7c83060a3a4"></a><!-- doxytag: member="Ndb::getDictionary" ref="f27ca0f4e5c074211252a7c83060a3a4" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">class <a class="el" href="classNdbDictionary_1_1Dictionary.html">NdbDictionary::Dictionary</a>* Ndb::getDictionary           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get an object for retrieving or manipulating database schema information<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>this object operates outside any transaction</dd></dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>Object containing meta information about all tables in NDB Cluster. </dd></dl>

</div>
</div><p>
<a class="anchor" name="7e34bb5d8e3d878a54ebb7c0e6d0c5f1"></a><!-- doxytag: member="Ndb::startTransaction" ref="7e34bb5d8e3d878a54ebb7c0e6d0c5f1" args="(const NdbDictionary::Table *table=0, const char *keyData=0, Uint32 keyLen=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classNdbTransaction.html">NdbTransaction</a>* Ndb::startTransaction           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classNdbDictionary_1_1Table.html">NdbDictionary::Table</a> *&nbsp;</td>
          <td class="paramname"> <em>table</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>keyData</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Uint32&nbsp;</td>
          <td class="paramname"> <em>keyLen</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Start a transaction<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>When the transaction is completed it must be closed using <a class="el" href="classNdb.html#afbf5620c516bf18e0a3d3bacaf38e67">Ndb::closeTransaction</a> or <a class="el" href="classNdbTransaction.html#967f0c6f7c920cfa1140f005144a3a91">NdbTransaction::close</a>. The transaction must be closed independent of its outcome, i.e. even if there is an error.</dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>table</em>&nbsp;</td><td>Pointer to table object used for deciding which node to run the Transaction Coordinator on </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>keyData</em>&nbsp;</td><td>Pointer to partition key corresponding to <em>table</em> </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>keyLen</em>&nbsp;</td><td>Length of partition key expressed in bytes</td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd><a class="el" href="classNdbTransaction.html" title="Represents a transaction.">NdbTransaction</a> object, or NULL on failure. </dd></dl>

</div>
</div><p>
<a class="anchor" name="afbf5620c516bf18e0a3d3bacaf38e67"></a><!-- doxytag: member="Ndb::closeTransaction" ref="afbf5620c516bf18e0a3d3bacaf38e67" args="(NdbTransaction *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Ndb::closeTransaction           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classNdbTransaction.html">NdbTransaction</a> *&nbsp;</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Close a transaction.<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>should be called after the transaction has completed, irrespective of success or failure </dd></dl>

</div>
</div><p>
<a class="anchor" name="80b53a037bb2e93b3cd6830eda58643a"></a><!-- doxytag: member="Ndb::getNdbError" ref="80b53a037bb2e93b3cd6830eda58643a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structNdbError.html">NdbError</a>&amp; Ndb::getNdbError           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get the <a class="el" href="structNdbError.html" title="Contains error information.">NdbError</a> object<p>
<dl class="note" compact><dt><b>Note:</b></dt><dd>The <a class="el" href="structNdbError.html" title="Contains error information.">NdbError</a> object is valid until a new NDB API method is called. </dd></dl>

</div>
</div><p>
<a class="anchor" name="5fe6c6cda7ceb492572b6412274766b0"></a><!-- doxytag: member="Ndb::getNdbError" ref="5fe6c6cda7ceb492572b6412274766b0" args="(int errorCode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="structNdbError.html">NdbError</a>&amp; Ndb::getNdbError           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>errorCode</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Get a <a class="el" href="structNdbError.html" title="Contains error information.">NdbError</a> object for a specific error code<p>
The <a class="el" href="structNdbError.html" title="Contains error information.">NdbError</a> object is valid until you call a new NDB API method. 
</div>
</div><p>
</div>
<hr>
<address>
<small>
<center>
Documentation generated Sun Apr 20 06:25:31 2008 from mysql source files.<br>
&copy; 2003-2004 
<a href="http://www.mysql.com">MySQL AB</a>
<br>
</center>
</small></address>
</body>
</html>