MySQL 5.6.14 Source Code Document
|
Public Member Functions | |
void | init (NdbQueryImpl &query, Uint32 fragNo) |
Uint32 | getFragNo () const |
void | prepareNextReceiveSet () |
void | grabNextResultSet () |
bool | hasReceivedMore () const |
void | setReceivedMore () |
void | incrOutstandingResults (Int32 delta) |
void | clearOutstandingResults () |
void | setConfReceived (Uint32 tcPtrI) |
bool | isFragBatchComplete () const |
NdbResultStream & | getResultStream (Uint32 operationNo) const |
NdbResultStream & | getResultStream (const NdbQueryOperationImpl &op) const |
Uint32 | getReceiverId () const |
Uint32 | getReceiverTcPtrI () const |
bool | finalBatchReceived () const |
bool | isEmpty () const |
void | setRemainingSubScans (Uint32 nodeMask) |
void | postFetchRelease () |
Static Public Member Functions | |
static void | buildReciverIdMap (NdbRootFragment *frags, Uint32 noOfFrags) |
static NdbRootFragment * | receiverIdLookup (NdbRootFragment *frags, Uint32 noOfFrags, Uint32 receiverId) |
static void | clear (NdbRootFragment *frags, Uint32 noOfFrags) |
If a query has a scan operation as its root, then that scan will normally read from several fragments of its target table. Each such root fragment scan, along with any child lookup operations that are spawned from it, runs independently, in the sense that:
This class manages the state of one such read operation, from one particular fragment of the target table of the root operation. If the root operation is a lookup, then there will be only one instance of this class.
Definition at line 177 of file NdbQueryOperation.cpp.
|
static |
Build hash map for mapping from root receiver id to NdbRootFragment instance.
For reasons unknow, NdbObjectIdMap shifts ids two bits to the left, so we must do the opposite to get a good hash distribution.
Definition at line 1088 of file NdbQueryOperation.cpp.
|
static |
Throw any pending ResultSets from specified rootFrags[]
Definition at line 1205 of file NdbQueryOperation.cpp.
bool NdbRootFragment::finalBatchReceived | ( | ) | const |
Definition at line 1291 of file NdbQueryOperation.cpp.
Uint32 NdbRootFragment::getReceiverId | ( | ) | const |
SPJ requests are identified by the receiver-id of the root ResultStream for each RootFragment. Furthermore a NEXTREQ use the tcPtrI saved in this ResultStream to identify the 'cursor' to restart.
We provide some convenient accessors for fetching this info
Definition at line 1309 of file NdbQueryOperation.cpp.
NdbResultStream & NdbRootFragment::getResultStream | ( | Uint32 | operationNo | ) | const |
Get the result stream that handles results derived from this root fragment for a particular operation.
operationNo | The id of the operation. |
Definition at line 1195 of file NdbQueryOperation.cpp.
void NdbRootFragment::grabNextResultSet | ( | ) |
Prepare for reading another batch of results.
Let the application thread takes ownership of an available ResultSet, prepare it for reading first row. Need mutex lock as 'm_availResultSets' is accesed both from receiver and application thread.
Definition at line 1267 of file NdbQueryOperation.cpp.
bool NdbRootFragment::hasReceivedMore | ( | ) | const |
Check if another ResultSets has been received and is available for reading. It will be given to the application thread when it call ::grabNextResultSet(). Need mutex lock as 'm_availResultSets' is accesed both from receiver and application thread.
Definition at line 1235 of file NdbQueryOperation.cpp.
void NdbRootFragment::init | ( | NdbQueryImpl & | query, |
Uint32 | fragNo | ||
) |
Initialize object.
query | Enclosing query. |
fragNo | This object manages state for reading from the fragNo'th fragment that the root operation accesses. |
Definition at line 1154 of file NdbQueryOperation.cpp.
bool NdbRootFragment::isEmpty | ( | ) | const |
Definition at line 1296 of file NdbQueryOperation.cpp.
|
inline |
The root operation will read from a number of fragments of a table. This method checks if all results for the current batch has been received for a given fragment. This includes both results for the root operation and any child operations. Note that child operations may access other fragments; the fragment number only refers to what the root operation does.
Definition at line 242 of file NdbQueryOperation.cpp.
void NdbRootFragment::postFetchRelease | ( | ) |
Release resources after last row has been returned
Release what we want need anymore after last available row has been returned from datanodes.
Don't 'delete' the object as it was in-place constructed from ResultStreamAlloc'ed memory. Memory is released by ResultStreamAlloc::reset().
Definition at line 1177 of file NdbQueryOperation.cpp.
void NdbRootFragment::prepareNextReceiveSet | ( | ) |
Prepare for receiving another batch of results.
Reset resultStream and all its descendants, since all these streams will get a new set of rows in the next batch.
Definition at line 1240 of file NdbQueryOperation.cpp.
|
static |
Find NdbRootFragment instance corresponding to a given root receiver id.
For reasons unknow, NdbObjectIdMap shifts ids two bits to the left, so we must do the opposite to get a good hash distribution.
Definition at line 1108 of file NdbQueryOperation.cpp.
void NdbRootFragment::setReceivedMore | ( | ) |
Signal that another complete ResultSet is available for this NdbRootFragment. Need mutex lock as 'm_availResultSets' is accesed both from receiver and application thread.
Definition at line 1222 of file NdbQueryOperation.cpp.
|
inline |
This method is used for marking which streams belonging to this NdbRootFragment which has remaining batches for a sub scan instantiated from the current batch of its parent operation.
Definition at line 278 of file NdbQueryOperation.cpp.