Documentation Home
MySQL NDB Cluster API Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 3.7Mb
PDF (A4) - 3.7Mb


2.3.26 The Object Class

This section provides information about theObject class, which contains meta-information about database objects such as tables and indexes.Object subclasses model these and other database objects.

Object Class Overview

Parent class

NdbDictionary

Child classes

Datafile,Event,Index,LogfileGroup,Table,Tablespace,Undofile,HashMap,ForeignKey

Methods

The following table lists the public methods of theObject class and the purpose or use of each method:

Table 2.71 Object class methods and descriptions

NameDescription
getObjectId()Gets an object's ID
getObjectStatus()Gets an object's status
getObjectVersion()Gets the version of an object

All 3 of these methods are pure virtual methods, and are reimplemented in theTable,Index, andEvent subclasses where needed.

Types

These are the public types of theObject class:

Table 2.72 Object class types and descriptions

NameDescription
FragmentTypeFragmentation type used by the object (a table or index)
StateThe object's state (whether it is usable)
StatusThe object's state (whether it is available)
StoreWhether the object has been temporarily or permanently stored
TypeThe object's type (what sort of table, index, or other database object theObject represents)

Object::FragmentType

This section provides information about theFragmentType type, which describes the fragmentation type of an instance ofObject.

Description

This parameter specifies how data in the table or index is distributed among the cluster's data nodes, that is, the number of fragments per node. The larger the table, the larger the number of fragments that should be used. Note that all fragment replicas count as a single fragment. For a table, the default isFragAllMedium. For a unique hash index, the default is taken from the underlying table and cannot currently be changed.

Enumeration values

Possible values forFragmentType are shown, along with descriptions, in the following table:

Table 2.73 FragmentType values and descriptions

NameDescription
FragUndefinedThe fragmentation type is undefined or the default
FragAllMediumTwo fragments per node
FragAllLargeFour fragments per node
DistrKeyHashDistributed hash key
DistrKeyLinDistributed linear hash key
UserDefinedUser defined
HashMapPartitionHash map partition

Object::getObjectStatus()

Description

This method retrieves the status of the object for which it is invoked.

Signature
virtual Status getObjectStatus    (      void    ) const
Parameters

None.

Return value

Returns the currentStatus of theObject.

Object::getObjectId()

Description

This method retrieves the object's ID.

Signature
virtual int getObjectId    (      void    ) const
Parameters

None.

Return value

The object ID, an integer.

Object::getObjectVersion()

Description

The method gets the current version of the object.

Signature
virtual int getObjectVersion    (      void    ) const
Parameters

None.

Return value

The object's version number, an integer.

Object::PartitionBalance

This section provides information about thePartitionBalance data type.

Description

This type enumerates partition balance settings (fragment count types) from which to choose when usingsetPartitionBalance(). This is also the type returned bygetPartitionBalance()

Enumeration values

Possible values forPartitionBalance are shown, along with descriptions, in the following table:

Table 2.74 Object::PartitionBalance data type values and descriptions

NameDescription
PartitionBalance_ForRPByLDMUse one fragment per LDM per node
PartitionBalance_ForRAByLDMUse one fragment per LDM per node group
PartitionBalance_ForRPByNodeUse one fragment per node
PartitionBalance_ForRAByNodeUse one fragment per node group
PartitionBalance_SpecificUse setting determined bysetPartitionBalance()

In NDB 7.4 and earlier, this was known asFragmentCountType, and could take one of the valuesFragmentCount_OnePerLDMPerNode,FragmentCount_OnePerLDMPerNodeGroup,FragmentCount_OnePerNode,FragmentCount_OnePerNodeGroup, orFragmentCount_Specific. These values correspond to those shown in the previous table, in the order shown.

Object::State

This section provides information about theState type, which models the state of theObject.

Description

This parameter provides us with the object's state. Bystate, we mean whether or not the object is defined and is in a usable condition. The numeric values are used in thestate columns of thedict_obj_info andhash_maps tables in thendbinfo information database.

Enumeration values

Possible values forState are shown, along with descriptions, in the following table:

Table 2.75 Object State type values and descriptions

IDNameDescription
1StateUndefinedUndefined
StateOfflineOffline, not useable
2StateBuildingBuilding (e.g. restore?), not useable(?)
3StateDroppingGoing offline or being dropped; not usable
4StateOnlineOnline, usable
5StateBackupOnline, being backed up, usable
6StateBrokenBroken; should be dropped and re-created

Object::Status

This section provides information about theStatus type, which models the status of anObject.

Description

Reading an object'sStatus tells whether or not it is available in theNDB kernel.

Enumeration values

Possible values forStatus are shown, along with descriptions, in the following table:

Table 2.76 Object Status data type values and descriptions

NameDescription
NewThe object exists only in memory, and has not yet been created in theNDB kernel
ChangedThe object has been modified in memory, and must be committed in theNDB Kernel for changes to take effect
RetrievedThe object exists, and has been read into main memory from theNDB Kernel
InvalidThe object has been invalidated, and should no longer be used
AlteredThe table has been altered in theNDB kernel, but is still available for use

Object::Store

This section provides information about theStore type, which describes the persistence of anObject.

Description

Reading this value tells us is the object is temporary or permanent.

Enumeration values

Possible values forStore are shown, along with descriptions, in the following table:

Table 2.77 Object Store data type values and descriptions

NameDescription
StoreUndefinedThe object is undefined
StoreTemporaryTemporary storage; the object or data will be deleted on system restart
StorePermanentThe object or data is permanent; it has been logged to disk

Object::Type

This section provides information about theType type.

Description

TheType of the object can be one of several different sorts of index, trigger, tablespace, and so on.

Enumeration values

Possible values forType are shown, along with descriptions, in the following table:

Table 2.78 Object Type data type values and descriptions

NameDescription
TypeUndefinedUndefined
SystemTableSystem table
UserTableUser table (may be temporary)
UniqueHashIndexUnique (but unordered) hash index
OrderedIndexOrdered (but not unique) index
HashIndexTriggerIndex maintenance (internal)
IndexTriggerIndex maintenance (internal)
SubscriptionTriggerBackup or replication (internal)
ReadOnlyConstraintTrigger (internal)
TablespaceTablespace
LogfileGroupLog file group
DatafileData file
UndofileUndo file
ReorgTriggerTrigger
HashMapHash map
ForeignKeyForeign key
FKParentTriggerTrigger on a foreign key's parent table
FKChildTriggerTrigger on a foreign key's child table

For more information aboutForeignKey,FKParentTrigger, andFKChildTrigger, seeSection 2.3.6, “The ForeignKey Class”.