[+/-]
- 2.3.16.1 Ndb Class Constructor
- 2.3.16.2 Ndb::closeTransaction()
- 2.3.16.3 Ndb::computeHash()
- 2.3.16.4 Ndb::createEventOperation()
- 2.3.16.5 Ndb::dropEventOperation()
- 2.3.16.6 Ndb::getDictionary()
- 2.3.16.7 Ndb::getDatabaseName()
- 2.3.16.8 Ndb::getDatabaseSchemaName()
- 2.3.16.9 Ndb::getGCIEventOperations()
- 2.3.16.10 Ndb::get_eventbuf_max_alloc()
- 2.3.16.11 Ndb::get_eventbuffer_free_percent()
- 2.3.16.12 Ndb::get_event_buffer_memory_usage()
- 2.3.16.13 Ndb::getHighestQueuedEpoch()
- 2.3.16.14 Ndb::getLatestGCI()
- 2.3.16.15 Ndb::getNdbError()
- 2.3.16.16 Ndb::getNdbErrorDetail()
- 2.3.16.17 Ndb::getNdbObjectName()
- 2.3.16.18 Ndb::getNextEventOpInEpoch2()
- 2.3.16.19 Ndb::getReference()
- 2.3.16.20 Ndb::init()
- 2.3.16.21 Ndb::isConsistent()
- 2.3.16.22 Ndb::isConsistentGCI()
- 2.3.16.23 Ndb::isExpectingHigherQueuedEpochs()
- 2.3.16.24 Ndb::nextEvent()
- 2.3.16.25 Ndb::nextEvent2()
- 2.3.16.26 Ndb::pollEvents()
- 2.3.16.27 Ndb::pollEvents2()
- 2.3.16.28 Ndb::setDatabaseName()
- 2.3.16.29 Ndb::setDatabaseSchemaName()
- 2.3.16.30 Ndb::setEventBufferQueueEmptyEpoch()
- 2.3.16.31 Ndb::set_eventbuf_max_alloc()
- 2.3.16.32 Ndb::set_eventbuffer_free_percent()
- 2.3.16.33 Ndb::setNdbObjectName()
- 2.3.16.34 Ndb::startTransaction()
Abstract
This class represents the NDB kernel; it is the
primary class of the NDB API.
Parent class. None
Child classes. None
Description.
Any nontrivial NDB API program makes use of at least one instance
of Ndb. By using several Ndb
objects, it is possible to implement a multi-threaded application.
You should remember that one Ndb object cannot
be shared between threads; however, it is possible for a single
thread to use multiple Ndb objects. A single
application process can support a maximum of 4711
Ndb objects.
Resource consumption by Ndb objects.
An Ndb object consumes memory in proportion to
the size of the largest operation performed over the lifetime of
the object. This is particularly noticeable in cases of large
transactions; use of one or both of
BLOB or
TEXT columns; or both. This memory
is held for the lifetime of the object, and once used in this way
by the Ndb object, the only way to free this
memory is to destroy the object (and then to create a new instance
if desired).
The Ndb object is multi-thread safe in that
each Ndb object can be handled by one thread at
a time. If an Ndb object is handed over to
another thread, then the application must ensure that a memory
barrier is used to ensure that the new thread sees all updates
performed by the previous thread.
Semaphores and mutexes are examples of easy ways to provide memory barriers without having to bother about the memory barrier concept.
It is also possible to use multiple Ndb objects
to perform operations on different clusters in a single application.
See Application-level partitioning, for
conditions and restrictions applying to such usage.
Methods. The following table lists the public methods of this class and the purpose or use of each method:
| Method | Purpose / Use |
|---|---|
Ndb() |
Class constructor; represents a connection to an NDB Cluster. |
~Ndb() |
Class destructor; terminates a Cluster connection when it is no longer to be used |
closeTransaction() |
Closes a transaction. |
computeHash() |
Computes a distribution hash value. |
createEventOperation() |
Creates a subscription to a database event. (See Section 2.3.21, “The NdbEventOperation Class”.) |
dropEventOperation() |
Drops a subscription to a database event. |
getDictionary() |
Gets a dictionary, which is used for working with database schema information. |
getDatabaseName() |
Gets the name of the current database. |
getDatabaseSchemaName() |
Gets the name of the current database schema. |
get_eventbuf_max_alloc() |
Gets the current allocated maximum size of the event buffer. Added in NDB 7.2.14 and NDB 7.3.3. |
get_eventbuffer_free_percent() |
Gets the percentage of event buffer memory that should be available before buffering resumes, once the limit has been reached. Added in NDB 7.4.3. |
get_event_buffer_memory_usage() |
Provides event buffer memory usage information. Added in NDB 7.4.3. |
getGCIEventOperations() |
Gets the next event operation from a GCI. Deprecated in NDB 7.4.3. |
getHighestQueuedEpoch() |
Gets the latest epoch in the event queue. Added in NDB 7.4.3. |
getLatestGCI() |
Gets the most recent GCI. Deprecated in NDB 7.4.3. |
getNdbError() |
Retrieves an error. (See Section 2.3.20, “The NdbError Structure”.) |
getNdbErrorDetail() |
Retrieves extra error details. |
getNdbObjectName() |
Retrieves the Ndb object name if one was set. Added
in NDB 7.2.17 and NDB 7.3.6. |
getNextEventOpInEpoch2() |
Gets the next event operation in this global checkpoint. |
getReference() |
Retrieves a reference or identifier for the Ndb
object instance. |
init() |
Initializes an Ndb object and makes it ready for use. |
isConsistent() |
Whether all received events are consistent. Deprecated in NDB 7.4.3. |
isConsistentGCI() |
Whether all received events for a given global checkpoint are consistent. Deprecated in NDB 7.4.3. |
isExpectingHigherQueuedEpochs() |
Check whether there are new queued epochs, or there was a cluster failure event. Added in NDB 7.2.21, NDB 7.3.10, and NDB 7.4.7. |
nextEvent() |
Gets the next event from the queue. Deprecated in NDB 7.4.3. |
nextEvent2() |
Gets the next event from the queue. Added in NDB 7.4.3. |
pollEvents() |
Waits for an event to occur. Deprecated in NDB 7.4.3. |
pollEvents2() |
Waits for an event to occur. Added in NDB 7.4.3. |
setDatabaseName() |
Sets the name of the current database. |
setDatabaseSchemaName() |
Sets the name of the current database schema. |
setEventBufferQueueEmptyEpoch() |
Enables queuing of empty events. Added in NDB 7.4.11 and NDB 7.5.2. |
set_eventbuf_max_alloc() |
Sets the current allocated maximum size of the event buffer. Added in NDB 7.2.14 and NDB 7.3.3. |
set_eventbuffer_free_percent() |
Sets the percentage of event buffer memory that should be available before buffering resumes, once the limit has been reached. Added in NDB 7.4.3. |
setNdbObjectName() |
For debugging purposes: sets an arbitrary name for this
Ndb object. Added in NDB 7.2.17 and NDB
7.3.6. |
startTransaction() |
Begins a transaction. (See Section 2.3.30, “The NdbTransaction Class”.) |
Class diagram.
This diagram shows all the available members of the
Ndb class:
