Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual

2.3.28 The Tablespace Class

This section provides information about the Tablespace class.

Tablespace Class Overview

Parent class

NdbDictionary

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.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

Types

The Tablespace class defines no public types of its own; however, two of its methods make use of the AutoGrowSpecification data structure.

Tablespace Constructor

Description

These methods are used to create a new instance of Tablespace, or to copy an existing one.

Note

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.

Tablespace::getAutoGrowSpecification()

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.

Tablespace::getDefaultLogfileGroup()

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).

Tablespace::getDefaultLogfileGroupId()

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.

Tablespace::getExtentSize()

Description

This method is used to retrieve the extent size—that is the size of the memory allocation units—used by the tablespace.

Note

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.

Tablespace::getObjectId()

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.

Tablespace::getName()

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).

Tablespace::getObjectStatus()

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.

Tablespace::getObjectVersion()

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.

Tablespace::setAutoGrowSpecification()

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.

Tablespace::setDefaultLogfileGroup()

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 reference lGroup to this log file group.

Return value

None.

Tablespace::setExtentSize()

Description

This method sets the tablespace's extent size.

Signature
void setExtentSize
    (
      Uint32 size
    )
Parameters

The size to be used for this tablespace's extents, in bytes.

Return value

None.

Tablespace::setName()

Description

This method sets the name of the tablespace.

Signature
void setName
    (
      const char* name
    ) const
Parameters

The name of the tablespace, a string (character pointer).

Return value

None.