MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbDictionary::Event Class Reference

Represents an Event in NDB Cluster. More...

#include <NdbDictionary.hpp>

Inheritance diagram for NdbDictionary::Event:
Collaboration diagram for NdbDictionary::Event:

Public Types

enum  TableEvent {
  TE_INSERT = 1<<0, TE_DELETE = 1<<1, TE_UPDATE = 1<<2, TE_SCAN = 1<<3,
  TE_FIRST_NON_DATA_EVENT = 1<<4, TE_DROP = 1<<4, TE_ALTER = 1<<5, TE_CREATE = 1<<6,
  TE_GCP_COMPLETE = 1<<7, TE_CLUSTER_FAILURE = 1<<8, TE_STOP = 1<<9, TE_NODE_FAILURE = 1<<10,
  TE_SUBSCRIBE = 1<<11, TE_UNSUBSCRIBE = 1<<12, TE_ALL = 0xFFFF
}
enum  _TableEvent {
  _TE_INSERT = 0, _TE_DELETE = 1, _TE_UPDATE = 2, _TE_SCAN = 3,
  _TE_FIRST_NON_DATA_EVENT = 4, _TE_DROP = 4, _TE_ALTER = 5, _TE_CREATE = 6,
  _TE_GCP_COMPLETE = 7, _TE_CLUSTER_FAILURE = 8, _TE_STOP = 9, _TE_NODE_FAILURE = 10,
  _TE_SUBSCRIBE = 11, _TE_UNSUBSCRIBE = 12, _TE_NUL = 13, _TE_ACTIVE = 14
}
enum  EventDurability { ED_UNDEFINED = 0, ED_PERMANENT = 3 }
enum  EventReport { ER_UPDATED = 0, ER_ALL = 1, ER_SUBSCRIBE = 2, ER_DDL = 4 }
- Public Types inherited from NdbDictionary::Object
enum  Status {
  New, Changed, Retrieved, Invalid,
  Altered
}
enum  Type {
  TypeUndefined = 0, SystemTable = 1, UserTable = 2, UniqueHashIndex = 3,
  OrderedIndex = 6, HashIndexTrigger = 7, IndexTrigger = 8, SubscriptionTrigger = 9,
  ReadOnlyConstraint = 10, TableEvent = 11, Tablespace = 20, LogfileGroup = 21,
  Datafile = 22, Undofile = 23, ReorgTrigger = 19, HashMap = 24
}
enum  State {
  StateUndefined = 0, StateOffline = 1, StateBuilding = 2, StateDropping = 3,
  StateOnline = 4, StateBackup = 5, StateBroken = 9
}
enum  Store { StoreUndefined = 0, StoreNotLogged = 1, StorePermanent = 2 }
enum  FragmentType {
  FragUndefined = 0, FragSingle = 1, FragAllSmall = 2, FragAllMedium = 3,
  FragAllLarge = 4, DistrKeyHash = 5, DistrKeyLin = 6, UserDefined = 7,
  HashMapPartition = 9
}

Public Member Functions

 Event (const char *name)
 Event (const char *name, const NdbDictionary::Table &table)
int setName (const char *name)
const char * getName () const
const NdbDictionary::TablegetTable () const
void setTable (const NdbDictionary::Table &table)
int setTable (const char *tableName)
const char * getTableName () const
void addTableEvent (const TableEvent te)
bool getTableEvent (const TableEvent te) const
void setDurability (EventDurability)
EventDurability getDurability () const
void setReport (EventReport)
EventReport getReport () const
void addColumn (const Column &c)
void addEventColumn (unsigned attrId)
void addEventColumn (const char *columnName)
void addEventColumns (int n, const char **columnNames)
int getNoOfEventColumns () const
const ColumngetEventColumn (unsigned no) const
void mergeEvents (bool flag)
virtual Object::Status getObjectStatus () const
virtual int getObjectVersion () const
virtual int getObjectId () const
void print ()

Friends

class NdbEventImpl
class NdbEventOperationImpl

Detailed Description

Represents an Event in NDB Cluster.

Definition at line 1404 of file NdbDictionary.hpp.

Member Enumeration Documentation

Specifies the durability of an event (future version may supply other types)

Enumerator:
ED_PERMANENT 

All API's can use it. It's still defined after a cluster system restart

Definition at line 1456 of file NdbDictionary.hpp.

Specifies reporting options for table events

Definition at line 1480 of file NdbDictionary.hpp.

Specifies the type of database operations an Event listens toTableEvent must match 1 << TriggerEvent

Enumerator:
TE_INSERT 

Insert event on table.

TE_DELETE 

Delete event on table.

TE_UPDATE 

Update event on table.

TE_SCAN 

Scan event on table.

TE_DROP 

Drop of table.

TE_ALTER 

Alter of table.

TE_CREATE 

Create of table.

TE_GCP_COMPLETE 

GCP is complete.

TE_CLUSTER_FAILURE 

Cluster is unavailable.

TE_STOP 

Stop of event operation.

TE_NODE_FAILURE 

Node failed.

TE_SUBSCRIBE 

Node subscribes.

TE_UNSUBSCRIBE 

Node unsubscribes.

TE_ALL 

Any/all event on table (not relevant when events are received)

Definition at line 1412 of file NdbDictionary.hpp.

Constructor & Destructor Documentation

NdbDictionary::Event::Event ( const char *  name)

Constructor

Parameters
nameName of event

Definition at line 1292 of file NdbDictionary.cpp.

Here is the call graph for this function:

NdbDictionary::Event::Event ( const char *  name,
const NdbDictionary::Table table 
)

Constructor

Parameters
nameName of event
tableReference retrieved from NdbDictionary

Definition at line 1298 of file NdbDictionary.cpp.

Here is the call graph for this function:

Member Function Documentation

void NdbDictionary::Event::addEventColumn ( unsigned  attrId)

Add a column on which events should be detected

Parameters
attrIdColumn id
Note
errors will mot be detected until createEvent() is called

Definition at line 1398 of file NdbDictionary.cpp.

void NdbDictionary::Event::addEventColumn ( const char *  columnName)

Add a column on which events should be detected

Parameters
columnNameColumn name
Note
errors will not be detected until createEvent() is called

Definition at line 1404 of file NdbDictionary.cpp.

void NdbDictionary::Event::addEventColumns ( int  n,
const char **  columnNames 
)

Add several columns on which events should be detected

Parameters
nNumber of columns
columnNamesColumn names
Note
errors will mot be detected until NdbDictionary::Dictionary::createEvent() is called

Definition at line 1411 of file NdbDictionary.cpp.

void NdbDictionary::Event::addTableEvent ( const TableEvent  te)

Add type of event that should be detected

Reimplemented in NdbEventImpl.

Definition at line 1355 of file NdbDictionary.cpp.

NdbDictionary::Event::EventDurability NdbDictionary::Event::getDurability ( ) const

Get durability of the event

Reimplemented in NdbEventImpl.

Definition at line 1373 of file NdbDictionary.cpp.

const NdbDictionary::Column * NdbDictionary::Event::getEventColumn ( unsigned  no) const

Get a specific column in the event

Reimplemented in NdbEventImpl.

Definition at line 1423 of file NdbDictionary.cpp.

const char * NdbDictionary::Event::getName ( ) const

Get unique identifier for the event

Reimplemented in NdbEventImpl.

Definition at line 1325 of file NdbDictionary.cpp.

int NdbDictionary::Event::getNoOfEventColumns ( ) const

Get no of columns defined in an Event

Returns
Number of columns, -1 on error

Reimplemented in NdbEventImpl.

Definition at line 1417 of file NdbDictionary.cpp.

int NdbDictionary::Event::getObjectId ( ) const
virtual

Get object id

Implements NdbDictionary::Object.

Definition at line 1446 of file NdbDictionary.cpp.

NdbDictionary::Object::Status NdbDictionary::Event::getObjectStatus ( ) const
virtual

Get object status

Implements NdbDictionary::Object.

Definition at line 1434 of file NdbDictionary.cpp.

int NdbDictionary::Event::getObjectVersion ( ) const
virtual

Get object version

Implements NdbDictionary::Object.

Definition at line 1440 of file NdbDictionary.cpp.

NdbDictionary::Event::EventReport NdbDictionary::Event::getReport ( ) const

Get report option of the event

Reimplemented in NdbEventImpl.

Definition at line 1385 of file NdbDictionary.cpp.

const NdbDictionary::Table * NdbDictionary::Event::getTable ( ) const

Get table that the event is defined on

Returns
pointer to table or NULL if no table has been defined

Reimplemented in NdbEventImpl.

Definition at line 1337 of file NdbDictionary.cpp.

Here is the caller graph for this function:

bool NdbDictionary::Event::getTableEvent ( const TableEvent  te) const

Check if a specific table event will be detected

Reimplemented in NdbEventImpl.

Definition at line 1361 of file NdbDictionary.cpp.

const char * NdbDictionary::Event::getTableName ( ) const

Get table name for events

Returns
table name

Reimplemented in NdbEventImpl.

Definition at line 1349 of file NdbDictionary.cpp.

void NdbDictionary::Event::mergeEvents ( bool  flag)

The merge events flag is false by default. Setting it true implies that events are merged in following ways:

  • for given NdbEventOperation associated with this event, events on same PK within same GCI are merged into 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 the blob part events can be read via NdbBlob methods as a single value

NOTE: Currently this flag is not inherited by NdbEventOperation and must be set on NdbEventOperation explicitly.

Definition at line 1428 of file NdbDictionary.cpp.

void NdbDictionary::Event::setDurability ( EventDurability  d)

Set durability of the event

Reimplemented in NdbEventImpl.

Definition at line 1367 of file NdbDictionary.cpp.

int NdbDictionary::Event::setName ( const char *  name)

Set unique identifier for the event

Reimplemented in NdbEventImpl.

Definition at line 1319 of file NdbDictionary.cpp.

Here is the caller graph for this function:

void NdbDictionary::Event::setReport ( EventReport  r)

Set report option of the event

Reimplemented in NdbEventImpl.

Definition at line 1379 of file NdbDictionary.cpp.

void NdbDictionary::Event::setTable ( const NdbDictionary::Table table)

Define table on which events should be detected

Note
calling this method will default to detection of events on all columns. Calling subsequent addEventColumn calls will override this.
Parameters
tablereference retrieved from NdbDictionary

Reimplemented in NdbEventImpl.

Definition at line 1331 of file NdbDictionary.cpp.

Here is the caller graph for this function:

int NdbDictionary::Event::setTable ( const char *  tableName)

Set table for which events should be detected

Note
preferred way is using setTable(const NdbDictionary::Table&) or constructor with table object parameter

Reimplemented in NdbEventImpl.

Definition at line 1343 of file NdbDictionary.cpp.


The documentation for this class was generated from the following files: