This section describes the
class, which is used to monitor changes (events) in a database. It
provides the core functionality used to implement MySQL Cluster
Parent class. None
Child classes. None
NdbEventOperation represents a database event.
Creating an Instance of NdbEventOperation.
This class has no public constructor or destructor. Instead,
NdbEventOperation are created as
the result of method calls on
subject to the following conditions:
An instance of this class is removed by invoking
A detailed example demonstrating creation and removal of event operations is provided in Section 2.4.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 *
UPDATEevents—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 calling
Note that false exits from
Ndb::pollEvents()may occur, and thus the following
nextEvent()call returns zero, since there was no available data. In such cases, simply call
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 MySQL Cluster replication code, duplicate primary keys on
INSERToperations are normally handled by treating such inserts as
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|
||Clears the most recent error. Deprecated in MySQL Cluster NDB 7.4.3.|
||Gets a handle for reading blob attributes|
||Retrieves the epoch for the event data most recently retrieved. Added in MySQL Cluster NDB 7.4.3.|
||Gets the event type. Deprecated in MySQL Cluster NDB 7.4.3.|
||Gets the event type. Added in MySQL Cluster NDB 7.4.3.|
||Retrieves the GCI of the most recently retrieved event. Deprecated in MySQL Cluster NDB 7.4.3.|
||Retrieves the most recent GCI (whether or not the corresponding event has been retrieved). Deprecated in MySQL Cluster NDB 7.4.3.|
||Gets the most recent error|
||Gets a handle for reading the previous blob attribute|
||Retrieves an attribute's previous value|
||Gets the current state of the event operation|
||Retrieves an attribute value|
||Whether an error has occurred as part of this operation. Deprecated in MySQL Cluster NDB 7.4.3.|
||Detects event loss caused by node failure. Deprecated in MySQL Cluster NDB 7.4.3.|
||Detects an empty epoch. Added in MySQL Cluster NDB 7.4.3.|
||Detects an error epoch, and retrieves the error if there is one. Added in MySQL Cluster NDB 7.4.3.|
||Whether event loss has taken place due to a buffer overrun. Deprecated in MySQL Cluster NDB 7.4.3.|
||Makes it possible for events to be merged|
||Checks to see whether the fragmentation for a table has changed|
||Checks to see whether a table
||Checks to see whether the name of a table has changed|
||Checks to see whether a table range partition list name has changed|
For detailed descriptions, signatures, and examples of use for each of these methods, see Section 18.104.22.168, “NdbEventOperation Methods”.
NdbEventOperation defines one enumerated type,
This diagram shows all the available members of the