[+/-]
- 2.3.21.1 NdbEventOperation::clearError()
- 2.3.21.2 NdbEventOperation::execute()
- 2.3.21.3 NdbEventOperation::getBlobHandle()
- 2.3.21.4 NdbEventOperation::getEpoch()
- 2.3.21.5 NdbEventOperation::getEventType()
- 2.3.21.6 NdbEventOperation::getEventType2()
- 2.3.21.7 NdbEventOperation::getGCI()
- 2.3.21.8 NdbEventOperation::getLatestGCI()
- 2.3.21.9 NdbEventOperation::getNdbError()
- 2.3.21.10 NdbEventOperation::getPreBlobHandle()
- 2.3.21.11 NdbEventOperation::getPreValue()
- 2.3.21.12 NdbEventOperation::getState()
- 2.3.21.13 NdbEventOperation::getValue()
- 2.3.21.14 NdbEventOperation::hasError()
- 2.3.21.15 NdbEventOperation::isConsistent()
- 2.3.21.16 NdbEventOperation::isEmptyEpoch()
- 2.3.21.17 NdbEventOperation::isErrorEpoch()
- 2.3.21.18 NdbEventOperation::isOverrun()
- 2.3.21.19 NdbEventOperation::mergeEvents()
- 2.3.21.20 NdbEventOperation::State
- 2.3.21.21 NdbEventOperation::tableFragmentationChanged()
- 2.3.21.22 NdbEventOperation::tableFrmChanged()
- 2.3.21.23 NdbEventOperation::tableNameChanged()
- 2.3.21.24 NdbEventOperation::tableRangeListChanged()
Abstract
This section describes the NdbEventOperation
class, which is used to monitor changes (events) in a database. It
provides the core functionality used to implement NDB Cluster
Replication.
Parent class. None
Child classes. None
Description.
NdbEventOperation represents a database event.
Creating an Instance of NdbEventOperation.
This class has no public constructor or destructor. Instead,
instances of NdbEventOperation are created as
the result of method calls on Ndb
and NdbDictionary objects,
subject to the following conditions:
There must exist an event which was created using
Dictionary::createEvent(). This method returns an instance of theEventclass.An
NdbEventOperationobject is instantiated usingNdb::createEventOperation(), which acts on an instance ofEvent.
An instance of this class is removed by invoking
Ndb::dropEventOperation.
A detailed example demonstrating creation and removal of event operations is provided in Section 2.5.8, “NDB API Event Handling Example”.
Known Issues. The following issues may be encountered when working with event operations in the NDB API:
The maximum number of active
NdbEventOperationobjects is currently fixed at compile time at 2 *MaxNoOfTables.-
Currently, all
INSERT,DELETE, andUPDATEevents—as well as all attribute changes—are sent to the API, even if only some attributes have been specified. However, these are hidden from the user and only relevant data is shown after callingNdb::nextEvent().Note that false exits from
Ndb::pollEvents()may occur, and thus the followingnextEvent()call returns zero, since there was no available data. In such cases, simply callpollEvents()again.See Section 2.3.16.26, “Ndb::pollEvents()”, and Section 2.3.16.24, “Ndb::nextEvent()”.
Event code does not check the table schema version. When a table is dropped, make sure that you drop any associated events.
-
If you have received a complete epoch, events from this epoch are not re-sent, even in the event of a node failure. However, if a node failure has occurred, subsequent epochs may contain duplicate events, which can be identified by duplicated primary keys.
In the NDB Cluster replication code, duplicate primary keys on
INSERToperations are normally handled by treating such inserts asREPLACEoperations.
To view the contents of the system table containing created events, you can use the ndb_select_all utility as shown here:
ndb_select_all -d sys 'NDB$EVENTS_0'
Methods. The following table lists the public methods of this class and the purpose or use of each method:
| Method | Purpose / Use |
|---|---|
clearError() |
Clears the most recent error. Deprecated in NDB 7.4.3. |
execute() |
Activates the NdbEventOperation
|
getBlobHandle() |
Gets a handle for reading blob attributes |
getEpoch() |
Retrieves the epoch for the event data most recently retrieved. Added in NDB 7.4.3. |
getEventType() |
Gets the event type. Deprecated in NDB 7.4.3. |
getEventType2() |
Gets the event type. Added in NDB 7.4.3. |
getGCI() |
Retrieves the GCI of the most recently retrieved event. Deprecated in NDB 7.4.3. |
getLatestGCI() |
Retrieves the most recent GCI (whether or not the corresponding event has been retrieved). Deprecated in NDB 7.4.3. |
getNdbError() |
Gets the most recent error |
getPreBlobHandle() |
Gets a handle for reading the previous blob attribute |
getPreValue() |
Retrieves an attribute's previous value |
getState() |
Gets the current state of the event operation |
getValue() |
Retrieves an attribute value |
hasError() |
Whether an error has occurred as part of this operation. Deprecated in NDB 7.4.3. |
isConsistent() |
Detects event loss caused by node failure. Deprecated in NDB 7.4.3. |
isEmptyEpoch() |
Detects an empty epoch. Added in NDB 7.4.3. |
isErrorEpoch() |
Detects an error epoch, and retrieves the error if there is one. Added in NDB 7.4.3. |
isOverrun() |
Whether event loss has taken place due to a buffer overrun. Deprecated in NDB 7.4.3. |
mergeEvents() |
Makes it possible for events to be merged |
tableFragmentationChanged() |
Checks to see whether the fragmentation for a table has changed |
tableFrmChanged() |
Checks to see whether a table .FRM file has changed |
tableNameChanged() |
Checks to see whether the name of a table has changed |
tableRangeListChanged() |
Checks to see whether a table range partition list name has changed |
Types.
NdbEventOperation defines one enumerated type,
the State type.
Class diagram.
This diagram shows all the available members of the
NdbEventOperation class:
