Documentation Home
MySQL NDB Cluster API Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 3.6Mb
PDF (A4) - 3.6Mb


2.3.17 The NdbIndexOperation Class

This section provides information about the NdbIndexOperation class.

NdbIndexOperation Class Overview

Parent class

NdbOperation

Child classes

None

Description

NdbIndexOperation represents an index operation for use in transactions. This class inherits from NdbOperation.

NdbIndexOperation can be used only with unique hash indexes; to work with ordered indexes, use NdbIndexScanOperation.

This class has no public constructor. To create an instance of NdbIndexOperation, it is necessary to use the NdbTransaction::getNdbIndexOperation() method.

Methods

The following table lists the public methods of this class and the purpose or use of each method:

Table 2.44 NdbIndexOperation class methods and descriptions

Name Description
deleteTuple() Removes a tuple from a table
getIndex() Gets the index used by the operation
readTuple() Reads a tuple from a table
updateTuple() Updates an existing tuple in a table

Index operations are not permitted to insert tuples.

Types

The NdbIndexOperation class defines no public types of its own.

For more information about the use of NdbIndexOperation, see Section 1.4.2.3.2, “Single-row operations”.

NdbIndexOperation::deleteTuple()

Description

This method defines the NdbIndexOperation as a DELETE operation. When the NdbTransaction::execute() method is invoked, the operation deletes a tuple from the table.

Signature
int deleteTuple
    (
      void
    )
Parameters

None.

Return value

0 on success, -1 on failure.

NdbIndexOperation::getIndex()

Description

Gets the index, given an index operation.

Signature
const NdbDictionary::Index* getIndex
    (
      void
    ) const
Parameters

None.

Return value

A pointer to an Index object.

NdbIndexOperation::readTuple()

Description

This method defines the NdbIndexOperation as a READ operation. When the NdbTransaction::execute() method is invoked, the operation reads a tuple.

Signature
int readTuple
    (
      LockMode mode
    )
Parameters

mode specifies the locking mode used by the read operation. See NdbOperation::LockMode, for possible values.

Return value

0 on success, -1 on failure.

NdbIndexOperation::updateTuple()

Description

This method defines the NdbIndexOperation as an UPDATE operation. When the NdbTransaction::execute() method is invoked, the operation updates a tuple found in the table.

Signature
int updateTuple
    (
      void
    )
Parameters

None.

Return value

0 on success, -1 on failure.