MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbResultStream Class Reference

Classes

class  TupleSet

Public Member Functions

 NdbResultStream (NdbQueryOperationImpl &operation, NdbRootFragment &rootFrag)
void prepare ()
void prepareNextReceiveSet ()
NdbReceivergetReceiver ()
const NdbReceivergetReceiver () const
const char * getCurrentRow ()
void execTRANSID_AI (const Uint32 *ptr, Uint32 len, TupleCorrelation correlation)
bool prepareResultSet (Uint32 remainingScans)
Uint16 firstResult ()
Uint16 nextResult ()
bool isEmpty () const
bool isSubScanComplete (Uint32 remainingScans) const
bool isScanQuery () const
bool isScanResult () const
bool isInnerJoin () const

Friends

NdbOut & operator<< (NdbOut &out, const NdbResultStream &)

Detailed Description

This class manages the subset of result data for one operation that is derived from one fragment of the root operation. Note that the result tuples may come from any fragment, but they all have initial ancestors from the same fragment of the root operation. For each operation there will thus be one NdbResultStream for each fragment that the root operation reads from (one in the case of lookups.) This class has an NdbReceiver object for processing tuples as well as structures for correlating child and parent tuples.

Definition at line 409 of file NdbQueryOperation.cpp.

Constructor & Destructor Documentation

NdbResultStream::NdbResultStream ( NdbQueryOperationImpl operation,
NdbRootFragment rootFrag 
)
explicit
Parameters
operationThe operation for which we will receive results.
rootFragNo0..n-1 when the root operation reads from n fragments.

Definition at line 706 of file NdbQueryOperation.cpp.

Member Function Documentation

void NdbResultStream::execTRANSID_AI ( const Uint32 *  ptr,
Uint32  len,
TupleCorrelation  correlation 
)

Process an incomming tuple for this stream. Extract parent and own tuple ids and pass it on to m_receiver.

Parameters
ptrbuffer holding tuple.
lenbuffer length.

Callback when a TRANSID_AI signal (receive row) is processed.

Store TupleCorrelation.

Definition at line 880 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

Uint16 NdbResultStream::firstResult ( )

Navigate within the current ResultSet to resp. first and next row. For non-parent operations in the pushed query, navigation is with respect to any preceding parents which results in this ResultSet depends on. Returns either the tupleNo within TupleSet[] which we navigated to, or tupleNotFound().

Definition at line 836 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

bool NdbResultStream::isEmpty ( ) const
inline

Returns true if last row matching the current parent tuple has been consumed.

Definition at line 469 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

bool NdbResultStream::isSubScanComplete ( Uint32  remainingScans) const
inline

This method returns true if this result stream holds the last batch of a sub scan. This means that it is the last batch of the scan that was instantiated from the current batch of its parent operation.

Find the node number seen by the SPJ block. Since a unique index operation will have two distincts nodes in the tree used by the SPJ block, this number may be different from 'opNo'.

Definition at line 478 of file NdbQueryOperation.cpp.

Here is the caller graph for this function:

void NdbResultStream::prepare ( )

Prepare for receiving first results.

Definition at line 739 of file NdbQueryOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void NdbResultStream::prepareNextReceiveSet ( )

Prepare for receiving next batch of scan results.

Make preparation for another batch of results to be received. This NdbResultStream, and all its sibling will receive a batch of results from the datanodes.

If this stream will get new rows in the next batch, then so will all of its descendants.

Definition at line 902 of file NdbQueryOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool NdbResultStream::prepareResultSet ( Uint32  remainingScans)

A complete batch has been received for a fragment on this NdbResultStream, Update whatever required before the appl. are allowed to navigate the result.

Returns
true if node and all its siblings have returned all rows.

Make preparations for another batch of result to be read:

  • Fill in parent/child result correlations in m_tupleSet[]
  • ... or reset m_tupleSet[] if we reuse the previous.
  • Apply inner/outer join filtering to remove non qualifying rows.

Prepare NdbResultSet for reading - either the next received from datanodes or reuse the last as has been determined by ::prepareNextReceiveSet()

Recursively iterate all child results depth first. Filter away any result rows which should not be visible (yet) - Either due to incomplete child batches, or the join being an 'inner join'. Set result itterator state to 'before first' resultrow.

Definition at line 930 of file NdbQueryOperation.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

NdbOut& operator<< ( NdbOut &  out,
const NdbResultStream stream 
)
friend

For debugging.

Definition at line 5205 of file NdbQueryOperation.cpp.


The documentation for this class was generated from the following file: