MySQL NDB Cluster API Developer Guide
This section provides information about the
Datafile
class, which models an NDB Cluster data
file.
None
The Datafile
class models an NDB Cluster
data file, which is used to store Disk Data table and column
data.
Only unindexed column data can be stored on disk. Indexes and indexed columns are stored in memory.
The following table lists the public methods of this class and the purpose or use of each method:
Table 2.11 Datafile class methods and descriptions
Name | Description |
---|---|
Datafile() |
Class constructor |
~Datafile() |
Destructor |
getFileNo() |
Removed in NDB 7.5.0 (Bug #47960, Bug #11756088) |
getFree() |
Gets the amount of free space in the data file |
getNode() |
Removed in NDB 7.5.0 (Bug #47960, Bug #11756088) |
getObjectId() |
Gets the data file's object ID |
getObjectStatus() |
Gets the data file's object status |
getObjectVersion() |
Gets the data file's object version |
getPath() |
Gets the file system path to the data file |
getSize() |
Gets the size of the data file |
getTablespace() |
Gets the name of the tablespace to which the data file belongs |
getTablespaceId() |
Gets the ID of the tablespace to which the data file belongs |
setNode() |
Removed in NDB 7.5.0 (Bug #47960, Bug #11756088) |
setPath() |
Sets the name and location of the data file on the file system |
setSize() |
Sets the data file's size |
setTablespace() |
Sets the tablespace to which the data file belongs |
The Datafile
class defines no public
types.
This method creates a new instance of
Datafile
, or a copy of an
existing one.
To create a new instance:
Datafile ( void )
To create a copy of an existing
Datafile
instance:
Datafile
(
const Datafile& datafile
)
New instance: None. Copy constructor: a
reference to the Datafile
instance to be copied.
A Datafile
object.
This method did not work as intended, and was removed in NDB 7.5.0 (Bug #47960, Bug #11756088).
Uint32 getFileNo ( void ) const
None.
The file number, as an unsigned 32-bit integer.
This method gets the free space available in the data file.
Uint64 getFree ( void ) const
None.
The number of bytes free in the data file, as an unsigned 64-bit integer.
This method did not work as intended, and was removed in NDB 7.5.0 (Bug #47960, Bug #11756088).
Uint32 getNode ( void ) const
None.
The node ID as an unsigned 32-bit integer.
This method is used to obtain the object ID of the data file.
virtual int getObjectId ( void ) const
None.
The datafile's object ID, as an integer.
This method is used to obtain the data file's object status.
virtual Object::Status getObjectStatus ( void ) const
None.
The data file's Status
. See
Object::Status.
This method retrieves the data file's object version (see NDB Schema Object Versions).
virtual int getObjectVersion ( void ) const
None.
The data file's object version, as an integer.
This method returns the file system path to the data file.
const char* getPath ( void ) const
None.
The path to the data file on the data node's file system, a string (character pointer).
This method gets the size of the data file in bytes.
Uint64 getSize ( void ) const
None.
The size of the data file, in bytes, as an unsigned 64-bit integer.
This method can be used to obtain the name of the tablespace to which the data file belongs.
You can also access the associated tablespace's ID directly. See Datafile::getTablespaceId().
const char* getTablespace ( void ) const
None.
The name of the associated tablespace (as a character pointer).
This method gets the ID of the tablespace to which the data file belongs.
You can also access the name of the associated tablespace directly. See Datafile::getTablespace().
Uint32 getTablespaceId ( void ) const
None.
This method returns the tablespace ID as an unsigned 32-bit integer.
This method did not work as intended, and was removed in NDB 7.5.0 (Bug #47960, Bug #11756088).
void setNode
(
Uint32 nodeId
)
The nodeId
of the node on which
the data file is to be located (an unsigned 32-bit integer
value).
None.
This method sets the path to the data file on the data node's file system.
const char* setPath ( void ) const
The path to the file, a string (as a character pointer).
None.
This method sets the size of the data file.
void setSize
(
Uint64 size
)
This method takes a single parameter—the desired
size
in bytes for the data file,
as an unsigned 64-bit integer.
None.
This method is used to associate the data file with a tablespace.
setTablespace()
can be invoked in either
of the two ways listed here:
Using the name of the tablespace, as shown here:
void setTablespace
(
const char* name
)
Using a reference to a
Tablespace
object.
void setTablespace
(
const class Tablespace& tablespace
)
This method takes a single parameter, which can be either one of the following:
The name
of the tablespace
(as a character pointer).
A reference tablespace
to the
corresponding
Tablespace
object.
None.