* Helper function to get the motion node entry for a given ID. NULL * is returned if the ID is unrecognized. */
| 836 | * is returned if the ID is unrecognized. |
| 837 | */ |
| 838 | static MotionNodeEntry * |
| 839 | getMotionNodeEntry(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. |
no test coverage detected