[+/-]
Event
ConstructorEvent::getName()
Event::getTable()
Event::getTableName()
Event::getTableEvent()
Event::getDurability()
Event::getReport()
Event::getNoOfEventColumns()
Event::getEventColumn()
Event::getObjectStatus()
Event::getObjectVersion()
Event::getObjectId()
Event::setName()
Event::setTable()
Event::addTableEvent()
Event::setDurability()
Event::setReport()
Event::addEventColumn()
Event::addEventColumns()
Event::mergeEvents()
Description.
The Event
constructor creates a new
instance with a given name, and optionally associated with a
table.
Signatures. Name only:
Event
(
const char* name
)
Name and associated table:
Event ( const char*name
, const NdbDictionary::Table&table
)
Parameters.
At a minimum, a name
(as a constant
character pointer) for the event is required. Optionally, an
event may also be associated with a table; this argument, when
present, is a reference to a Table
object
(see Section 2.3.21, “The Table
Class”).
Return value.
A new instance of Event
.
Destructor.
A destructor for this class is supplied as a virtual method
which takes no arguments and whose return type is
void
.
Description. This method obtains the name of the event.
Signature.
const char* getName ( void ) const
Parameters. None.
Return value. The name of the event, as a character pointer.
Description.
This method is used to find the table with which an event is
associated. It returns a reference to the corresponding
Table
object. You may also obtain the name
of the table directly using getTableName(). (For details, see
Section 2.3.4.2.4, “Event::getTableName()
”.)
Signature.
const NdbDictionary::Table* getTable ( void ) const
Parameters. None.
Return value.
The table with which the event is associated — if there
is one — as a pointer to a Table
object; otherwise, this method returns
NULL
. (See Section 2.3.21, “The Table
Class”.)
Description.
This method obtains the name of the table with which an event
is associated, and can serve as a convenient alternative to
getTable()
. (See
Section 2.3.4.2.3, “Event::getTable()
”.)
Signature.
const char* getTableName ( void ) const
Parameters. None.
Return value. The name of the table associated with this event, as a character pointer.
Description. This method is used to check whether a given table event will be detected.
Signature.
bool getTableEvent
(
const TableEvent te
) const
Parameters.
This method takes a single parameter - the table event's type,
that is, a TableEvent
value. See
Section 2.3.4.1.1, “The Event::TableEvent
Type”, for the list of
possible values.
Return value.
This method returns true
if events of
TableEvent
type
te
will be detected. Otherwise, the
return value is false
.
Description.
This method gets the event's lifetime and scope (that is, its
EventDurability
).
Signature.
EventDurability getDurability ( void ) const
Parameters. None.
Return value.
An EventDurability
value. See
Section 2.3.4.1.2, “The Event::EventDurability
Type”, for possible
values.
Description. This method is used to obtain the reporting option in force for this event.
Signature.
EventReport getReport ( void ) const
Parameters. None.
Return value.
One of the reporting options specified in
Section 2.3.4.1.3, “The Event::EventReport
Type”.
Description. This method obtains the number of columns on which an event is defined.
Signature.
int getNoOfEventColumns ( void ) const
Parameters. None.
Return value.
The number of columns (as an integer), or
-1
in the case of an error.
Description. This method is used to obtain a specific column from among those on which an event is defined.
Signature.
const Column* getEventColumn
(
unsigned no
) const
Parameters.
The number (no
) of the column, as
obtained using getNoOfColumns()
(see
Section 2.3.4.2.8, “Event::getNoOfEventColumns()
”).
Return value.
A pointer to the Column
corresponding to
no
.
Description. This method gets the object status of the event.
Signature.
virtual Object::Status getObjectStatus ( void ) const
Parameters. None.
Return value.
The object status of the event — for possible values,
see Section 2.3.20.1.3, “The Object::Status
Type”.
Description. This method gets the event's object version.
Signature.
virtual int getObjectVersion ( void ) const
Parameters. None.
Return value. The object version of the event, as an integer.
Description. This method retrieves an event's object ID.
Signature.
virtual int getObjectId ( void ) const
Parameters. None.
Return value. The object ID of the event, as an integer.
Description.
This method is used to set the name of an event. The name must
be unique among all events visible from the current
application (see Section 2.3.4.2.6, “Event::getDurability()
”).
You can also set the event's name when first creating it. See
Section 2.3.4.2.1, “Event
Constructor”.
Signature.
void setName
(
const char* name
)
Parameters.
The name
to be given to the event
(as a constant character pointer).
Return value. None.
Description. This method defines a table on which events are to be detected.
By default, event detection takes place on all columns in the
table. Use addEventColumn()
to override
this behavior. For details, see
Section 2.3.4.2.18, “Event::addEventColumn()
”.
Signature.
void setTable
(
const NdbDictionary::Table& table
)
Parameters.
This method requires a single parameter, a reference to the
table (see Section 2.3.21, “The Table
Class”) on which events are to
be detected.
Return value. None.
Description. This method is used to add types of events that should be detected.
Signature.
void addTableEvent
(
const TableEvent te
)
Parameters.
This method requires a TableEvent
value.
See Section 2.3.4.1.1, “The Event::TableEvent
Type” for possible
values.
Return value. None.
Description. This method sets an event's durability — that is, its lifetime and scope.
Signature.
void setDurability(EventDurability ed
)
Parameters.
This method requires a single
EventDurability
value as a parameter. See
Section 2.3.4.1.2, “The Event::EventDurability
Type”, for possible
values.
Return value. None.
Description.
This method is used to set a reporting option for an event.
Possible option values may be found in
Section 2.3.4.1.3, “The Event::EventReport
Type”.
Signature.
void setReport
(
EventReport er
)
Parameters.
An EventReport
option value.
Return value. None.
Description. This method is used to add a column on which events should be detected. The column may be indicated either by its ID or its name.
You must invoke Dictionary::createEvent()
before any errors will be detected. See
Section 2.3.3.1.12, “Dictionary::createEvent()
”.
If you know several columns by name, you can enable event
detection on all of them at one time by using
addEventColumns()
. See
Section 2.3.4.2.19, “Event::addEventColumns()
”.
Signature. Identifying the event using its column ID:
void addEventColumn
(
unsigned attrId
)
Identifying the column by name:
void addEventColumn
(
const char* columnName
)
Parameters. This method takes a single argument, which may be either one of:
The column ID (attrId
), which should
be an integer greater than or equal to
0
, and less than the value returned
by getNoOfEventColumns()
.
The column's name
(as a
constant character pointer).
Return value. None.
Description. This method is used to enable event detection on several columns at the same time. You must use the names of the columns.
As with addEventColumn()
, you must invoke
Dictionary::createEvent()
before any errors
will be detected. See
Section 2.3.3.1.12, “Dictionary::createEvent()
”.
Signature.
void addEventColumns ( intn
, const char**columnNames
)
Parameters. This method requires two arguments:
The number of columns n
(an
integer).
The names of the columns
columnNames
— this must
be passed as a pointer to a character pointer.
Return value. None.
Description.
This method is used to set the merge events
flag, which is false
by
default. Setting it to true
implies that
events are merged as follows:
For a given NdbEventOperation
associated with this event, events on the same primary
key within the same global checkpoint index (GCI) are
merged into a single event.
A blob table event is created for each blob attribute, and blob events are handled as part of main table events.
Blob post/pre data from blob part events can be read via
NdbBlob
methods as a single value.
Currently this flag is not inherited by
NdbEventOperation
, and must be set on
NdbEventOperation
explicitly. See
Section 2.3.11, “The NdbEventOperation
Class”.
Signature.
void mergeEvents
(
bool flag
)
Parameters.
A Boolean flag
value.
Return value. None.