#include <NdbDictionary.hpp>
Classes | |
| class | List |
| Structure for retrieving lists of object names. More... | |
Public Member Functions | |
| NdbRecord * | createRecord (const Table *table, const RecordSpecification *recSpec, Uint32 length, Uint32 elemSize, Uint32 flags=0) |
| NdbRecord * | createRecord (const Index *index, const Table *table, const RecordSpecification *recSpec, Uint32 length, Uint32 elemSize, Uint32 flags=0) |
| NdbRecord * | createRecord (const Index *index, const RecordSpecification *recSpec, Uint32 length, Uint32 elemSize, Uint32 flags=0) |
| void | releaseRecord (NdbRecord *rec) |
General | |
| int | listObjects (List &list, Object::Type type=Object::TypeUndefined) |
| int | listObjects (List &list, Object::Type type=Object::TypeUndefined) const |
| int | listObjects (List &list, Object::Type type, bool fullyQualified) const |
| struct NdbError & | getNdbError () const |
Retrieving references to Tables and Indexes | |
| const Table * | getTable (const char *name) const |
| const Index * | getIndex (const char *indexName, const char *tableName) const |
| int | listIndexes (List &list, const char *tableName) |
| int | listIndexes (List &list, const char *tableName) const |
Events | |
| int | createEvent (const Event &event) |
| int | dropEvent (const char *eventName, int force=0) |
| const Event * | getEvent (const char *eventName) |
| int | listEvents (List &list) |
| int | listEvents (List &list) const |
Table creation | |
These methods should normally not be used in an application as the result will not be visible from the MySQL Server | |
| int | createTable (const Table &table) |
| int | optimizeTable (const Table &t, OptimizeTableHandle &h) |
| int | optimizeIndex (const Index &ind, OptimizeIndexHandle &h) |
| int | dropTable (Table &table) |
| int | dropTable (const char *name) |
| bool | supportedAlterTable (const Table &f, const Table &t) |
| void | removeCachedTable (const char *table) |
| void | removeCachedIndex (const char *index, const char *table) |
Index creation | |
These methods should normally not be used in an application as the result will not be visible from the MySQL Server | |
| int | createIndex (const Index &index) |
| int | createIndex (const Index &index, const Table &table) |
| int | dropIndex (const char *indexName, const char *tableName) |
Disk data objects | |
| int | createLogfileGroup (const LogfileGroup &, ObjectId *=0) |
| int | dropLogfileGroup (const LogfileGroup &) |
| LogfileGroup | getLogfileGroup (const char *name) |
| int | createTablespace (const Tablespace &, ObjectId *=0) |
| int | dropTablespace (const Tablespace &) |
| Tablespace | getTablespace (const char *name) |
| Tablespace | getTablespace (Uint32 tablespaceId) |
| int | createDatafile (const Datafile &, bool overwrite_existing=false, ObjectId *=0) |
| int | dropDatafile (const Datafile &) |
| Datafile | getDatafile (Uint32 node, const char *path) |
| int | createUndofile (const Undofile &, bool overwrite_existing=false, ObjectId *=0) |
| int | dropUndofile (const Undofile &) |
| Undofile | getUndofile (Uint32 node, const char *path) |
HashMap | |
| int | createHashMap (const HashMap &, ObjectId *=0) |
| int | getHashMap (HashMap &dst, const char *name) |
| int | getHashMap (HashMap &dst, const Table *table) |
| int | getDefaultHashMap (HashMap &dst, Uint32 fragments) |
| int | initDefaultHashMap (HashMap &dst, Uint32 fragments) |
| int | prepareHashMap (const Table &oldTable, Table &newTable) |
Protected Member Functions | |
| Dictionary (Ndb &ndb) | |
| ~Dictionary () | |
Private Member Functions | |
| Dictionary (NdbDictionaryImpl &) | |
| const Table * | getIndexTable (const char *indexName, const char *tableName) const |
Private Attributes | |
| class NdbDictionaryImpl & | m_impl |
Schema transactions | |
| Metadata operations are create, alter, and drop of objects of various types. An operation may create additional sub-operations in the kernel. By default, each user operation is executed separately. That is, a schema transaction is started implicitly, the operation and its suboperations are executed, and the transaction is closed. The Ndb object and its associated Dictionary support one schema transaction at a time. Using begin and end transaction explicitly it is possible to execute a set of user defined operations atomically i.e. either all operations succeed or all are aborted (rolled back). The steps are 1) beginSchemaTrans 2) submit operations such as createTable 3) endSchemaTrans. Each operation is sent to the kernel which parses and saves it. Parse failure does rollback to previous user operation before returning. The user can continue or abort entire transaction. After all operations have been submitted, endSchemaTrans with flags 0 (the default) processes and commits them. On error return the transaction is already aborted.
If the user exits before calling endSchemaTrans, the kernel aborts the transaction. If the user exits before the call to endSchemaTrans returns, the kernel continues with the request. Completion status is reported in cluster log. | |
| enum | SchemaTransFlag { SchemaTransAbort = 1, SchemaTransBackground = 2 } |
| int | beginSchemaTrans () |
| int | endSchemaTrans (Uint32 flags=0) |
| bool | hasSchemaTrans () const |
| NdbDictionary::Dictionary::Dictionary | ( | Ndb & | ndb | ) | [protected] |
| NdbDictionary::Dictionary::~Dictionary | ( | ) | [protected] |
| NdbDictionary::Dictionary::Dictionary | ( | NdbDictionaryImpl & | ) | [private] |
| int NdbDictionary::Dictionary::beginSchemaTrans | ( | ) |
Begin schema transaction. Returns error if a transaction is already active or if the kernel metadata is locked.
| int NdbDictionary::Dictionary::createDatafile | ( | const Datafile & | , | |
| bool | overwrite_existing = false, |
|||
| ObjectId * | = 0 | |||
| ) |
| int NdbDictionary::Dictionary::createEvent | ( | const Event & | event | ) |
Create a HashMap in database
| int NdbDictionary::Dictionary::createIndex | ( | const Index & | index | ) |
| int NdbDictionary::Dictionary::createLogfileGroup | ( | const LogfileGroup & | , | |
| ObjectId * | = 0 | |||
| ) |
| NdbRecord* NdbDictionary::Dictionary::createRecord | ( | const Index * | index, | |
| const RecordSpecification * | recSpec, | |||
| Uint32 | length, | |||
| Uint32 | elemSize, | |||
| Uint32 | flags = 0 | |||
| ) |
| NdbRecord* NdbDictionary::Dictionary::createRecord | ( | const Index * | index, | |
| const Table * | table, | |||
| const RecordSpecification * | recSpec, | |||
| Uint32 | length, | |||
| Uint32 | elemSize, | |||
| Uint32 | flags = 0 | |||
| ) |
| NdbRecord* NdbDictionary::Dictionary::createRecord | ( | const Table * | table, | |
| const RecordSpecification * | recSpec, | |||
| Uint32 | length, | |||
| Uint32 | elemSize, | |||
| Uint32 | flags = 0 | |||
| ) |
| int NdbDictionary::Dictionary::createTable | ( | const Table & | table | ) |
| int NdbDictionary::Dictionary::createTablespace | ( | const Tablespace & | , | |
| ObjectId * | = 0 | |||
| ) |
| int NdbDictionary::Dictionary::createUndofile | ( | const Undofile & | , | |
| bool | overwrite_existing = false, |
|||
| ObjectId * | = 0 | |||
| ) |
| int NdbDictionary::Dictionary::dropDatafile | ( | const Datafile & | ) |
| int NdbDictionary::Dictionary::dropEvent | ( | const char * | eventName, | |
| int | force = 0 | |||
| ) |
Drop event with given name
| eventName | Name of event to drop. |
| int NdbDictionary::Dictionary::dropIndex | ( | const char * | indexName, | |
| const char * | tableName | |||
| ) |
Drop index with given name
| indexName | Name of index to drop. | |
| tableName | Name of table that index belongs to. |
| int NdbDictionary::Dictionary::dropLogfileGroup | ( | const LogfileGroup & | ) |
| int NdbDictionary::Dictionary::dropTable | ( | const char * | name | ) |
Drop table given table name
| name | Name of table to drop |
| int NdbDictionary::Dictionary::dropTable | ( | Table & | table | ) |
| int NdbDictionary::Dictionary::dropTablespace | ( | const Tablespace & | ) |
| int NdbDictionary::Dictionary::dropUndofile | ( | const Undofile & | ) |
| int NdbDictionary::Dictionary::endSchemaTrans | ( | Uint32 | flags = 0 |
) |
End schema transaction, with commit or with abort. Combines execute and close which do not exist separately. May be called and succeeds even if no transaction is active.
| flags | Bitmask of options. Default 0 commits the transaction. Including option 1 aborts the transaction. See SchemaTransFlag for others. |
| Datafile NdbDictionary::Dictionary::getDatafile | ( | Uint32 | node, | |
| const char * | path | |||
| ) |
| int NdbDictionary::Dictionary::getDefaultHashMap | ( | HashMap & | dst, | |
| Uint32 | fragments | |||
| ) |
Get default HashMap
| const Event* NdbDictionary::Dictionary::getEvent | ( | const char * | eventName | ) |
Get event with given name.
| eventName | Name of event to get. |
Get a HashMap for a table
| int NdbDictionary::Dictionary::getHashMap | ( | HashMap & | dst, | |
| const char * | name | |||
| ) |
Get a HashMap by name
| const Index* NdbDictionary::Dictionary::getIndex | ( | const char * | indexName, | |
| const char * | tableName | |||
| ) | const |
Get index with given name, NULL if undefined
| indexName | Name of index to get. | |
| tableName | Name of table that index belongs to. |
| const Table* NdbDictionary::Dictionary::getIndexTable | ( | const char * | indexName, | |
| const char * | tableName | |||
| ) | const [private] |
| LogfileGroup NdbDictionary::Dictionary::getLogfileGroup | ( | const char * | name | ) |
| struct NdbError& NdbDictionary::Dictionary::getNdbError | ( | ) | const [read] |
Get the latest error
| const Table* NdbDictionary::Dictionary::getTable | ( | const char * | name | ) | const |
Get table with given name, NULL if undefined
| name | Name of table to get |
| Tablespace NdbDictionary::Dictionary::getTablespace | ( | Uint32 | tablespaceId | ) |
| Tablespace NdbDictionary::Dictionary::getTablespace | ( | const char * | name | ) |
| Undofile NdbDictionary::Dictionary::getUndofile | ( | Uint32 | node, | |
| const char * | path | |||
| ) |
| bool NdbDictionary::Dictionary::hasSchemaTrans | ( | ) | const |
Check if a schema transaction exists currently.
| int NdbDictionary::Dictionary::initDefaultHashMap | ( | HashMap & | dst, | |
| Uint32 | fragments | |||
| ) |
Init a default HashMap
| int NdbDictionary::Dictionary::listEvents | ( | List & | list | ) | const |
| int NdbDictionary::Dictionary::listEvents | ( | List & | list | ) |
| int NdbDictionary::Dictionary::listIndexes | ( | List & | list, | |
| const char * | tableName | |||
| ) | const |
| int NdbDictionary::Dictionary::listIndexes | ( | List & | list, | |
| const char * | tableName | |||
| ) |
Fetch list of indexes of given table.
| list | Reference to list where to store the listed indexes | |
| tableName | Name of table that index belongs to. |
| int NdbDictionary::Dictionary::listObjects | ( | List & | list, | |
| Object::Type | type, | |||
| bool | fullyQualified | |||
| ) | const |
| int NdbDictionary::Dictionary::listObjects | ( | List & | list, | |
| Object::Type | type = Object::TypeUndefined | |||
| ) | const |
| int NdbDictionary::Dictionary::listObjects | ( | List & | list, | |
| Object::Type | type = Object::TypeUndefined | |||
| ) |
Fetch list of all objects, optionally restricted to given type.
| list | List of objects returned in the dictionary | |
| type | Restrict returned list to only contain objects of this type |
| int NdbDictionary::Dictionary::optimizeIndex | ( | const Index & | ind, | |
| OptimizeIndexHandle & | h | |||
| ) |
Start index optimization given defined index object
| ind | Object of index to optimize | |
| Pre-allocated | OptimizeIndexHandle |
| int NdbDictionary::Dictionary::optimizeTable | ( | const Table & | t, | |
| OptimizeTableHandle & | h | |||
| ) |
Start table optimization given defined table object
| t | Object of table to optimize | |
| Pre-allocated | OptimizeTableHandle |
create (or retreive) a HashMap suitable for alter NOTE: Requires a started schema transaction
| void NdbDictionary::Dictionary::releaseRecord | ( | NdbRecord * | rec | ) |
| void NdbDictionary::Dictionary::removeCachedIndex | ( | const char * | index, | |
| const char * | table | |||
| ) |
Remove index from local cache
| void NdbDictionary::Dictionary::removeCachedTable | ( | const char * | table | ) |
Remove table from local cache
class NdbDictionaryImpl& NdbDictionary::Dictionary::m_impl [private] |
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.