MySQL NDB Cluster API Developer Guide
This section provides information about the
NdbIndexOperation class.
None
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.
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.
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”.
This method defines the
NdbIndexOperation as a
DELETE operation. When the
NdbTransaction::execute()
method is invoked, the operation deletes a tuple from the
table.
int deleteTuple
(
void
)
None.
0 on success, -1 on
failure.
Gets the index, given an index operation.
const NdbDictionary::Index* getIndex
(
void
) const
None.
A pointer to an Index
object.
This method defines the
NdbIndexOperation as a
READ operation. When the
NdbTransaction::execute()
method is invoked, the operation reads a tuple.
int readTuple
(
LockMode mode
)
mode specifies the locking mode
used by the read operation. See
NdbOperation::LockMode, for possible
values.
0 on success, -1 on
failure.
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.
int updateTuple
(
void
)
None.
0 on success, -1 on
failure.