MCPcopy Create free account
hub / github.com/apache/cloudberry / getMotionNodeEntry

Function getMotionNodeEntry

src/backend/cdb/motion/cdbmotion.c:838–859  ·  view source on GitHub ↗

* Helper function to get the motion node entry for a given ID. NULL * is returned if the ID is unrecognized. */

Source from the content-addressed store, hash-verified

836 * is returned if the ID is unrecognized.
837 */
838static MotionNodeEntry *
839getMotionNodeEntry(MotionLayerState *mlStates, int16 motNodeID)
840{
841 MotionNodeEntry *pMNEntry = NULL;
842
843 if (motNodeID > mlStates->mneCount ||
844 !mlStates->mnEntries[motNodeID - 1].valid)
845 {
846 ereport(ERROR,
847 (errcode(ERRCODE_GP_INTERCONNECTION_ERROR),
848 errmsg("interconnect error: Unexpected Motion Node Id: %d",
849 motNodeID),
850 errdetail("This means a motion node that wasn't setup is requesting interconnect resources.")));
851 }
852 else
853 pMNEntry = &mlStates->mnEntries[motNodeID - 1];
854
855 if (pMNEntry != NULL)
856 Assert(pMNEntry->motion_node_id == motNodeID);
857
858 return pMNEntry;
859}
860
861/*
862 * Retrieve the chunk-sorter entry for the specified motion-node/source pair.

Callers 7

SendStopMessageFunction · 0.85
CheckAndSendRecordCacheFunction · 0.85
SendTupleFunction · 0.85
SendEndOfStreamFunction · 0.85
RecvTupleFromFunction · 0.85
EndMotionLayerNodeFunction · 0.85

Calls 3

errcodeFunction · 0.50
errmsgFunction · 0.50
errdetailFunction · 0.50

Tested by

no test coverage detected