#include <NdbEventOperation.hpp>
Brief description on how to work with events:
For more info see: ndbapi_event.cpp
Known limitations:
Known issues:
Test status:
Useful API programs:
State of the NdbEventOperation object
int NdbEventOperation::execute | ( | ) |
Activates the NdbEventOperation to start receiving events. The changed attribute values may be retrieved after next() has returned a value greater than zero. The getValue() methods must be called prior to execute().
NdbDictionary::Event::TableEvent NdbEventOperation::getEventType | ( | ) |
Query for occured event type.
Uint32 NdbEventOperation::getGCI | ( | ) |
Retrieve the GCI of the latest retrieved event
Uint32 NdbEventOperation::getLatestGCI | ( | ) |
Retrieve the complete GCI in the cluster (not necessarily associated with an event)
struct NdbError& NdbEventOperation::getNdbError | ( | ) | const |
Get the latest error
NdbRecAttr* NdbEventOperation::getPreValue | ( | const char * | anAttrName, | |
char * | aValue = 0 | |||
) |
See getValue().
State NdbEventOperation::getState | ( | ) |
Retrieve current state of the NdbEventOperation object
NdbRecAttr* NdbEventOperation::getValue | ( | const char * | anAttrName, | |
char * | aValue = 0 | |||
) |
Defines a retrieval operation of an attribute value. The NDB API allocate memory for the NdbRecAttr object that will hold the returned attribute value.
There are two versions, getValue() and getPreValue() for retrieving the current and previous value repectively.
This method does not fetch the attribute value from the database! The NdbRecAttr object returned by this method is not readable/printable before the execute() has been made and next() has returned a value greater than zero. If a specific attribute has not changed the corresponding NdbRecAttr will be in state UNDEFINED. This is checked by NdbRecAttr::isNULL() which then returns -1.
anAttrName | Attribute name | |
aValue | If this is non-NULL, then the attribute value will be returned in this parameter. If NULL, then the attribute value will only be stored in the returned NdbRecAttr object. |
bool NdbEventOperation::isConsistent | ( | ) |
In the current implementation a nodefailiure may cause loss of events, in which case isConsistent() will return false
int NdbEventOperation::next | ( | int * | pOverRun = 0 |
) |
Retrieves event resultset if available, inserted into the NdbRecAttrs specified in getValue() and getPreValue(). To avoid polling for a resultset, one can use Ndb::pollEvents() which will wait on a mutex until an event occurs or the specified timeout occurs.
number of available events, -1 on failure