This section provides information about the
Tablespace
class.
- Parent class
- Child classes
None
- Description
-
The
Tablespace
class models an NDB Cluster Disk Data tablespace, which contains the data files used to store Cluster Disk Data. For an overview of Cluster Disk Data and data file characteristics, see CREATE TABLESPACE Statement, in the MySQL Manual.Only unindexed column data can be stored on disk. Indexes and indexes columns are always stored in memory.
- Methods
-
The following table lists the public methods of this class and the purpose or use of each method:
Table 2.81 Tablespace class methods and descriptions
Name Description Tablespace()
Class constructor ~Tablespace()
Virtual destructor method getAutoGrowSpecification()
Used to obtain the AutoGrowSpecification
structure associated with the tablespacegetDefaultLogfileGroup()
Gets the name of the tablespace's default log file group getDefaultLogfileGroupId()
Gets the ID of the tablespace's default log file group getExtentSize()
Gets the extent size used by the tablespace getName()
Gets the name of the tablespace getObjectId()
Gets the object ID of a Tablespace
instancegetObjectStatus()
Used to obtain the Object::Status
of theTablespace
instance for which it is calledgetObjectVersion()
Gets the object version of the Tablespace
object for which it is invokedsetAutoGrowSpecification()
Used to set the auto-grow characteristics of the tablespace setDefaultLogfileGroup()
Sets the tablespace's default log file group setExtentSize()
Sets the size of the extents used by the tablespace setName()
Sets the name for the tablespace
- Types
The Tablespace class defines no public types of its own; however, two of its methods make use of the
AutoGrowSpecification
data structure.
- Description
These methods are used to create a new instance of
Tablespace
, or to copy an existing one.
The Dictionary
class also
supplies methods for creating and dropping tablespaces.
Signatures. New instance:
Tablespace
(
void
)
Copy constructor:
Tablespace
(
const Tablespace& tablespace
)
- Parameters
New instance: None. Copy constructor: a reference to an existing
Tablespace
instance.- Return value
A
Tablespace
object.
Destructor.
The class defines a virtual destructor
~Tablespace()
which takes no arguments and
returns no value.
Description.
- Signature
const AutoGrowSpecification& getAutoGrowSpecification ( void ) const
- Parameters
None.
- Return value
A reference to the structure which describes the tablespace auto-grow characteristics; for details, see NdbDictionary::AutoGrowSpecification.
- Description
-
This method retrieves the name of the tablespace's default log file group.
Alternatively, you may wish to obtain the ID of the default log file group; see Tablespace::getDefaultLogfileGroupId().
- Signature
const char* getDefaultLogfileGroup ( void ) const
- Parameters
None.
- Return value
The name of the log file group (string value as character pointer).
- Description
-
This method retrieves the ID of the tablespace's default log file group.
You can also obtain directly the name of the default log file group rather than its ID; see Tablespace::getDefaultLogfileGroup().
- Signature
Uint32 getDefaultLogfileGroupId ( void ) const
- Parameters
None.
- Return value
The ID of the log file group, as an unsigned 32-bit integer.
- Description
This method is used to retrieve the extent size—that is the size of the memory allocation units—used by the tablespace.
The same extent size is used for all data files contained in a given tablespace.
- Signature
Uint32 getExtentSize ( void ) const
- Parameters
None.
- Return value
The tablespace's extent size in bytes, as an unsigned 32-bit integer.
- Description
This method retrieves the tablespace's object ID.
- Signature
virtual int getObjectId ( void ) const
- Parameters
None.
- Return value
The object ID, as an integer.
- Description
This method retrieves the name of the tablespace.
- Signature
const char* getName ( void ) const
- Parameters
None.
- Return value
The name of the tablespace, a string value (as a character pointer).
- Description
This method is used to retrieve the object status of a tablespace.
- Signature
virtual Object::Status getObjectStatus ( void ) const
- Parameters
None.
- Return value
An
Object::Status
value.
- Description
This method gets the tablespace object version (see NDB Schema Object Versions).
- Signature
virtual int getObjectVersion ( void ) const
- Parameters
None.
- Return value
The object version, as an integer.
- Description
This method is used to set the auto-grow characteristics of the tablespace.
- Signature
void setAutoGrowSpecification ( const AutoGrowSpecification& autoGrowSpec )
- Parameters
This method takes a single parameter, an
AutoGrowSpecification
data structure.- Return value
None.
- Description
This method is used to set a tablespace's default log file group.
- Signature
-
This method can be called in two different ways. The first of these uses the name of the log file group, as shown here:
void setDefaultLogfileGroup ( const char* name )
This method can also be called by passing it a reference to a
LogfileGroup
object:void setDefaultLogfileGroup ( const class LogfileGroup& lGroup )
The NDB API provides no method for setting a log file group as the default for a tablespace by referencing the log file group's ID.
- Parameters
Either the
name
of the log file group to be assigned to the tablespace, or a referencelGroup
to this log file group.- Return value
None.