NdbDictionary::Event Class Reference

Represents an Event in NDB Cluster. More...

#include <NdbDictionary.hpp>

Inheritance diagram for NdbDictionary::Event:

NdbDictionary::Object

List of all members.

Public Types

enum  TableEvent {
  TE_INSERT = 1<<0, TE_DELETE = 1<<1, TE_UPDATE = 1<<2, 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  EventDurability { ED_UNDEFINED, ED_PERMANENT }
enum  EventReport { ER_UPDATED = 0, ER_ALL = 1, ER_SUBSCRIBE = 2 }
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)
virtual ~Event ()
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 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

Private Member Functions

 Event (NdbEventImpl &)

Private Attributes

class NdbEventImpl & m_impl


Detailed Description

Represents an Event in NDB Cluster.

Member Enumeration Documentation

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

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

Specifies reporting options for table events

Enumerator:
ER_UPDATED 
ER_ALL 
ER_SUBSCRIBE 

Type of fragmentation.

This parameter specifies how data in the table or index will be distributed among the db nodes in the cluster.
The bigger the table the more number of fragments should be used. Note that all replicas count as same "fragment".
For a table, default is FragAllMedium. For a unique hash index, default is taken from underlying table and cannot currently be changed.

Enumerator:
FragUndefined  Fragmentation type undefined or default.
FragSingle  Only one fragment.
FragAllSmall  One fragment per node, default.
FragAllMedium  two fragments per node
FragAllLarge  Four fragments per node.
DistrKeyHash 
DistrKeyLin 
UserDefined 
HashMapPartition 

enum NdbDictionary::Object::State [inherited]

Object state

Enumerator:
StateUndefined  Undefined.
StateOffline  Offline, not usable.
StateBuilding  Building, not yet usable.
StateDropping  Offlining or dropping, not usable.
StateOnline  Online, usable.
StateBackup  Online, being backuped, usable.
StateBroken  Broken, should be dropped and re-created.

Status of object

Enumerator:
New  The object only exist in memory and has not been created in the NDB Kernel
Changed  The object has been modified in memory and has to be commited in NDB Kernel for changes to take effect
Retrieved  The object exist and has been read into main memory from NDB Kernel
Invalid  The object has been invalidated and should not be used
Altered  Table has been altered in NDB kernel but is still valid for usage

enum NdbDictionary::Object::Store [inherited]

Object store

Enumerator:
StoreUndefined  Undefined.
StoreNotLogged  Object or data deleted on system restart.
StorePermanent  Permanent. logged to disk.

Specifies the type of database operations an Event listens to

Enumerator:
TE_INSERT  Insert event on table.
TE_DELETE  Delete event on table.
TE_UPDATE  Update 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)

Reimplemented from NdbDictionary::Object.

enum NdbDictionary::Object::Type [inherited]

Object type

Enumerator:
TypeUndefined  Undefined.
SystemTable  System table.
UserTable  User table (may be temporary).
UniqueHashIndex  Unique un-ordered hash index.
OrderedIndex  Non-unique ordered index.
HashIndexTrigger  Index maintenance, internal.
IndexTrigger  Index maintenance, internal.
SubscriptionTrigger  Backup or replication, internal.
ReadOnlyConstraint  Trigger, internal.
TableEvent  Table event.
Tablespace  Tablespace.
LogfileGroup  Logfile group.
Datafile  Datafile.
Undofile  Undofile.
ReorgTrigger 
HashMap 

Reimplemented in NdbDictionary::Index.


Constructor & Destructor Documentation

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

Constructor

Parameters:
name Name of event

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

Constructor

Parameters:
name Name of event
table Reference retrieved from NdbDictionary

virtual NdbDictionary::Event::~Event (  )  [virtual]

NdbDictionary::Event::Event ( NdbEventImpl &   )  [private]


Member Function Documentation

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

Add a column on which events should be detected

Parameters:
columnName Column name
Note:
errors will not be detected until createEvent() is called

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

Add a column on which events should be detected

Parameters:
attrId Column id
Note:
errors will mot be detected until createEvent() is called

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

Add several columns on which events should be detected

Parameters:
n Number of columns
columnNames Column names
Note:
errors will mot be detected until NdbDictionary::Dictionary::createEvent() is called

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

Add type of event that should be detected

EventDurability NdbDictionary::Event::getDurability (  )  const

Get durability of the event

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

Get a specific column in the event

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

Get unique identifier for the event

int NdbDictionary::Event::getNoOfEventColumns (  )  const

Get no of columns defined in an Event

Returns:
Number of columns, -1 on error

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

Get object id

Implements NdbDictionary::Object.

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

Get object status

Implements NdbDictionary::Object.

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

Get object version

Implements NdbDictionary::Object.

EventReport NdbDictionary::Event::getReport (  )  const

Get report option of the event

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

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

Check if a specific table event will be detected

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

Get table name for events

Returns:
table name

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.

void NdbDictionary::Event::setDurability ( EventDurability   ) 

Set durability of the event

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

Set unique identifier for the event

void NdbDictionary::Event::setReport ( EventReport   ) 

Set report option of the event

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

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:
table reference retrieved from NdbDictionary


Member Data Documentation

class NdbEventImpl& NdbDictionary::Event::m_impl [private]


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

MySQL Cluster Database Blog

Based on MySQL Cluster 7.0.10.

This page is for information only and is not maintained by MySQL or Sun Microsystems - use at your own risk. For an upto date view of the API refer to the header files included with your MySQL Cluster distribution or check the MySQL Cluster API Developer Guide.