[+/-]
NdbEventOperation::getState()
NdbEventOperation::getEventType()
NdbEventOperation::getValue()
NdbEventOperation::getPreValue()
NdbEventOperation::getBlobHandle()
NdbEventOperation::getPreBlobHandle()
NdbEventOperation::getGCI()
NdbEventOperation::getLatestGCI()
NdbEventOperation::getNdbError()
NdbEventOperation::isConsistent()
NdbEventOperation::tableNameChanged()
NdbEventOperation::tableFrmChanged()
NdbEventOperation::tableFragmentationChanged()
NdbEventOperation::tableRangeListChanged()
NdbEventOperation::mergeEvents()
NdbEventOperation::execute()
Abstract
This section contains definitions and descriptions of the public
methods of the NdbEventOperation
class.
Description. This method gets the event operation's current state.
Signature.
State getState ( void )
Parameters. None.
Return value.
A State
value. See
Section 2.3.11.1, “The NdbEventOperation::State
Type”.
Description.
This method is used to obtain the event's type
(TableEvent
).
Signature.
NdbDictionary::Event::TableEvent getEventType ( void ) const
Parameters. None.
Return value.
A TableEvent
value. See
Section 2.3.4.1.1, “The Event::TableEvent
Type”.
Description.
This method defines the retrieval of an attribute value. The
NDB API allocates memory for the NdbRecAttr
object that is to hold the returned attribute value.
This method does not fetch the attribute
value from the database, and the NdbRecAttr
object returned by this method is not readable or printable
before calling the execute()
method and
Ndb::nextEvent()
has returned a
non-NULL
value.
If a specific attribute has not changed, the corresponding
NdbRecAttr
will be in the state
UNDEFINED
. This can be checked by using
NdbRecAttr::isNULL()
which in such cases
returns -1
.
value
Buffer Memory Allocation.
It is the application's responsibility to allocate sufficient
memory for the value
buffer (if not
NULL
), and this buffer must be aligned
appropriately. The buffer is used directly (thus avoiding a
copy penalty) only if it is aligned on a 4-byte boundary and
the attribute size in bytes (calculated as
NdbRecAttr::attrSize()
times
NdbRecAttr::arraySize()
) is a multiple of
4.
getValue()
retrieves the current value. Use
getPreValue()
for retrieving the previous
value. See
Section 2.3.11.2.4, “NdbEventOperation::getPreValue()
”.
Signature.
NdbRecAttr* getValue ( const char*name
, char*value
= 0 )
Parameters. This method takes two parameters:
The name
of the attribute (as
a constant character pointer).
A pointer to a value
:
If the attribute value is not
NULL
, then the attribute value
is returned in this parameter.
If the attribute value is NULL
,
then the attribute value is stored only in the
NdbRecAttr
object returned by
this method.
See
value
Buffer Memory Allocation for more information
regarding this parameter.
Return value.
An NdbRecAttr
object to hold the value of
the attribute, or a NULL
pointer indicating
that an error has occurred. See
Section 2.3.16, “The NdbRecAttr
Class”.
Description.
This method performs identically to getValue(), except that it
is used to define a retrieval operation of an attribute's
previous value rather than the current value. See
Section 2.3.11.2.3, “NdbEventOperation::getValue()
”, for details.
Signature.
NdbRecAttr* getPreValue ( const char*name
, char*value
= 0 )
Parameters. This method takes two parameters:
The name
of the attribute (as
a constant character pointer).
A pointer to a value
:
If the attribute value is not
NULL
, then the attribute value
is returned in this parameter.
If the attribute value is NULL
,
then the attribute value is stored only in the
NdbRecAttr
object returned by
this method.
See
value
Buffer Memory Allocation for more information
regarding this parameter.
Return value.
An NdbRecAttr
object to hold the value of
the attribute, or a NULL
pointer indicating
that an error has occurred. See
Section 2.3.16, “The NdbRecAttr
Class”.
Description.
This method is used in place of getValue()
for blob attributes. The blob handle
(NdbBlob
) returned by this method supports
read operations only.
To obtain the previous value for a blob attribute, use
getPreBlobHandle()
.
Signature.
NdbBlob* getBlobHandle
(
const char* name
)
Parameters.
The name
of the blob attribute.
Return value.
A pointer to an NdbBlob
object. See
Section 2.3.9, “The NdbBlob
Class”.
Description.
This function is the same as
getBlobHandle()
, except that it is used to
access the previous value of the blob attribute. See
Section 2.3.11.2.5, “NdbEventOperation::getBlobHandle()
”.
Signature.
NdbBlob* getPreBlobHandle
(
const char* name
)
Parameters.
The name
of the blob attribute.
Return value.
A pointer to an NdbBlob
. See
Section 2.3.9, “The NdbBlob
Class”.
Description. This method retrieves the GCI for the most recently retrieved event.
Signature.
Uint64 getGCI ( void ) const
Parameters. None.
Return value. The global checkpoint index of the most recently retrieved event (an integer).
Description. This method retrieves the most recent GCI.
Beginning with MySQL Cluster NDB 6.2.5, this method actually returns the latest epoch number, and all references to GCIs in the documentation for this method when using this or a later MySQL Cluster NDB version should be taken to mean epoch numbers instead. This is a consequence of the implementation for micro-CGPs.
The GCI obtained using this method is not necessarily associated with an event.
Signature.
Uint64 getLatestGCI ( void ) const
Parameters. None.
Return value. The index of the latest global checkpoint, an integer.
Description. This method retrieves the most recent error.
Signature.
const struct NdbError& getNdbError ( void ) const
Parameters. None.
Return value.
A reference to an NdbError
structure. See
Section 2.3.31, “The NdbError
Structure”.
Description. This method is used to determine whether event loss has taken place following the failure of a node.
Signature.
bool isConsistent ( void ) const
Parameters. None.
Return value.
If event loss has taken place, then this method returns
false
; otherwise, it returns
true
.
Description.
This method tests whether a table name has changed as the
result of a TE_ALTER
table event. (See
Section 2.3.4.1.1, “The Event::TableEvent
Type”.)
Signature.
bool tableNameChanged ( void ) const
Prior to MySQL Cluster NDB 7.1.0, this method used
const bool
as its return type. (Bug#44840)
Parameters. None.
Return value.
Returns true
if the name of the table has
changed; otherwise, the method returns
false
.
Description.
Use this method to determine whether a table
.FRM
file has changed in connection with
a TE_ALTER event. (See
Section 2.3.4.1.1, “The Event::TableEvent
Type”.)
Signature.
bool tableFrmChanged ( void ) const
Prior to MySQL Cluster NDB 7.1.0, this method used
const bool
as its return type. (Bug#44840)
Parameters. None.
Return value.
Returns true
if the table
.FRM
file has changed; otherwise, the
method returns false
.
Description.
This method is used to test whether a table's fragmentation
has changed in connection with a TE_ALTER
event. (See Section 2.3.4.1.1, “The Event::TableEvent
Type”.)
Signature.
bool tableFragmentationChanged ( void ) const
Prior to MySQL Cluster NDB 7.1.0, this method used
const bool
as its return type. (Bug#44840)
Parameters. None.
Return value.
Returns true
if the table's fragmentation
has changed; otherwise, the method returns
false
.
Description.
Use this method to check whether a table range partition list
name has changed in connection with a
TE_ALTER
event.
Signature.
bool tableRangeListChanged ( void ) const
Prior to MySQL Cluster NDB 7.1.0, this method used
const bool
as its return type. (Bug#44840)
Parameters. None.
Return value.
This method returns true
if range or list
partition name has changed; otherwise it returns
false
.
Description.
This method is used to set the merge events flag. For
information about event merging, see
Section 2.3.4.2.20, “Event::mergeEvents()
”.
The merge events flag is false
by default.
Signature.
void mergeEvents
(
bool flag
)
Parameters.
A Boolean flag
.
Return value. None.
Description.
Activates the NdbEventOperation
, so that it
can begin receiving events. Changed attribute values may be
retrieved after Ndb::nextEvent()
has
returned a value other than NULL
. One of
getValue()
,
getPreValue()
,
getBlobValue()
, or
getPreBlobValue()
must be called before
invoking execute()
.
Before attempting to use this method, you should have read the
explanations provided in Section 2.3.8.1.14, “Ndb::nextEvent()
”,
and Section 2.3.11.2.3, “NdbEventOperation::getValue()
”. Also see
Section 2.3.11, “The NdbEventOperation
Class”.
Signature.
int execute ( void )
Parameters. None.
Return value.
This method returns 0
on success and
-1
on failure.