MySQL NDB Cluster API Developer Guide
This section provides information about the
Tablespace
class.
None
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.
The following table lists the public methods of this class and the purpose or use of each method:
Table 2.80 Tablespace class methods and descriptions
Name | Description |
---|---|
Tablespace() |
Class constructor |
~Tablespace() |
Virtual destructor method |
getAutoGrowSpecification() |
Used to obtain the
AutoGrowSpecification
structure associated with the tablespace |
getDefaultLogfileGroup() |
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 instance |
getObjectStatus() |
Used to obtain the Object::Status of
the Tablespace instance for which
it is called |
getObjectVersion() |
Gets the object version of the Tablespace object for
which it is invoked |
setAutoGrowSpecification() |
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 |
The Tablespace class defines no public types of its own;
however, two of its methods make use of the
AutoGrowSpecification
data structure.
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
)
New instance: None. Copy constructor: a
reference to an existing
Tablespace
instance.
A Tablespace
object.
Destructor.
The class defines a virtual destructor
~Tablespace()
which takes no arguments and
returns no value.
Description.
const AutoGrowSpecification& getAutoGrowSpecification ( void ) const
None.
A reference to the structure which describes the tablespace auto-grow characteristics; for details, see NdbDictionary::AutoGrowSpecification.
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().
const char* getDefaultLogfileGroup ( void ) const
None.
The name of the log file group (string value as character pointer).
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().
Uint32 getDefaultLogfileGroupId ( void ) const
None.
The ID of the log file group, as an unsigned 32-bit integer.
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.
Uint32 getExtentSize ( void ) const
None.
The tablespace's extent size in bytes, as an unsigned 32-bit integer.
This method retrieves the tablespace's object ID.
virtual int getObjectId ( void ) const
None.
The object ID, as an integer.
This method retrieves the name of the tablespace.
const char* getName ( void ) const
None.
The name of the tablespace, a string value (as a character pointer).
This method is used to retrieve the object status of a tablespace.
virtual Object::Status getObjectStatus ( void ) const
None.
An Object::Status
value.
This method gets the tablespace object version (see NDB Schema Object Versions).
virtual int getObjectVersion ( void ) const
None.
The object version, as an integer.
This method is used to set the auto-grow characteristics of the tablespace.
void setAutoGrowSpecification
(
const AutoGrowSpecification& autoGrowSpec
)
This method takes a single parameter, an
AutoGrowSpecification
data structure.
None.
This method is used to set a tablespace's default log file group.
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.
Either the name
of the log file
group to be assigned to the tablespace, or a reference
lGroup
to this log file group.
None.