Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b8ce3833
Commit
b8ce3833
authored
Dec 28, 2004
by
jon@gigan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mgmapi.h, Ndb.hpp: Various fixes in Doxygen comments
parent
a4ee32c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
57 deletions
+65
-57
ndb/include/mgmapi/mgmapi.h
ndb/include/mgmapi/mgmapi.h
+1
-1
ndb/include/ndbapi/Ndb.hpp
ndb/include/ndbapi/Ndb.hpp
+64
-56
No files found.
ndb/include/mgmapi/mgmapi.h
View file @
b8ce3833
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
* -# An integer value.
* -# An integer value.
* A value of <b>-1</b> indicates an error.
* A value of <b>-1</b> indicates an error.
* -# A pointer value. A <var>NULL</var> value indicates an error;
* -# A pointer value. A <var>NULL</var> value indicates an error;
*
Otherwise, the return value must be <code>free()</code>
ed by the user of the MGM API.
*
otherwise, the return value must be fre
ed by the user of the MGM API.
*
*
* Error conditions can be identified by using the appropriate
* Error conditions can be identified by using the appropriate
* error-reporting functions.
* error-reporting functions.
...
...
ndb/include/ndbapi/Ndb.hpp
View file @
b8ce3833
...
@@ -23,76 +23,76 @@
...
@@ -23,76 +23,76 @@
The <em>NDB API</em> is a MySQL Cluster application interface
The <em>NDB API</em> is a MySQL Cluster application interface
that implements transactions.
that implements transactions.
The NDB API consists of the following fundamental classes:
The NDB API consists of the following fundamental classes:
-
Ndb_cluster_connection class
representing a connection to a cluster,
-
<code>Ndb_cluster_connection</code>,
representing a connection to a cluster,
-
Ndb is the main class
representing the database,
-
<code>Ndb</code> is the main class,
representing the database,
-
NdbTransaction
represents a transaction,
-
<code>NdbTransaction</code>
represents a transaction,
-
NdbOperation represents a operation using
primary key,
-
<code>NdbOperation</code> represents an operation using a
primary key,
-
NdbScanOperation represents a
operation performing a full table scan.
-
<code>NdbScanOperation</code> represents an
operation performing a full table scan.
-
NdbIndexOperation represents a
operation using a unique hash index,
-
<code>NdbIndexOperation</code> represents an
operation using a unique hash index,
-
NdbIndexScanOperation represents a
operation performing a scan using
-
<code>NdbIndexScanOperation</code> represents an
operation performing a scan using
an ordered index,
an ordered index,
-
NdbRecAttr represents the value of an attribute, and
-
<code>NdbRecAttr</code> represents an attribute value
-
NdbDictionary
represents meta information about tables and attributes.
-
<code>NdbDictionary</code>
represents meta information about tables and attributes.
-
NdbError contains a specification of
an error.
-
<code>NdbError</code> contains the specification for
an error.
There are also some auxiliary classes.
There are also some auxiliary classes.
The main structure of an application program is as follows:
The main structure of an application program is as follows:
-# Construct and connect to a cluster using the
Ndb_cluster_connection
-# Construct and connect to a cluster using the
<code>Ndb_cluster_connection</code>
object.
object.
-# Construct and initialize
Ndb
object(s).
-# Construct and initialize
<code>Ndb</code>
object(s).
-# Define and execute transactions using
NdbTransaction and Ndb*Operation
.
-# Define and execute transactions using
<code>NdbTransaction</code> and <code>Ndb*Operation</code>
.
-# Delete
Ndb
objects
-# Delete
<code>Ndb</code>
objects
-# Delete c
onnection to cluster
-# Delete c
luster connection
The main structure of a transaction is as follows:
The main structure of a transaction is as follows:
-# Start transaction
, a NdbTransaction
-# Start transaction
(an <code>NdbTransaction</code>)
-# Add and define operations
(associated with the transaction),
-# Add and define operations
associated with the transaction using
Ndb*Operation
<code>Ndb*Operation</code>
-# Execute transaction
-# Execute transaction
The execut
e
can be of two different types,
The execut
ion
can be of two different types,
<
em>Commit</em> or <em>NoCommit</em
>.
<
var>Commit</var> or <var>NoCommit</var
>.
*/
*/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
/**
(
The execute
can also be divided into three
(
A transaction's execution
can also be divided into three
steps: prepare, send, and poll
to get
asynchronous
steps: prepare, send, and poll
. This allows us to perform
asynchronous
transactions. More about this later.)
transactions. More about this later.)
*/
*/
#endif
#endif
/**
/**
If the execut
e is of type NoCommit
,
If the execut
ion is of type <var>NoCommit</var>
,
then the application program executes part of a transaction,
then the application program executes part of a transaction,
but without committing the transaction.
but without committing the transaction.
After
a NoCommit type of execute
, the program can continue
After
executing a <var>NoCommit</var> transaction
, the program can continue
to add and define more operations to the transaction
to add and define more operations to the transaction
for later execution.
for later execution.
If the execute is of type
Commit
, then the transaction is
If the execute is of type
<var>Commit</var>
, then the transaction is
committed
and no further adding and defining
of operations
committed
, and no further addition or definition
of operations
is allowed.
is allowed.
@section secSync Synchronous Transactions
@section secSync Synchronous Transactions
Synchronous transactions are defined and executed
in the following way.
Synchronous transactions are defined and executed
as follows:
-# Start (create) t
ransaction (the transaction will be
-# Start (create) t
he transaction, which is
refer
red to by an NdbTransaction object,
refer
enced by an <code>NdbTransaction</code> object
typically created by Ndb::startTransaction
).
(typically created using <code>Ndb::startTransaction()</code>
).
At this
step the transaction is being defined.
At this
point, the transaction is only being defined,
It
is not yet sent to the NDB kernel.
and
is not yet sent to the NDB kernel.
-#
Add and define operations to the transaction
-#
Define operations and add them to the transaction,
(using NdbTransaction::getNdb*Operation
and
using <code>NdbTransaction::getNdb*Operation()</code>
and
methods
from class Ndb*Operation)
.
methods
of the <code>Ndb*Operation</code> class
.
The transaction is still not
sent to the NDB kernel.
Note that the transaction has still not yet been
sent to the NDB kernel.
-# Execute the transaction
(using NdbTransaction::execute)
.
-# Execute the transaction
, using the <code>NdbTransaction::execute()</code> method
.
-# Close the transaction (using
Ndb::closeTransaction
).
-# Close the transaction (using
<code>Ndb::closeTransaction()</code>
).
See example program in sectio
n @ref ndbapi_example1.cpp.
For an example of this process, see the program listing i
n @ref ndbapi_example1.cpp.
To execute several parallel synchronous transactions, one can either
To execute several parallel synchronous transactions, one can either
use multiple
Ndb objects in several threads
or start multiple
use multiple
<code>Ndb</code> objects in several threads,
or start multiple
applications programs.
applications programs.
*/
*/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
...
@@ -104,8 +104,9 @@
...
@@ -104,8 +104,9 @@
/**
/**
@section secNdbOperations Operations
@section secNdbOperations Operations
Each transaction (NdbTransaction object) consist of a list of
Each <code>NdbTransaction</code> (that is, a transaction)
operations (Ndb*Operation objects).
consists of a list of operations which are represented by instances
of <code>Ndb*Operation</code>.
*/
*/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
/**
...
@@ -116,17 +117,17 @@
...
@@ -116,17 +117,17 @@
#endif
#endif
/**
/**
<h3>Single row operations</h3>
<h3>Single row operations</h3>
After the operation is created using
NdbTransaction::getNdbOperation
After the operation is created using
<code>NdbTransaction::getNdbOperation()</code>
(or
NdbTransaction::getNdbIndexOperation),
(or
<code>NdbTransaction::getNdbIndexOperation()</code>), it is defined in the following
it is defined in the following
three steps:
three steps:
-# Defin
ing standard operation type
-# Defin
e the standard operation type, using <code>NdbOperation::readTuple()</code>
(e.g. using NdbOperation::readTuple)
-# Specify search conditions, using <code>NdbOperation::equal()</code>
-# Specify
ing search conditions
-# Specify
attribute actions, using <code>NdbOperation::getValue()</code>
(e.g. using NdbOperation::equal)
-# Specify attribute actions
Here are two brief examples illustrating this process. For the sake of brevity,
(e.g. using NdbOperation::getValue)
we omit error-handling.
Example code (using an NdbOperation and excluding error handling)
:
This first example uses an <code>NdbOperation</code>
:
@code
@code
// 1. Create
// 1. Create
MyOperation= MyTransaction->getNdbOperation("MYTABLENAME");
MyOperation= MyTransaction->getNdbOperation("MYTABLENAME");
...
@@ -140,10 +141,10 @@
...
@@ -140,10 +141,10 @@
// 4. Attribute Actions
// 4. Attribute Actions
MyRecAttr= MyOperation->getValue("ATTR2", NULL);
MyRecAttr= MyOperation->getValue("ATTR2", NULL);
@endcode
@endcode
For
more examples
, see @ref ndbapi_example1.cpp and
For
additional examples of this sort
, see @ref ndbapi_example1.cpp and
@ref ndbapi_example2.cpp.
@ref ndbapi_example2.cpp.
Example code (using an NdbIndexOperation and excluding error handling)
:
The second example uses an <code>NdbIndexOperation</code>
:
@code
@code
// 1. Create
// 1. Create
MyOperation= MyTransaction->getNdbIndexOperation("MYINDEX", "MYTABLENAME");
MyOperation= MyTransaction->getNdbIndexOperation("MYINDEX", "MYTABLENAME");
...
@@ -157,9 +158,16 @@
...
@@ -157,9 +158,16 @@
// 4. Attribute Actions
// 4. Attribute Actions
MyRecAttr = MyOperation->getValue("ATTR2", NULL);
MyRecAttr = MyOperation->getValue("ATTR2", NULL);
@endcode
@endcode
For more examples, see @ref ndbapi_example4.cpp.
Another example of this second type can be found in @ref ndbapi_example4.cpp.
We will now discuss in somewhat greater detail each step involved in the creation
and use of synchronous transactions.
*/
// Edit stop point - JS, 20041228 0425+1000
/**
<h4>Step 1: Define single row operation type</h4>
<h4>Step 1: Define single row operation type</h4>
The following types of operations exist:
The following types of operations exist:
-# NdbOperation::insertTuple :
-# NdbOperation::insertTuple :
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment