2.3.37.1 Tablespace Methods

2.3.37.1.1 Tablespace Constructor
2.3.37.1.2 Tablespace::getAutoGrowSpecification()
2.3.37.1.3 Tablespace::getDefaultLogfileGroup()
2.3.37.1.4 Tablespace::getDefaultLogfileGroupId()
2.3.37.1.5 Tablespace::getExtentSize()
2.3.37.1.6 Tablespace::getObjectId()
2.3.37.1.7 Tablespace::getName()
2.3.37.1.8 Tablespace::getObjectStatus()
2.3.37.1.9 Tablespace::getObjectVersion()
2.3.37.1.10 Tablespace::setAutoGrowSpecification()
2.3.37.1.11 Tablespace::setDefaultLogfileGroup()
2.3.37.1.12 Tablespace::setExtentSize()
2.3.37.1.13 Tablespace::setName()

Abstract

This section provides details of the public members of the NDB API's Tablespace class.

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

2.3.37.1.2 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 Section 2.3.1, “The AutoGrowSpecification Structure”.

2.3.37.1.3 Tablespace::getDefaultLogfileGroup()

Description.  This method retrieves the name of the tablespace's default log file group.

Note

Alternatively, you may wish to obtain the ID of the default log file group; see Section 2.3.37.1.4, “Tablespace::getDefaultLogfileGroupId().

Signature. 

const char* getDefaultLogfileGroup
    (
      void
    ) const

Parameters.  None.

Return value.  The name of the log file group (string value as character pointer).

2.3.37.1.4 Tablespace::getDefaultLogfileGroupId()

Description.  This method retrieves the ID of the tablespace's default log file group.

Note

You can also obtain directly the name of the default log file group rather than its ID; see Section 2.3.37.1.3, “Tablespace::getDefaultLogfileGroup(), for more information.

Signature. 

Uint32 getDefaultLogfileGroupId
    (
      void
    ) const

Parameters.  None.

Return value.  The ID of the log file group, as an unsigned 32-bit integer.

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

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

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

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

2.3.37.1.9 Tablespace::getObjectVersion()

Description.  This method gets the tablespace object version (see Section 8.6, “NDB Schema Object Versions”).

Signature. 

virtual int getObjectVersion
  (
    void
  ) const

Parameters.  None.

Return value.  The object version, as an integer.

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

2.3.37.1.11 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
    )
Note

There is no method for setting a log file group as the default for a tablespace by referencing the log file group's ID. (In other words, there is no set*() method corresponding to getDefaultLogfileGroupId().)

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.

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

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